gps_type.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #pragma once
  2. /*
  3. *GPS 惯导数据
  4. */
  5. #ifndef _IV_COMMON_GPS_TYPE_
  6. #define _IV_COMMON_GPS_TYPE_
  7. #include "boost.h"
  8. namespace iv {
  9. struct GPS_INS
  10. {
  11. int valid = 0xff;
  12. int index = 0; //gps点序号
  13. double gps_lat = 0;//纬度
  14. double gps_lng = 0;//经度
  15. double gps_x = 0;
  16. double gps_y = 0;
  17. double gps_z = 0;
  18. double ins_roll_angle = 0; //横滚角 一般定义载体的右、前、上三个方向构成右手系,绕向前的轴旋转就是横滚角,绕向右的轴旋转就是俯仰角,绕向上的轴旋转就是航向角
  19. double ins_pitch_angle = 0; //俯仰角
  20. double ins_heading_angle = 0; //航向角
  21. int ins_status = 0; //惯导状态 4
  22. int rtk_status = 0; //rtk状态 6 -5 -3
  23. int gps_satelites_num = 0;
  24. //-----加速度--------------
  25. double accel_x = 0;
  26. double accel_y = 0;
  27. double accel_z = 0;
  28. //-------角速度------------
  29. double ang_rate_x = 0;
  30. double ang_rate_y = 0;
  31. double ang_rate_z = 0;
  32. //-----------方向速度--------------
  33. double vel_N = 0;
  34. double vel_E = 0;
  35. double vel_D = 0;
  36. int speed_mode = 0;
  37. int mode2 = 0;
  38. double speed = -1; //速度 若导航点则为导航预设速度 若为当前点则为当前车速
  39. int roadMode;
  40. int runMode;
  41. int roadSum;
  42. int roadOri;
  43. double mfLaneWidth = 3.5; // Current Lane Width
  44. double mfDisToLaneLeft = 1.8; //Distance to Lane Left
  45. int mnLaneChangeMark = 0; //1 to Left 0 not change -1 to right
  46. double mfDisToRoadLeft = 1.8; //Distance to Road Left
  47. double mfRoadWidth = 3.5; // Road Width
  48. bool mbInLaneAvoid = false; //if true suport In Lane Avoid
  49. double gps_lat_avoidleft;
  50. double gps_lng_avoidleft;
  51. double gps_lat_avoidright;
  52. double gps_lng_avoidright;
  53. double gps_x_avoidleft = 0;
  54. double gps_y_avoidleft = 0;
  55. double gps_x_avoidright = 0;
  56. double gps_y_avoidright = 0;
  57. };
  58. // typedef std::shared_ptr<iv::GPS_INS> GPSData;
  59. typedef boost::shared_ptr<iv::GPS_INS> GPSData;
  60. struct Station
  61. {
  62. int index;
  63. GPS_INS station_location;
  64. int map_index;
  65. };
  66. class Point2D
  67. {
  68. public:
  69. double x = 0, y = 0, speed=0,obs_speed_x=0,obs_speed_y=0;
  70. int v1 = 0, v2 = 0;
  71. int roadMode = 0;
  72. int obs_type=0;
  73. Point2D()
  74. {
  75. x = y = v1 = 0;
  76. }
  77. Point2D(double _x, double _y)
  78. {
  79. x = _x; y = _y;
  80. }
  81. };
  82. class TracePoint
  83. {
  84. public:
  85. double x = 0, y = 0, speed=0;
  86. int v1 = 0, v2 = 0;
  87. int roadMode = 0;
  88. TracePoint()
  89. {
  90. x = y = v1 = 0;
  91. }
  92. TracePoint(double _x, double _y)
  93. {
  94. x = _x; y = _y;
  95. }
  96. };
  97. class TrafficLight
  98. {
  99. public:
  100. int leftColor = 0, rightColor = 0, straightColor=0, uturnColor=0;
  101. int leftTime=0, rightTime=0 ,straightTime=0, uturnTime=0;
  102. TrafficLight()
  103. {
  104. leftColor = 0, rightColor = 0, straightColor=0, uturnColor=0;
  105. leftTime=0, rightTime=0 ,straightTime=0, uturnTime=0;
  106. }
  107. };
  108. class StationCmd
  109. {
  110. public:
  111. bool received;
  112. uint32_t carID,carMode,emergencyStop,stationStop;
  113. bool has_carID,has_carMode,has_emergencyStop,has_stationStop,mode_manual_drive;
  114. uint32_t stationID[20];
  115. GPS_INS stationGps[20];
  116. uint32_t stationTotalNum;
  117. StationCmd()
  118. {
  119. received=false;
  120. has_carID=false;
  121. has_carMode=false;
  122. has_emergencyStop=false;
  123. has_stationStop=false;
  124. mode_manual_drive=false;
  125. carID=0;
  126. carMode=0;
  127. emergencyStop=0;
  128. stationStop=0;
  129. stationTotalNum=0;
  130. }
  131. };
  132. }
  133. #endif // !_IV_COMMON_GPS_TYPE_