ivdecision.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef IVDECISION_H
  2. #define IVDECISION_H
  3. #include "ivmodule.h"
  4. #include "modulecomm.h"
  5. #include "gps_type.h"
  6. #include "gpsimu.pb.h"
  7. #include "radarobjectarray.pb.h"
  8. #include <QMutex>
  9. #include <memory>
  10. namespace iv {
  11. class ivdecision : public ivmodule
  12. {
  13. public:
  14. ivdecision();
  15. public:
  16. virtual void modulerun();
  17. public:
  18. virtual void rundecision() = 0;
  19. virtual void sharemsg() = 0;
  20. private:
  21. std::string strgpsmsgname = "hcp2_gpsimu";
  22. std::string strlidarmsgname = "lidar_obs";
  23. std::string strradarmsgname = "radar";
  24. std::string strmapmsgname = "tracemap";
  25. std::string strmobileyemsgname = "mobileye";
  26. private:
  27. void * mpagpsmsg;
  28. void * mpalidarmsg;
  29. void * mparadarmsg;
  30. void * mpamapmsg;
  31. void * mpamobileyemsg;
  32. private:
  33. void UpdateGPSMsg(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  34. void UpdateRADARMsg(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  35. private:
  36. iv::GPSData mNowGPS;
  37. std::shared_ptr<iv::gps::gpsimu> mGPSIMUptr = 0;
  38. qint64 mnGPSUpdateTime = 0;
  39. QMutex mMutexGPS;
  40. std::shared_ptr<iv::radar::radarobjectarray> mRADAR = 0;
  41. qint64 mnRADARUpdateTime = 0;
  42. QMutex mMutexRADAR;
  43. private:
  44. const qint64 mnNewThresh = 1000; //3 seconds
  45. public:
  46. bool GetGPS(iv::GPSData & xGPSData);
  47. bool GetRADAR(std::shared_ptr<iv::radar::radarobjectarray> & xRADAR);
  48. // void GetLidarPtr();
  49. // void GetRadar();
  50. // void GetMap();
  51. // bool IsMapUpdate();
  52. // void GetMobileye();
  53. };
  54. }
  55. #endif // IVDECISION_H