comm.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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_RADAR,
  45. CHANNEL_ENCODE,
  46. CHANNEL_ALL,
  47. };
  48. enum WorkArea
  49. {
  50. Area_A,
  51. Area_B,
  52. Area_C,
  53. Area_D,
  54. Area_E,
  55. Area_F,
  56. Area_G,
  57. Area_H,
  58. Area_I,
  59. Area_J,
  60. Area_ALL
  61. };
  62. enum Metal_Area
  63. {
  64. Put_Wait =0,
  65. Put_1=1,
  66. Put_2=2,
  67. Put_3=3,
  68. Get_Wait=10,
  69. Get_1=11,
  70. Get_2=12,
  71. Get_3=13,
  72. Out_Area=100
  73. };
  74. enum UserState
  75. {
  76. Offline,
  77. Idle = 1,
  78. Remote = 2,
  79. Automotive = 3,
  80. AskRemote = 4
  81. };
  82. enum MoveDesc
  83. {
  84. Move_OK = 0,
  85. Move_Encode_Fail = 1,
  86. Move_Unknow_Fail = 2
  87. };
  88. enum Lock_Status
  89. {
  90. Lock_Open,
  91. Lock_Closed,
  92. Lock_CloseInvalid,
  93. };
  94. struct UserCamera
  95. {
  96. int32_t uid;
  97. EgoType type;
  98. UserState state;
  99. CarType carType;
  100. std::string name;
  101. std::string viewurl;
  102. };
  103. struct OfferDesc
  104. {
  105. char type[16];
  106. char sdp[4096 * 3-16];
  107. };
  108. struct AnswerDesc
  109. {
  110. char type[16];
  111. char sdp[4096 * 3 - 16];
  112. };
  113. struct CandidateDesc
  114. {
  115. char candidate[4096];
  116. char sdp_mid[4096];
  117. int32_t sdp_mline_index;
  118. };
  119. #pragma pack(1)
  120. #define CAN_MSG_LEN 13
  121. struct cannet_frame
  122. {
  123. int8_t dlc;
  124. int32_t canid;
  125. int8_t data[8];
  126. };
  127. #pragma pack()
  128. enum RobotStatus
  129. {
  130. OK,
  131. Fail,
  132. };
  133. struct FeedData
  134. {
  135. int32_t work_pressure;//����ϵͳѹ��
  136. int32_t brake_pressure; //�ƶ�ϵͳѹ��
  137. int32_t gearbox_oil_temp;//����������
  138. int32_t gearbox_oil_pressure; //��������ѹ
  139. int32_t engine_rpm;//������ת��
  140. int32_t engine_pressure;
  141. int32_t speed;
  142. // int32_t gear;
  143. int32_t cold_water;
  144. float steer_angle;
  145. int32_t left_lock_status;
  146. int32_t right_lock_status;
  147. int32_t left_angle;
  148. int32_t right_angle;
  149. //大冶新增的下位机上传数据
  150. int32_t engine_time;//发动机运行小时
  151. int32_t wire_sensor_l;//拉线传感器左侧
  152. int32_t wire_sensor_r;//拉线传感器右侧
  153. int32_t fuel_level;//燃油油位
  154. int32_t lock_switch_l;//锁钩到位开关左
  155. int32_t lock_switch_r; //锁钩到位开关右
  156. int32_t tip_limit;//倾翻限位
  157. int32_t turn_left;//左转
  158. int32_t turn_right;//右转
  159. int32_t hight_beam ;//远光灯
  160. int32_t low_beam ;//近光灯
  161. int32_t parking;//驻车
  162. int32_t brake;//刹车
  163. int32_t back_car;//倒车
  164. int32_t front_work_lamp;//前工作灯
  165. int32_t rear_work_lamp ;//后工作灯
  166. int32_t cargo_weight ;//渣包重量
  167. int32_t system_vol;//系统电压
  168. int32_t f_gear;//档位1F 2R 3N
  169. int32_t gear_1;//档位1 2 3 4
  170. int8_t warningData[8] ;//报警信息
  171. //报警信息列表下:
  172. bool low_oil_pressure_alarm;
  173. bool engine_water_temperature_alarm;
  174. bool high_engine_oil_temperature_alarm;
  175. bool engine_water_level_low_alarm;
  176. bool low_fuel_oil_alarm;
  177. bool return_oil_filter_blocked_alarm;
  178. bool oil_filter_blocked_alarm;
  179. bool control_screen_blockage_alarm;
  180. bool emergency_filter_blocking_alarm;
  181. bool cooling_filter_blocked_alarm;
  182. bool electric_pump_screen_blocked_alarm;
  183. bool brake_filter_blocked_alarm;
  184. bool variable_speed_filter_blocked_alarm;
  185. bool low_voltage_alarm;
  186. bool high_transmission_oil_temperature;
  187. bool transmission_oil_pressure_is_low;
  188. bool oil_temperature_sensor_1_is_faulty;
  189. bool oil_temperature_sensor_2_is_faulty;
  190. bool oil_level_sensor_is_faulty;
  191. bool front_throttle_fault;
  192. bool rear_throttle_fault;
  193. bool handle_of_the_upper_arm_is_faulty;
  194. bool left_leg_handle_is_faulty;
  195. bool right_leg_handle_is_faulty;
  196. bool engine_bus_fault;
  197. bool transmission_bus_fault;
  198. bool remote_control_bus_fault;
  199. bool rod_chamber_pressure_sensor_is_faulty;
  200. bool no_rod_chamber_pressure_sensor_is_faulty;
  201. bool brake_pressure_sensor_is_faulty;
  202. bool system_pressure_sensor_is_faulty;
  203. bool control_pressure_sensor_is_faulty;
  204. bool steering_pressure_sensor_is_faulty;
  205. bool pressure_sensor_of_the_lower_arm_is_faulty;
  206. bool locking_pin_displacement_sensor_L_is_faulty;
  207. bool locking_pin_displacement_sensor_R_is_faulty;
  208. bool leg_displacement_sensor_L_is_faulty;
  209. bool leg_displacement_sensor_R_is_faulty;
  210. bool steering_encoder_failure;
  211. };