1 | #ifndef STRUCTURE_VELODYNE_H
|
---|
2 | #define STRUCTURE_VELODYNE_H
|
---|
3 |
|
---|
4 | // VELODYNE_BLOCK_SIZE = sizeof(unsigned short = uint16) * 2 + sizeof(VelodyneRawPoint = uint16,uint8) * kVelodynePointsPerBlock = 2*2 + (2+1)*32 = 4 + 96 = 100
|
---|
5 | #define VELODYNE_BLOCK_SIZE 100
|
---|
6 | // FIXME: unused
|
---|
7 | // VELODYNE_PACKET_SIZE =
|
---|
8 | #define VELODYNE_PACKET_SIZE 1206
|
---|
9 | #define VELODYNE_SCAN_SIZE 4166
|
---|
10 | #define VELODYNE_NB_BLOCKS_PER_PACKET 12
|
---|
11 |
|
---|
12 | #define kVelodyneUpperBlock 0xEEFF
|
---|
13 | #define kVelodyneLowerBlock 0xDDFF
|
---|
14 | #define kVelodynePointsPerBlock 32
|
---|
15 |
|
---|
16 | #pragma pack(push, 1)
|
---|
17 |
|
---|
18 | // 3 bytes size
|
---|
19 | typedef struct VelodyneRawPoint
|
---|
20 | {
|
---|
21 | uint16_t distance; // 0.2cm increments - if 0 no return up to 65m
|
---|
22 | uint8_t intensity; // 255 most intense return
|
---|
23 | } VelodyneRawPoint;
|
---|
24 |
|
---|
25 | // 100=VELODYNE_BLOCK_SIZE bytes size
|
---|
26 | typedef struct VelodyneBlock
|
---|
27 | {
|
---|
28 | /// 0xEEFF upper and 0xDDFF lower
|
---|
29 | uint16_t block;
|
---|
30 |
|
---|
31 | /// azimuth in 100th of degrees [0-35999]
|
---|
32 | uint16_t angle;
|
---|
33 |
|
---|
34 | /// a couple of distance and intensity representing a point
|
---|
35 | struct VelodyneRawPoint rawPoints[kVelodynePointsPerBlock];
|
---|
36 |
|
---|
37 | /* FIXME, block pacpus sensor with these 6 more bytes
|
---|
38 | // change VELODYNE_BLOCK_SIZE to 106 after
|
---|
39 | // Status (see p. 29 Rev C 2011).
|
---|
40 | uint32_t timestamp; // 10e-06.
|
---|
41 | uint8_t code; // ASCII code.
|
---|
42 | uint8_t codeValue; // Value of the code, see the Rev C.
|
---|
43 | */
|
---|
44 | } VelodyneBlock;
|
---|
45 |
|
---|
46 | // size : VELODYNE_BLOCK_SIZE*VELODYNE_SCAN_SIZE + sizeof(unsigned short = uint16)*VELODYNE_SCAN_SIZE
|
---|
47 | // + sizeof(road_time_t = unsigned long long = uint64) + sizeof(road_timerange_t = int = int32) + sizeof(short = int16)
|
---|
48 | // = 100*4166 + 2*4166 + 8 + 4 + 2 = 424 946 bytes
|
---|
49 | // structure containing data of a complete revolution of the lidar
|
---|
50 | typedef struct VelodynePolarData
|
---|
51 | {
|
---|
52 | /// data of one block of 32 beams (upper or lower)
|
---|
53 | VelodyneBlock polarData[VELODYNE_SCAN_SIZE];
|
---|
54 |
|
---|
55 | /// scan count relative to polarData above
|
---|
56 | uint16_t scanCount[VELODYNE_SCAN_SIZE];
|
---|
57 |
|
---|
58 | /// Timestamp of each block.
|
---|
59 | //road_time_t dataTime[VELODYNE_SCAN_SIZE];
|
---|
60 |
|
---|
61 | /// time got in the packet containing first angle
|
---|
62 | road_time_t time;
|
---|
63 | /// timerange = diff( t(angle=0) - t(lastangle) )
|
---|
64 | road_timerange_t timerange;
|
---|
65 |
|
---|
66 | // FIXME: rename
|
---|
67 | /// not all polarData are useful, use range to know until which index you can use the data
|
---|
68 | int16_t range;
|
---|
69 | } VelodynePolarData;
|
---|
70 |
|
---|
71 | #pragma pack(pop)
|
---|
72 |
|
---|
73 | #endif // STRUCTURE_VELODYNE_H
|
---|