comm.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. Monitor
  36. };
  37. enum CarType
  38. {
  39. ZJ,
  40. KRESS,
  41. };
  42. enum ChannelType:int32_t
  43. {
  44. CHANNEL_CAR,
  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=0,
  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 work_pressure;//����ϵͳѹ��
  137. int32_t brake_pressure; //�ƶ�ϵͳѹ��
  138. int32_t gearbox_oil_temp;//����������
  139. int32_t gearbox_oil_pressure; //��������ѹ
  140. int32_t engine_rpm;//������ת��
  141. int32_t engine_pressure;
  142. int32_t speed;
  143. // int32_t gear;
  144. int32_t cold_water;
  145. int32_t steer_angle;
  146. int32_t left_lock_status;
  147. int32_t right_lock_status;
  148. int32_t left_angle;
  149. int32_t right_angle;
  150. };