123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- #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 "vbox.pb.h"
- #include "v2x.pb.h"
- #include "ultrasonic.pb.h"
- #include "brainstate.pb.h"
- #include "radio_send.pb.h"
- #include "chassis.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,iv::brain::brainstate & xbs) = 0;
- void sharemsg(iv::brain::decition & xdecition,iv::brain::brainstate & xbs);
- 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";
- std::string mstrp900msgname = "p900_send";
- std::string mstrv2xmsgname = "v2x";
- std::string mstrultramsgname = "ultra";
- std::string mstrvboxmsgname = "vbox";
- std::string mstrchassismsgname = "chassis";
- std::string mstrdecisionmsgname = "deciton";
- std::string mstrbrainstatemsgname = "brainstate";
- private:
- void * mpagpsmsg;
- void * mpalidarmsg;
- void * mparadarmsg;
- void * mpamapmsg;
- void * mpamobileyemsg;
- void * mpahmimsg;
- void * mpapadmsg;
- void * mpap900msg;
- void * mpav2xmsg;
- void * mpaultramsg;
- void * mpavboxmsg;
- void * mpachassismsg;
- void * mpaDecition;
- void * mpaVechicleState;
- 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);
- void UpdateVbox(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
- void Updatev2x(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
- void Updateultrasonic(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
- void Updatep900(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
- void UpdatepChassis(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;
- std::shared_ptr<iv::vbox::vbox> mvboxmsg;
- qint64 mnvboxUpdateTime = 0;
- QMutex mMutexvbox;
- std::shared_ptr<iv::v2x::v2x> mv2xmsg;
- qint64 mnv2xUpdateTime = 0;
- QMutex mMutexv2x;
- std::shared_ptr<iv::ultrasonic::ultrasonic> multrasonicmsg;
- qint64 mnultrasonicUpdateTime = 0;
- QMutex mMutexultrasonic;
- std::shared_ptr<iv::radio::radio_send> mp900msg;
- qint64 mnp900UpdateTime = 0;
- QMutex mMutexp900;
- std::shared_ptr<iv::chassis> mchassismsg;
- qint64 mnchassisUpdateTime = 0;
- QMutex mMutexchassis;
- private:
- const qint64 mnNewThresh = 1000; //1 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);
- bool Getvboxmsg(std::shared_ptr<iv::vbox::vbox> & xvboxmsg);
- bool Getv2xmsg(std::shared_ptr<iv::v2x::v2x> & xv2xmsg);
- bool Getultrasonic(std::shared_ptr<iv::ultrasonic::ultrasonic> & xultramsg);
- bool Getp900(std::shared_ptr<iv::radio::radio_send> & xp900msg);
- bool Getchassis(std::shared_ptr<iv::chassis> & xchassismsg);
- // void GetLidarPtr();
- // void GetRadar();
- // void GetMap();
- // bool IsMapUpdate();
- // void GetMobileye();
- };
- }
- #endif // IVDECISION_H
|