#ifndef IVDECISION_H #define IVDECISION_H #include "ivmodule.h" #include "modulecomm.h" #include "gps_type.h" #include "obstacle_type.h" #include "gpsimu.pb.h" #include "radarobjectarray.pb.h" #include "mobileye.pb.h" #include "hmi.pb.h" #include "decition.pb.h" #include #include namespace iv { class ivdecision : public ivmodule { public: ivdecision(); public: virtual void modulerun(); public: virtual int getdecision(iv::brain::decition & xdecition) = 0; virtual void sharemsg() = 0; private: std::string mstrgpsmsgname = "hcp2_gpsimu"; std::string mstrlidarmsgname = "lidar_obs"; std::string mstrradarmsgname = "radar"; std::string mstrmapmsgname = "tracemap"; std::string mstrmobileyemsgname = "mobileye"; std::string mstrhmimsgname = "hmi"; std::string mstrpadmsgname = "pad"; private: void * mpagpsmsg; void * mpalidarmsg; void * mparadarmsg; void * mpamapmsg; void * mpamobileyemsg; void * mpahmimsg; void * mpapadmsg; private: void UpdateGPS(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname); void UpdateRADAR(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname); void UpdateLIDAR(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname); void UpdateMAP(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname); void UpdateMobileye(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname); void UpdateHMI(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname); private: iv::GPSData mNowGPS; std::shared_ptr mGPSIMUptr = 0; qint64 mnGPSUpdateTime = 0; QMutex mMutexGPS; std::shared_ptr mRADAR = 0; qint64 mnRADARUpdateTime = 0; QMutex mMutexRADAR; std::shared_ptr > mlidar_obs; qint64 mnLIDARUpdateTime = 0; QMutex mMutexLIDAR; std::vector mnavigation_data; //导航数据,GPS结构体数组 qint64 mnMAPUpdateTime = 0; QMutex mMutexMAP; std::shared_ptr mmobileye; qint64 mnmobileyeUpdateTime = 0; QMutex mMutexmobileye; std::shared_ptr mHMImsg; qint64 mnHMIUpdateTime = 0; QMutex mMutexHMI; private: const qint64 mnNewThresh = 1000; //3 seconds public: bool GetGPS(iv::GPSData & xGPSData); bool GetRADAR(std::shared_ptr & xRADAR); bool GetLIDARGrid(iv::LidarGridPtr & lidargridptr); bool GetLIDARObs(std::shared_ptr > & xlidar_obs); bool IsMAPUpdate(qint64 & nLastUpdateTime); bool GetMAP(std::vector & navigation_data,qint64 & nLastUpdateTime); bool GetMobileye(std::shared_ptr & xmobileye); bool GetHMImsg(std::shared_ptr & xhmimsg); // void GetLidarPtr(); // void GetRadar(); // void GetMap(); // bool IsMapUpdate(); // void GetMobileye(); }; } #endif // IVDECISION_H