123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- #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 <QMutex>
- #include <memory>
- 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<iv::gps::gpsimu> mGPSIMUptr = 0;
- qint64 mnGPSUpdateTime = 0;
- QMutex mMutexGPS;
- std::shared_ptr<iv::radar::radarobjectarray> mRADAR = 0;
- qint64 mnRADARUpdateTime = 0;
- QMutex mMutexRADAR;
- std::shared_ptr<std::vector<iv::ObstacleBasic> > mlidar_obs;
- qint64 mnLIDARUpdateTime = 0;
- QMutex mMutexLIDAR;
- std::vector<iv::GPSData> mnavigation_data; //导航数据,GPS结构体数组
- qint64 mnMAPUpdateTime = 0;
- QMutex mMutexMAP;
- std::shared_ptr<iv::mobileye::mobileye> mmobileye;
- qint64 mnmobileyeUpdateTime = 0;
- QMutex mMutexmobileye;
- std::shared_ptr<iv::hmi::hmimsg> mHMImsg;
- qint64 mnHMIUpdateTime = 0;
- QMutex mMutexHMI;
- private:
- const qint64 mnNewThresh = 1000; //3 seconds
- public:
- bool GetGPS(iv::GPSData & xGPSData);
- bool GetRADAR(std::shared_ptr<iv::radar::radarobjectarray> & xRADAR);
- bool GetLIDARGrid(iv::LidarGridPtr & lidargridptr);
- bool GetLIDARObs(std::shared_ptr<std::vector<iv::ObstacleBasic> > & xlidar_obs);
- bool IsMAPUpdate(qint64 & nLastUpdateTime);
- bool GetMAP(std::vector<iv::GPSData> & navigation_data,qint64 & nLastUpdateTime);
- bool GetMobileye(std::shared_ptr<iv::mobileye::mobileye> & xmobileye);
- bool GetHMImsg(std::shared_ptr<iv::hmi::hmimsg> & xhmimsg);
- // void GetLidarPtr();
- // void GetRadar();
- // void GetMap();
- // bool IsMapUpdate();
- // void GetMobileye();
- };
- }
- #endif // IVDECISION_H
|