comm.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. #pragma once
  2. #include <unordered_map>
  3. #include <vector>
  4. template<typename T>
  5. struct FVector3
  6. {
  7. T X;
  8. T Y;
  9. T Z;
  10. };
  11. enum RadarPosition :int32_t
  12. {
  13. RADAR_LEFT,
  14. RADAR_RIGHT,
  15. RADAR_REAR,
  16. RADAR_ALL
  17. };
  18. enum RenderPosition :int32_t
  19. {
  20. FRONT,
  21. BACK,
  22. LEFT,
  23. RIGHT,
  24. DASHBOARD,
  25. DASHBOARD_m,
  26. ALL
  27. };
  28. enum EgoType :int32_t
  29. {
  30. None,
  31. User,
  32. Car
  33. };
  34. enum ChannelType:int32_t
  35. {
  36. CHANNEL_CAR,
  37. CHANNEL_IMU,
  38. CHANNEL_RADAR,
  39. #ifdef LIDAR_SENSOR
  40. CHANNEL_LEFT_LIDAR,
  41. CHANNEL_RIGHT_LIDAR,
  42. #endif
  43. CHANNEL_ALL,
  44. };
  45. enum UserState
  46. {
  47. Offline=0,
  48. Idle = 1,
  49. Remote = 2,
  50. Automotive = 3,
  51. AskRemote = 4
  52. };
  53. struct UserCamera
  54. {
  55. int32_t uid;
  56. EgoType type;
  57. UserState state;
  58. std::string name;
  59. };
  60. struct OfferDesc
  61. {
  62. char type[16];
  63. char sdp[4096 * 3-16];
  64. };
  65. struct AnswerDesc
  66. {
  67. char type[16];
  68. char sdp[4096 * 3 - 16];
  69. };
  70. struct CandidateDesc
  71. {
  72. char candidate[4096];
  73. char sdp_mid[4096];
  74. int32_t sdp_mline_index;
  75. };
  76. #pragma pack(1)
  77. #define CAN_MSG_LEN 13
  78. struct cannet_frame
  79. {
  80. int8_t dlc;
  81. int32_t canid;
  82. int8_t data[8];
  83. };
  84. #pragma pack(1)
  85. #define CAN_MSG_LEN 13
  86. struct cannet_busframe
  87. {
  88. int8_t dlc;
  89. int32_t canid;
  90. int8_t data[8];
  91. };
  92. #pragma pack()
  93. enum RobotStatus
  94. {
  95. OK,
  96. Fail,
  97. };
  98. struct FeedData
  99. {
  100. /*
  101. int32_t Engine_speed = 1;//发动机转速
  102. int32_t Travel_speed = 2;//行驶速度
  103. int32_t Fuel_level = 3;//燃油油位
  104. int32_t Engine_temperature = 4;//发动机水温
  105. int32_t Hydraulic_oil_temperature = 5;//液压油油温
  106. int32_t Main_pump_1_pressure = 6;//主泵1压力
  107. int32_t Main_pump_2_pressure = 7;//主泵2压力
  108. int32_t Hand_gear = 8;//水箱水位
  109. int32_t Actual_gear = 9;//发动机机油压力
  110. _Float32 Gripper_height = 10;//抓具高度
  111. _Float32 amplitude = 11;//幅度
  112. int32_t Boom_angle = 12;//动臂角度
  113. int32_t Stick_angle = 13;//斗杆角度
  114. int32_t Idle_protection = 14;//怠速保护
  115. int32_t Front_toggle = 15;//前轮对中
  116. int32_t Back_toggle = 16;//后轮对中
  117. int8_t Error_Buff[8];//报警信息
  118. */
  119. int32_t work_pressure = 1;//工作系统压力
  120. int32_t brake_pressure = 2; //制动系统压力
  121. int32_t gearbox_oil_temp = 3;//变速箱油温
  122. int32_t gearbox_oil_pressure = 4; //变速箱油压
  123. int32_t engine_rpm = 5;//发动机转速
  124. int32_t speed = 6;//不知道?---可能是后加的传感器---驱动轮增量编码器
  125. int32_t gear = 7;
  126. int32_t engine_pressure = 8;//发动机压力
  127. int32_t cold_water = 9;//冷却液温度-发动机水温
  128. //int32_t steer_angle = 10;
  129. float steer_angle = 10;//转向角度(原来金川是轮子的现在大冶用铰链位置) 铰接转向姿态编码器
  130. int32_t left_lock = 11;//遥操模式
  131. int32_t right_lock = 12;//人工模式
  132. //大冶新加的
  133. int32_t engine_time = 13;//发动机运行小时
  134. int32_t wire_sensor_l = 14;//拉线传感器左侧
  135. int32_t wire_sensor_r = 15;//拉线传感器右侧
  136. int32_t fuel_level = 16;//燃油油位
  137. int32_t lock_switch_l = 17;//锁钩到位开关左
  138. int32_t lock_switch_r = 18; //锁钩到位开关右
  139. int32_t tip_limit = 19;//倾翻限位
  140. int32_t turn_left = 20;//左转
  141. int32_t turn_right = 21;//右转
  142. int32_t hight_beam = 22;//远光灯
  143. int32_t low_beam = 23;//近光灯
  144. int32_t parking = 24;//驻车
  145. int32_t brake = 25;//刹车
  146. int32_t back_car = 26;//倒车
  147. int32_t front_work_lamp = 27;//前工作灯
  148. int32_t rear_work_lamp = 28;//后工作灯
  149. int32_t cargo_weight = 29;//渣包重量
  150. int32_t system_vol = 30;//系统电压
  151. int8_t Error_Buff[8];//报警信息
  152. int32_t f_gear = 32;//1F,2R,3N
  153. int32_t gear_1 =33;//1,2,3,4
  154. int32_t outgrigger_l = 34;//左支腿伸到位开关
  155. int32_t outgrigger_r = 35;//右支腿伸到位开关
  156. int32_t tip_pressure = 36;//倾翻压力开关
  157. };
  158. struct cannet_frame_receive
  159. {
  160. int32_t canid;
  161. int8_t dlc;
  162. uint8_t data[8];
  163. };
  164. struct Gsml_Info
  165. {
  166. int32_t m_record;
  167. int32_t m_device;
  168. int64_t m_time;
  169. };