-
Notifications
You must be signed in to change notification settings - Fork 6
/
SimProType.h
451 lines (395 loc) · 17.2 KB
/
SimProType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
#ifndef SP_COMMUNICATION_TYPE_H
#define SP_COMMUNICATION_TYPE_H
#include <stdint.h>
#pragma pack(4) //指定默认对齐数
#define D_SP_TRAFFIC_SIGN_TYPE_MAX_SPEED_LIMIT "1010203800001413" /** 最高限速标志 */
#define D_SP_TRAFFIC_SIGN_TYPE_NO_ENTRY "1010200500001513" /** 禁止驶入 */
#define D_SP_TRAFFIC_SIGN_TYPE_No_PEDESTRIAN "1010202100001413" /** 禁止行人 */
#define D_SP_TRAFFIC_SIGN_TYPE_No_RIGHT_TURN "1010202311001413" /** 禁止右转 */
#define D_SP_TRAFFIC_SIGN_TYPE_No_STRAIGHT "1010202400001413" /** 禁止直行 */
#define D_SP_TRAFFIC_SIGN_TYPE_No_LIFT_TURN "1010202211001413" /** 禁止左转 */
#define D_SP_TRAFFIC_SIGN_TYPE_STOP "1010200100001914" /** 停止 */
#define D_SP_TRAFFIC_SIGN_TYPE_YIELD "1010200200002012" /** 让行 */
#define D_SP_TRAFFIC_SIGN_TYPE_ATTENTION "1010103400001111" /** 注意 */
#define D_SP_TRAFFIC_SIGN_TYPE_PAY_ATTENTION_TO_PEDESTRIAN "1010101000001111" /** 注意行人 */
#define D_SP_TRAFFIC_SIGN_TYPE_CROSSWALK "1010301800002616" /** 人行横道 */
#define D_SP_TRAFFIC_SIGN_TYPE_PAVEMENT_MARKER_CROSSWALK_LINE "RoadSign_Sidewalk" /** 路面标志, 人行横道线 */
#define D_SP_TRAFFIC_SIGN_TYPE_PAVEMENT_MARKER_STOP_LINE "RoadSign_Stop" /** 路面标志, 停止线 */
#define D_SP_TRAFFIC_SIGN_SUBTYPE_MAX_SPEED_LIMIT_30 30 /** 最高限速30标志 */
#define D_SP_TRAFFIC_SIGN_SUBTYPE_MAX_SPEED_LIMIT_40 40 /** 最高限速40标志 */
#define D_SP_TRAFFIC_SIGN_SUBTYPE_MAX_SPEED_LIMIT_60 60 /** 最高限速60标志 */
#define D_SP_TRAFFIC_SIGN_SUBTYPE_MAX_SPEED_LIMIT_80 80 /** 最高限速80标志 */
#define D_SP_SIZE_OBJECT_NAME 32
#define D_SP_PKG_ID_START_FRAME 1
#define D_SP_PKG_ID_END_FRAME 2
#define D_SP_PKG_ID_CONTACT_POINT 3
#define D_SP_PKG_ID_ROAD_QUERY 4
#define D_SP_PKG_ID_LANE_INFO 5
#define D_SP_PKG_ID_SENSOR_INFO 6
#define D_SP_PKG_ID_SENSOR_DETECTION_INFO 7
#define D_SP_PKG_ID_ENVIRONMENT 8
#define D_SP_PKG_ID_ROAD_STATE 9
#define D_SP_PKG_ID_DRIVER_CTRL 10
#define D_SP_PKG_ID_TRAFFIC_LIGHT 11
#define D_SP_PKG_ID_TRAFFIC_SIGN 12
#define D_SP_PKG_ID_SYNC 13
#define D_SP_PKG_ID_REQUEST_AD_DATA 14
#define D_SP_MIL_PKG_ID_EGO_DATA 15
#define D_SP_MIL_PKG_ID_OBJECT_DATA 16
#define D_SP_MIL_PKG_ID_ROADMARK 17
#define D_SP_PKG_ID_INIT_PARAM 18
#define D_SP_OBJECT_TYPE_NONE 0
#define D_SP_OBJECT_TYPE_CAR 1
#define D_SP_OBJECT_TYPE_PEDESTRIAN 2
#define D_SP_OBJECT_TYPE_BARRIER 3
#define D_SP_OBJECT_TYPE_STREET_LAMP 4
#define D_SP_OBJECT_TYPE_TRAFFIC_SIGN 5
#define D_SP_OBJECT_TYPE_LANE 6
#define D_SP_OBJECT_TYPE_ROADMARK 7
#define D_SP_GEAR_BOX_POS_AUTO 0
#define D_SP_GEAR_BOX_POS_P 1
#define D_SP_GEAR_BOX_POS_R 2
#define D_SP_GEAR_BOX_POS_N 3
#define D_SP_GEAR_BOX_POS_D 4
#define D_SP_GEAR_BOX_POS_1 5
#define D_SP_GEAR_BOX_POS_2 6
#define D_SP_GEAR_BOX_POS_3 7
#define D_SP_GEAR_BOX_POS_4 8
#define D_SP_GEAR_BOX_POS_5 9
#define D_SP_GEAR_BOX_POS_6 10
#define D_SP_GEAR_BOX_POS_7 11
#define D_SP_GEAR_BOX_POS_8 12
#define D_SP_SENSOR_TYPE_NONE 0
#define D_SP_SENSOR_TYPE_RADAR 1
#define D_SP_SENSOR_TYPE_CAMERA 2
#define D_SP_SENSOR_TYPE_LIDAR 3
#define D_SP_SENSOR_TYPE_ULTRASONIC 4
#define D_SP_SENSOR_TYPE_GPS 5
#define D_SP_SENSOR_TYPE_IMU 6
#define D_SP_TRLIGHT_STATUS_OFF 0
#define D_SP_TRLIGHT_STATUS_STOP 1
#define D_SP_TRLIGHT_STATUS_ATTN 2
#define D_SP_TRLIGHT_STATUS_GO 3
#define D_SP_COORDINATE_TYPE_GEO 0
#define D_SP_COORDINATE_TYPE_TRACK 1
#define D_SP_ENV_CLOUD_STATE_OFF 0
#define D_SP_ENV_CLOUD_STATE_RAINY 1
#define D_SP_ENV_CLOUD_STATE_OVERCAST 2
#define D_SP_ENV_CLOUD_STATE_CLOUDY 3
#define D_SP_ENV_CLOUD_STATE_BLUE 4
#define D_SP_ROADMARK_TYPE_UNDECIDED 0 /**< 未定义 */
#define D_SP_ROADMARK_TYPE_SOLID 1 /**< 实线 */
#define D_SP_ROADMARK_TYPE_BROKEN 2 /**< 虚线 */
#define D_SP_ROADMARK_TYPE_DLM 3 /**< */
#define D_SP_ROADMARK_TYPE_BOTTS 4 /**< */
#define D_SP_ROADMARK_TYPE_DECELERATION 5 /**< 减速带 */
#define D_SP_ROADMARK_TYPE_HOV_LANE 6 /**< */
#define D_SP_ROADMARK_TYPE_BROKEN_SOLID 7
#define D_SP_ROADMARK_TYPE_SOLID_BROKEN 8
#define D_SP_ROADMARK_TYPE_SOLID_SOLID 9
#define D_SP_ROADMARK_COLOR_UNDECIDED 0 /**< 未定义 */
#define D_SP_ROADMARK_COLOR_WHITE 1 /**< 白色 */
#define D_SP_ROADMARK_COLOR_YELLOW 2 /**< 黄色 */
#define D_SP_ROADMARK_COLOR_BLUE 3 /**< 蓝色 */
#define D_SP_VEHICLE_LIGHT_OFF 0x00000000
#define D_SP_VEHICLE_LIGHT_INDICATOR_L 0x00000001
#define D_SP_VEHICLE_LIGHT_INDICATOR_R 0x00000002
#define D_SP_VEHICLE_LIGHT_REAR_BRAKE 0x00000004
#define D_SP_VEHICLE_LIGHT_LOW_BEAM 0x00000008
#define D_SP_VEHICLE_LIGHT_HIGH_BEAM 0x00000010
#define D_SP_VEHICLE_LIGHT_REAR_DRIVE 0x00000020
#define D_SP_VEHICLE_LIGHT_FOG 0x00000040
#define D_SP_LANE_EXISTS_OWN 0x01
#define D_SP_LANE_EXISTS_LEFT 0x02
#define D_SP_LANE_EXISTS_RIGHT 0x04
#define D_SP_SENSOR_OBJECT_FLAG_NONE 0x0000
#define D_SP_SENSOR_OBJECT_FLAG_CRITICALITY_LOW 0x0001
#define D_SP_SENSOR_OBJECT_FLAG_CRITICALITY_MEDIUM 0x0002
#define D_SP_SENSOR_OBJECT_FLAG_CRITICALITY_HIGH 0x0003
#define D_SP_SENSOR_OBJECT_FLAG_LANE_POS_VALID 0x0008
#define D_SP_ROAD_DIR_FLAG_NONE 0x00
#define D_SP_ROAD_DIR_FLAG_DIR_FWD 0x01
#define D_SP_ROAD_DIR_FLAG_DIR_REAR 0x02
#define D_SP_ROAD_DIR_FLAG_OFFROAD 0x04
#define D_SP_SYNC_CMD_NONE 0x0000
#define D_SP_SYNC_CMD_FINISH_CURRENT 0x0001
#define D_SP_SYNC_CMD_FINISH_ALL 0x0002
#define D_SP_SYNC_CMD_TRIGGER 0x0004
/*******************转向灯********************/
#define ASIM_VEHICLE_LIGHT_REAR_BRAKE 0x00000008 /**< only rear lights are ON @version 0x0100 */
#define ASIM_VEHICLE_LIGHT_INDICATOR_L 0x00000020 /**< left indicator lights are ON @version 0x0100 */
#define ASIM_VEHICLE_LIGHT_INDICATOR_R 0x00000040 /**< right indicator lights are ON @version 0x0100 */
/** ------ 坐标 ------ */
typedef struct
{
double u8X;
double u8Y;
double u8Z;
float u4H;
float u4P;
float u4R;
uint8_t u1Type; /**< @link D_SP_COORDINATE_TYPE */
uint8_t au1Spare[3];
} S_SP_COORDINATE;
/** ------ 初始化参数 ------ */
typedef struct
{
uint64_t u8StartRoadId;
uint64_t u8EndRoadId;
float u4RoadS;
float u4Speed;
uint16_t u2ScenarioId;
int8_t u1LaneId;
uint8_t u1Spare;
} S_SP_INIT_PARAM;
/** ------ 车道信息 ------ */
typedef struct
{
uint64_t u8RoadId;
uint32_t u4ObjectId;
float u4Width;
uint16_t u2Type;
int8_t u1Id;
uint8_t u1NeighborMask; /**< @link D_SP_LANE_EXISTS */
int8_t u1LeftLaneId;
int8_t u1RightLaneId;
uint8_t au1Spare[2];
} S_SP_LANE_INFO;
/** ------ 几何信息 ------ */
typedef struct
{
float u4DimX;
float u4DimY;
float u4DimZ;
float u4OffX;
float u4OffY;
float u4OffZ;
} S_SP_GEOMETRY;
/** ------ 对象信息 ------ */
typedef struct
{
S_SP_COORDINATE sSpeed;
S_SP_COORDINATE sAccel;
S_SP_GEOMETRY sGeo;
S_SP_COORDINATE sPos;
char au1Name[D_SP_SIZE_OBJECT_NAME];
uint64_t u8RoadId;
uint32_t u4Id;
float u4RoadS;
float u4RoadT;
float u4HdgRel;
float u4LaneOffset;
float u4TraveledDist;
uint8_t u1Type; /**< @link D_SP_OBJECT_TYPE */
int8_t u1LaneId;
uint8_t u1Dir; /**< @link D_SP_ROAD_DIR_FLAG */
uint8_t u1Spare;
} S_SP_OBJECT_STATE;
/** ------ 传感器定义和状态 ------ */
typedef struct
{
S_SP_COORDINATE sPos;
S_SP_COORDINATE sOriginCoordSys;
char au1Name[D_SP_SIZE_OBJECT_NAME];
uint32_t u8HostId;
uint32_t u8Id;
float au4FovHV[2];
float au4ClipNF[2];
float au4FovOffHV[2];
uint8_t u1Type; /**< @link D_SP_SENSOR_TYPE */
uint8_t au1Spare[3];
} S_SP_SENSOR_INFO;
/** ------ 传感器探测到的对象信息 ------ */
typedef struct
{
S_SP_COORDINATE sSensorPos;
double u8Dist;
uint32_t u4Id;
uint32_t u4SensorId;
uint16_t u2Flags; /**< @link D_SP_SENSOR_OBJECT_FLAG */
uint8_t u1Type; /**< @link D_SP_OBJECT_TYPE */
int8_t u1Occlusion;
int8_t u1DeltaLanePos;
uint8_t au1Spare[3];
} S_SP_SENSOR_DETECTION_INFO;
/** ------ 接触点信息 ------ */
typedef struct
{
S_SP_COORDINATE sRoadDataIn;
uint16_t u2Id;
uint16_t u2Spare;
} S_SP_CONTACT_POINT;
/** ------ 交通标志信息 ------ */
typedef struct
{
char au1Type[32]; /**< @link D_SP_TRAFFIC_SIGN_TYPE */
S_SP_COORDINATE sPos;
uint32_t u4TrafficSignId;
uint32_t u4ObjectId;
int32_t u4SubType; /**< @link D_SP_TRAFFIC_SIGN_SUBTYPE */
float u4RoadDist;
float u4Value;
int8_t u1MinLane;
int8_t u1MaxLane;
uint8_t au1Spare[2];
} S_SP_TRAFFIC_SIGN;
/** ------ 车辆对应的道路状态 ------ */
typedef struct
{
uint64_t u8RoadId;
uint32_t u4ObjectId;
float u4DefaultSpeed;
float u4WaterLevel;
float u4DistToJunc;
} S_SP_ROAD_STATE;
/** ------ 环境信息 ------ */
typedef struct
{
uint32_t u4TimeOfDay;
int16_t u2TimeZoneMinutesWest;
uint16_t u2Year;
uint8_t u1Precipitation;
uint8_t u1CloudState; /**< @link D_SP_ENV_CLOUD_STATE */
uint8_t u1Day;
uint8_t u1Month;
} S_SP_ENVIRONMENT;
/** ------ 驾驶员控制输入的信息 ------ */
typedef struct
{
double u8MasterCylinderPressure;
uint32_t u4ObjectId;
float u4SteeringWheel;
float u4ThrottlePedal;
float u4BrakePedal;
float u4AccelTgt;
uint8_t u1Gear; /**< @link D_SP_GEAR_BOX_POS */
uint8_t au1Spare0[3];
} S_SP_DRIVER_CTRL;
/** ------ 交通灯相位信息 ------ */
typedef struct
{
float u4Duration;
uint8_t u1Status; /**< @link D_SP_TRLIGHT_STATUS */
uint8_t au1Spare[3];
} S_SP_TRAFFIC_LIGHT_PHASE;
/** ------ 交通灯信息 ------ */
typedef struct
{
int32_t u4Id;
int32_t u4CtrlId;
uint32_t u4NoPhases;
uint32_t u4DataSize;
float u4State;
float u4CycleTime;
} S_SP_TRAFFIC_LIGHT;
/** ------ 同步信号 ------ */
typedef struct
{
uint32_t u4CmdMask; /**< @link D_SP_SYNC_CMD */
} S_SP_SYNC;
/** ------ 查询道路点 ------ */
typedef struct
{
double u8X;
double u8Y;
uint16_t u2Id;
uint16_t u2Spare;
} S_SP_ROAD_QUERY;
/** ------ MIL测试主车信息描述包 ------ */
typedef struct
{
S_SP_OBJECT_STATE sObjectState;
uint32_t u4LightMask; /**< @link D_SP_VEHICLE_LIGHT */
float u4WheelSpeedFL;
float u4WheelSpeedFR;
float u4WheelSpeedRL;
float u4WheelSpeedRR;
float u4MasterCylinderPressure;
} S_SP_MIL_EGO_STATE;
/** ------ MIL测试环境车、行人、障碍物信息描述包 ------ */
typedef struct
{
uint32_t u4LightMask; /**< @link D_SP_VEHICLE_LIGHT */
float u4DistanceX;
float u4DistanceY;
float u4VelocityX;
float u4VelocityY;
float u4AccelerationX;
float u4YawRate;
float u4Dist;
float u4Angle;
uint8_t u1ObjClass;
uint8_t au1Spare[3];
} S_SP_MIL_OBJECT_STATE_BASE;
/** ------ MIL测试环境车、行人、障碍物信息 ------ */
typedef struct
{
S_SP_OBJECT_STATE sObjectState;
S_SP_MIL_OBJECT_STATE_BASE sMilBase;
} S_SP_MIL_OBJECT_STATE;
/** ------ MIL测试车道线信息描述包 ------ */
typedef struct
{
uint64_t u8RoadId;
float u4StartDx;
float u4Width;
float u4ViewRangeStart;
float u4ViewRangeEnd;
float u4MeasuredVREnd;
float u4C0;
float u4C1;
float u4C2;
float u4C3;
uint16_t u2LaneChange;
int8_t u1LaneId;
uint8_t u1Quality;
uint8_t u1Type; /** @link D_SP_ROADMARK_TYPE */
uint8_t u1Color; /** @link D_SP_ROADMARK_COLOR */
uint8_t u1LeftCrossing;
uint8_t u1RightCrossing;
} S_SP_MIL_ROADMARK;
/** ------ Msg header ------ */
typedef struct
{
double u8SimTime;
uint32_t u4HeaderSize;
uint32_t u4DataSize;
uint32_t u4FrameNo;
} S_SP_MSG_HDR;
/** ------ Pkg header ------ */
typedef struct
{
uint32_t u4HeaderSize;
uint32_t u4DataSize;
uint32_t u4ElementSize;
uint16_t u2PkgId;
uint16_t u2Spare;
} S_SP_MSG_ENTRY_HDR;
/** ------ Pkg data ------ */
typedef union
{
S_SP_LANE_INFO sLaneInfo; /**< @msgid D_SP_PKG_ID_LANE_INFO */
S_SP_SENSOR_INFO sSensorState; /**< @msgid D_SP_PKG_ID_SENSOR_INFO */
S_SP_SENSOR_DETECTION_INFO sSensorObject; /**< @msgid D_SP_PKG_ID_SENSOR_DETECTION_INFO */
S_SP_CONTACT_POINT sContactPoint; /**< @msgid D_SP_PKG_ID_CONTACT_POINT */
S_SP_TRAFFIC_SIGN sTrafficSign; /**< @msgid D_SP_PKG_ID_TRAFFIC_SIGN */
S_SP_ROAD_STATE sRoadState; /**< @msgid D_SP_PKG_ID_ROAD_STATE */
S_SP_ENVIRONMENT sEnvironment; /**< @msgid D_SP_PKG_ID_ENVIRONMENT */
S_SP_DRIVER_CTRL sDriverCtrl; /**< @msgid D_SP_PKG_ID_DRIVER_CTRL */
S_SP_TRAFFIC_LIGHT sTrafficLight; /**< @msgid D_SP_PKG_ID_TRAFFIC_LIGHT */
S_SP_SYNC sSync; /**< @msgid D_SP_PKG_ID_SYNC */
S_SP_ROAD_QUERY sRoadQuery; /**< @msgid D_SP_PKG_ID_ROAD_QUERY */
S_SP_MIL_EGO_STATE sEgoState; /**< @msgid D_SP_MIL_PKG_ID_EGO_DATA */
S_SP_MIL_OBJECT_STATE sMilObjectState; /**< @msgid D_SP_MIL_PKG_ID_OBJECT_DATA */
S_SP_MIL_ROADMARK sMilRoadMark; /**< @msgid D_SP_MIL_PKG_ID_ROADMARK */
S_SP_INIT_PARAM sInitParam; /**< @msgid D_SP_PKG_ID_INIT_PARAM */
} S_SP_MSG_UNION;
/** ------ Msg struct ------ */
typedef struct
{
S_SP_MSG_HDR sMsgHdr;
S_SP_MSG_ENTRY_HDR sPkgHdr;
S_SP_MSG_UNION sPkgData;
} S_SP_MSG_t;
#pragma pack()
#endif //SP_COMMUNICATION_TYPE_H