comm.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. #pragma once
  2. #include<string>
  3. #include <unordered_map>
  4. #include <vector>
  5. template<typename T>
  6. struct FVector3
  7. {
  8. T X;
  9. T Y;
  10. T Z;
  11. };
  12. typedef FVector3<double> FVector3d;
  13. enum RadarPosition :int32_t
  14. {
  15. RADAR_LEFT,
  16. RADAR_RIGHT,
  17. RADAR_REAR,
  18. RADAR_ALL
  19. };
  20. enum RenderPosition :int32_t
  21. {
  22. FRONT,
  23. BACK,
  24. LEFT,
  25. RIGHT,
  26. LANCHOR,
  27. //RANCHOR,
  28. ALL
  29. };
  30. enum EgoType :int32_t
  31. {
  32. None,
  33. User,
  34. Car
  35. };
  36. enum CarType
  37. {
  38. ZJ,
  39. KRESS,
  40. };
  41. enum ChannelType:int32_t
  42. {
  43. CHANNEL_CAR,
  44. CHANNEL_IMU,
  45. CHANNEL_RADAR,
  46. //CHANNEL_ENCODE,
  47. CHANNEL_ALL,
  48. };
  49. enum WorkArea
  50. {
  51. Area_A,
  52. Area_B,
  53. Area_C,
  54. Area_D,
  55. Area_E,
  56. Area_F,
  57. Area_G,
  58. Area_H,
  59. Area_I,
  60. Area_J,
  61. Area_ALL
  62. };
  63. enum Metal_Area
  64. {
  65. Put_Wait =0,
  66. Put_1=1,
  67. Put_2=2,
  68. Put_3=3,
  69. Get_Wait=10,
  70. Get_1=11,
  71. Get_2=12,
  72. Get_3=13,
  73. Out_Area=100
  74. };
  75. enum UserState
  76. {
  77. Offline,
  78. Idle = 1,
  79. Remote = 2,
  80. Automotive = 3,
  81. AskRemote = 4
  82. };
  83. enum MoveDesc
  84. {
  85. Move_OK = 0,
  86. Move_Encode_Fail = 1,
  87. Move_Unknow_Fail = 2
  88. };
  89. enum Lock_Status
  90. {
  91. Lock_Open,
  92. Lock_Closed,
  93. Lock_CloseInvalid,
  94. };
  95. //车辆信息管理
  96. struct UserCamera
  97. {
  98. int32_t uid;
  99. EgoType type;
  100. UserState state;
  101. CarType carType;
  102. std::string name;
  103. std::string viewurl;
  104. };
  105. struct OfferDesc
  106. {
  107. char type[16];
  108. char sdp[4096 * 3-16];
  109. };
  110. struct AnswerDesc
  111. {
  112. char type[16];
  113. char sdp[4096 * 3 - 16];
  114. };
  115. struct CandidateDesc
  116. {
  117. char candidate[4096];
  118. char sdp_mid[4096];
  119. int32_t sdp_mline_index;
  120. };
  121. #pragma pack(1)
  122. #define CAN_MSG_LEN 13
  123. struct cannet_frame
  124. {
  125. int8_t dlc;
  126. int32_t canid;
  127. int8_t data[8];
  128. };
  129. #pragma pack()
  130. enum RobotStatus
  131. {
  132. OK,
  133. Fail,
  134. };
  135. struct FeedData
  136. {
  137. int32_t engine_speed;
  138. int32_t travel_speed;
  139. int32_t fuel_level;
  140. int32_t engine_temperature;
  141. int32_t hydraulic_oil_temperature;
  142. int32_t main_pump_1_pressure;
  143. int32_t main_pump_2_pressure;
  144. int32_t hand_gear;
  145. int32_t actual_gear;
  146. float gripper_height;
  147. float amplitude;
  148. int32_t boom_angle;
  149. int32_t stick_angle;
  150. int32_t idle_protection;
  151. int32_t front_toggle;
  152. int32_t back_toggle;
  153. int32_t interlock ;//启动联锁
  154. int32_t safety_valves;//安全开关阀
  155. int32_t safety_switch ;//安全开关阀异常
  156. int32_t arm_lift_pilot ;//大臂提升先导比例阀异常
  157. int32_t arm_lowering_pilot ;//大臂下降先导比例阀异常
  158. int32_t lever_lifting_pilot ;//斗杆提升先导比例阀异常
  159. int32_t rod_lowering_pilot ;//斗杆下降先导比例阀异常
  160. int32_t left_rotary_pilot ;//左回转先导比例阀异常
  161. int32_t right_rotary_pilot ;//右回转先导比例阀异常
  162. int32_t grab_open_pilot ;//抓斗开启先导比例阀异常
  163. int32_t grab_close_pilot ;//抓斗闭合先导比例阀异常
  164. int8_t warningData[8];
  165. bool liftpilotpressuresensor_f;
  166. bool loweringpilotpressuresensor_f;
  167. bool leverliftpilotpressuresensor_f;
  168. bool rodloweringpilotpressurepensor_f;
  169. bool leftturnpilotpressuresensor_f;
  170. bool rightturnpilotpressuresensor_f;
  171. bool legextensionpilotpressuresensor_f;
  172. bool legretractpilotpressuresensor_f;
  173. bool grabopenpilotpressuresensor_f;
  174. bool grabclosurepilotpressuresensor_f;
  175. bool mainpump1pressuresensor_f;
  176. bool mainpump2pressuresensor_f;
  177. bool chamberpressuresensor_f;
  178. bool bucketrodpressuresensor_f;
  179. bool parkingpressuresensor_f;
  180. bool accumulatorpressuresensor_f;
  181. bool gaspedal_f;
  182. bool throttleknob_f;
  183. bool leghandle_f;
  184. bool gripknob_f;
  185. bool hydraulicoiltemperaturesensor_f;
  186. bool fuellevelsensor_f;
  187. bool boomanglesensor_f;
  188. bool bucketlevertiltsensor_f;
  189. bool expansionmodule_f;
  190. bool workingdistanceoverrun_f;
  191. bool lowoillevel_f;
  192. bool batterylowvoltage_f;
  193. bool batteryhighvoltage_f;
  194. bool accumulatorpressure_f;
  195. bool highhydraulicoiltemperature_f;
  196. bool lowoilpressure_f;
  197. bool coolantlevellow_f;
  198. bool coolanttemperaturehigh_f;
  199. bool systemoverload_f;
  200. bool safebypasspressdown_f;
  201. bool enginespn_f;
  202. bool enginewarmup_f;
  203. bool enginewarmuptimeout_f;
  204. bool emergencystoppress_f;
  205. bool leftfrontlegchosed;
  206. bool rightfrontlegchosed;
  207. bool leftrearlegchosed;
  208. bool rightrearlegchosed;
  209. int32_t work_pressure;
  210. int32_t brake_pressure;
  211. int32_t gearbox_oil_temp;
  212. int32_t gearbox_oil_pressure;
  213. int32_t engine_rpm;
  214. int32_t engine_pressure;
  215. int32_t speed;
  216. // int32_t gear;
  217. int32_t cold_water;
  218. int32_t steer_angle;
  219. int32_t left_lock_status;
  220. int32_t right_lock_status;
  221. int32_t left_angle;
  222. int32_t right_angle;
  223. };