#pragma once #ifndef _IV_COMMON_CAR_STATUS_ #define _IV_COMMON_CAR_STATUS_ #include #include #include #include #include #include #include ///kkcai, 2020-01-03 #include /////////////////////////////////////// #include "platform/platform.h" #include "ultrasonic_type.h" //#include "common/decitionview.pb.h" #include "common/sysparam_type.h" #include "common/roadmode_type.h" #include "common/comonstruct.h" #define RADAR_OBJ_NUM 64 #ifdef linux unsigned long GetTickCount(); #endif namespace iv { class CarStatus : public boost::noncopyable { public: CarStatus(); ~CarStatus(); float speed; //车速 double mfCalAcc = 0; std::int16_t wheel_angle; //方向盘转角 std::uint8_t braking_pressure; //刹车压力 float torque_st=0; bool mbRunPause = false; bool mbBrainCtring = false; bool status[6] = { true, false, false, false, true, false }; //bool arrive = false; // x4:是否到达站点(0:未到 1:到达) //bool people = false; // x3:车上是否有人(0:无人 1:有人) //bool stop = false; // x2:是否停车(0:否 1:是) //bool call = false; // x1:是否叫车(0:否 1:是) //bool available = true; // 是否可被叫车 //bool fire = false; // int carState = 0; // 0:停车 1:正常循迹 2:前往站点 int carState = 0; // 0:停车 1:正常循迹 2:前往站点 int emergencyStop=0; int station_control_door=0;//0: door close 1:door open bool station_control_door_option=false; int istostation = 0; //int ctostation = 0; int currentstation = 0; //int nextstation = 0; int clientto = 0; double amilng = 0.0; double amilat = 0.0; bool busmode = false; bool netconnect = false; bool doorsta=false; unsigned char speedlimte; int grade=0; int driverMode=0; int epb=0; int epsMode=1; float engine_speed=0; bool receiveEps=false; bool speed_control=true; bool group_control =false; int group_server_status=0; int group_state = 0; float group_x_local = 0.0; float group_y_local = 0.0; float group_velx_local = 0.0; float group_vely_local = 0.0; float group_comm_speed = 0.0; int group_pathpoint=0; float group_offsetx=0.0; float group_frontDistance=0.0; float mfttc = 0; std::vector car_stations; AWS_display aws_display; lane Lane; obstacle_status obstacleStatus; obstacle_data_a obstacleStatusA[15]; obstacle_data_b obstacleStatusB[15]; obstacle_data_c obstacleStatusC[15]; aftermarket_lane aftermarketLane; lka_left_lane_a LKAleftLaneA; lka_left_lane_b LKAleftLaneB; lka_right_lane_a LKArightLaneA; lka_right_lane_b LKArightLaneB; next_lane_a nextLaneA_left[4], nextLaneA_right[4]; next_lane_b nextLaneB_left[4], nextLaneB_right[4]; ref_points refPoints; num_of_next_lane_mark_reported numOfNextLaneMarkReported; double mfAcc = 0; double mfVehAcc=0; double mfWheel = 0; double mfBrake = 0; double steerAngle=0; QTime mRunTime; int mRadarS = -1; int mLidarS = -1; int mRTKStatus = 0; int mLidarPer = -1; double mLidarObs; double mRadarObs; double mObs; GPS_INS aim_gps_ins; bool bocheMode=false; int bocheEnable=0; double mfParkLat; double mfParkLng; double mfParkHeading; int mnParkType; double mLidarRotation; double mLidarRangeUnit; iv::GPSData location; //当前车辆位置 boost::array obs_radar;//毫米波雷达的障碍物数据 boost::array obs_rear_radar;//houxiang毫米波雷达的障碍物数据 iv::ultrasonic_obs multrasonic_obs; std::vector obsTraceLeft,obsTraceRight; double mfGPSAcc = 0; // iv::brain::decitionview mdecitionview; iv::sysparam msysparam; iv::roadmode_vel mroadmode_vel; int vehGroupId; double mfEPSOff = 0.0; float socfDis=15; //停障触发距离 float aocfDis=25; //避障触发距离 float aocfTimes=5; //避障触发次数 float aobzDis=5; //避障保障距离 /// traffice light : 0x90 int iTrafficeLightID = 0; //红绿灯ID int iTrafficeLightColor = 2; //0x0: 红色 //0x1: 黄色 //0x2: 绿色 int iTrafficeLightTime = 0; //红绿灯剩余时间 double iTrafficeLightLat = 0; double iTrafficeLightLon = 0; bool daocheMode=false; ////////////////////////////////////////////////////// ///kkcai, 2020-01-03 QMutex mMutexMap; ///////////////////////////////////// //mobileEye chuku float vehSpeed_st=0; bool useMobileEye = false; bool m_bOutGarage=false;//车道线识别出库标志 float outGarageLong=10; float waitGpsTimeWidth=5000; int mnBocheComplete = 0; //When boche comple set a value. uint32_t ultraDistance[13]; bool useObsPredict = false; bool useLidarPerPredict = false; bool avoidObs = false; bool inRoadAvoid = false; //hapo station 2021/02/05 iv::StationCmd stationCmd; }; typedef boost::serialization::singleton CarStatusSingleton;//非线程安全,注意多线程加锁,单例模式 } #define ServiceCarStatus iv::CarStatusSingleton::get_mutable_instance() #endif // !_IV_COMMON_CAR_STATUS_