comm.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. struct UserCamera
  96. {
  97. int32_t uid;
  98. EgoType type;
  99. UserState state;
  100. CarType carType;
  101. std::string name;
  102. std::string viewurl;
  103. };
  104. struct OfferDesc
  105. {
  106. char type[16];
  107. char sdp[4096 * 3-16];
  108. };
  109. struct AnswerDesc
  110. {
  111. char type[16];
  112. char sdp[4096 * 3 - 16];
  113. };
  114. struct CandidateDesc
  115. {
  116. char candidate[4096];
  117. char sdp_mid[4096];
  118. int32_t sdp_mline_index;
  119. };
  120. #pragma pack(1)
  121. #define CAN_MSG_LEN 13
  122. struct cannet_frame
  123. {
  124. int8_t dlc;
  125. int32_t canid;
  126. int8_t data[8];
  127. };
  128. #pragma pack()
  129. enum RobotStatus
  130. {
  131. OK,
  132. Fail,
  133. };
  134. struct FeedData
  135. {
  136. int32_t engine_speed;
  137. int32_t travel_speed;
  138. int32_t fuel_level;
  139. int32_t engine_temperature;
  140. int32_t hydraulic_oil_temperature;
  141. int32_t main_pump_1_pressure;
  142. int32_t main_pump_2_pressure;
  143. int32_t hand_gear;
  144. int32_t actual_gear;
  145. float gripper_height;
  146. float amplitude;
  147. int32_t boom_angle;
  148. int32_t stick_angle;
  149. int32_t idle_protection;
  150. int32_t front_toggle;
  151. int32_t back_toggle;
  152. int32_t interlock ;//启动联锁
  153. int32_t safety_valves;//安全开关阀
  154. int32_t safety_switch ;//安全开关阀异常
  155. int32_t arm_lift_pilot ;//大臂提升先导比例阀异常
  156. int32_t arm_lowering_pilot ;//大臂下降先导比例阀异常
  157. int32_t lever_lifting_pilot ;//斗杆提升先导比例阀异常
  158. int32_t rod_lowering_pilot ;//斗杆下降先导比例阀异常
  159. int32_t left_rotary_pilot ;//左回转先导比例阀异常
  160. int32_t right_rotary_pilot ;//右回转先导比例阀异常
  161. int32_t grab_open_pilot ;//抓斗开启先导比例阀异常
  162. int32_t grab_close_pilot ;//抓斗闭合先导比例阀异常
  163. int8_t warningData[8];
  164. bool liftpilotpressuresensor_f;
  165. bool loweringpilotpressuresensor_f;
  166. bool leverliftpilotpressuresensor_f;
  167. bool rodloweringpilotpressurepensor_f;
  168. bool leftturnpilotpressuresensor_f;
  169. bool rightturnpilotpressuresensor_f;
  170. bool legextensionpilotpressuresensor_f;
  171. bool legretractpilotpressuresensor_f;
  172. bool grabopenpilotpressuresensor_f;
  173. bool grabclosurepilotpressuresensor_f;
  174. bool mainpump1pressuresensor_f;
  175. bool mainpump2pressuresensor_f;
  176. bool chamberpressuresensor_f;
  177. bool bucketrodpressuresensor_f;
  178. bool parkingpressuresensor_f;
  179. bool accumulatorpressuresensor_f;
  180. bool gaspedal_f;
  181. bool throttleknob_f;
  182. bool leghandle_f;
  183. bool gripknob_f;
  184. bool hydraulicoiltemperaturesensor_f;
  185. bool fuellevelsensor_f;
  186. bool boomanglesensor_f;
  187. bool bucketlevertiltsensor_f;
  188. bool expansionmodule_f;
  189. bool workingdistanceoverrun_f;
  190. bool lowoillevel_f;
  191. bool batterylowvoltage_f;
  192. bool batteryhighvoltage_f;
  193. bool accumulatorpressure_f;
  194. bool highhydraulicoiltemperature_f;
  195. bool lowoilpressure_f;
  196. bool coolantlevellow_f;
  197. bool coolanttemperaturehigh_f;
  198. bool systemoverload_f;
  199. bool safebypasspressdown_f;
  200. bool enginespn_f;
  201. bool enginewarmup_f;
  202. bool enginewarmuptimeout_f;
  203. bool emergencystoppress_f;
  204. bool leftfrontlegchosed;
  205. bool rightfrontlegchosed;
  206. bool leftrearlegchosed;
  207. bool rightrearlegchosed;
  208. int32_t work_pressure;
  209. int32_t brake_pressure;
  210. int32_t gearbox_oil_temp;
  211. int32_t gearbox_oil_pressure;
  212. int32_t engine_rpm;
  213. int32_t engine_pressure;
  214. int32_t speed;
  215. // int32_t gear;
  216. int32_t cold_water;
  217. int32_t steer_angle;
  218. int32_t left_lock_status;
  219. int32_t right_lock_status;
  220. int32_t left_angle;
  221. int32_t right_angle;
  222. };