velodyne_lidar
velodyneProtocolTypes.hpp
Go to the documentation of this file.
1 #ifndef _VELODYNE_PROTOCOL_TYPES_HPP_
2 #define _VELODYNE_PROTOCOL_TYPES_HPP_
3 
4 #include <velodyne_lidar/velodyneConstants.hpp>
5 #include <cstring>
6 
7 namespace velodyne_lidar
8 {
9  // Velodyne datastructures
10  typedef struct vel_laser {
11  uint16_t distance; // 2mm increments
12  uint8_t intensity; // 255 being brightest
13 
14  } __attribute__((packed)) vel_laser_t;
15 
16  typedef struct velodyne_fire {
17  uint16_t laser_header;
18  uint16_t rotational_pos; // 0-35999 divide by 100 for degrees
19  vel_laser_t lasers[VELODYNE_NUM_LASER_CHANNELS];
20  } __attribute__((packed)) velodyne_fire_t ;
21 
22  typedef struct velodyne_data_packet {
23  velodyne_fire_t shots[VELODYNE_NUM_SHOTS];
24  uint32_t gps_timestamp; // in microseconds from the top of the hour
25  uint8_t return_mode;
26  uint8_t sensor_type;
27 
29  {
30  //clear everything
31  memset(this,0,sizeof(*this));
32  }
33  } __attribute__((packed)) velodyne_data_packet_t;
34 
35  typedef struct velodyne_orientation {
36  /* the values are only stored in the least significant 12 bits */
37  uint16_t gyro; // 0.09766 deg/sec scale factor
38  uint16_t temperature; // 0.1453 scale factor + 25°C offset
39  uint16_t accel_x; // 0.001221 G scale factor
40  uint16_t accel_y; // 0.001221 G scale factor
41  } __attribute__((packed)) velodyne_orientation_t;
42 
43  typedef struct velodyne_positioning_packet {
44  uint8_t unused_1[14];
45  velodyne_orientation_t orientations[VELODYNE_ORIENTATION_READINGS];
46  uint8_t unused_2[160];
47  uint32_t gps_timestamp; // in microseconds from the top of the hour
48  uint8_t unused_3[4];
49  char nmea_sentence[72];
50  uint8_t unused_4[234];
51 
53  {
54  //clear everything
55  memset(this,0,sizeof(*this));
56  }
57  } __attribute__((packed)) velodyne_positioning_packet_t;
58 
59 };
60 
61 #endif
velodyne_fire_t shots[VELODYNE_NUM_SHOTS]
Definition: velodyneProtocolTypes.hpp:48
velodyne_orientation_t orientations[VELODYNE_ORIENTATION_READINGS]
Definition: velodyneProtocolTypes.hpp:49
char nmea_sentence[72]
Definition: velodyneProtocolTypes.hpp:53
velodyne_positioning_packet()
Definition: velodyneProtocolTypes.hpp:56
uint8_t unused_1[14]
Definition: velodyneProtocolTypes.hpp:48
Definition: velodyneProtocolTypes.hpp:35
Definition: velodyneProtocolTypes.hpp:22
uint8_t unused_3[4]
Definition: velodyneProtocolTypes.hpp:52
velodyne_data_packet()
Definition: velodyneProtocolTypes.hpp:28
uint16_t accel_y
Definition: velodyneProtocolTypes.hpp:40
Definition: velodyneProtocolTypes.hpp:16
uint16_t laser_header
Definition: velodyneProtocolTypes.hpp:17
uint16_t accel_x
Definition: velodyneProtocolTypes.hpp:39
uint8_t intensity
Definition: velodyneProtocolTypes.hpp:12
vel_laser_t lasers[VELODYNE_NUM_LASER_CHANNELS]
Definition: velodyneProtocolTypes.hpp:50
uint32_t gps_timestamp
Definition: velodyneProtocolTypes.hpp:24
uint8_t return_mode
Definition: velodyneProtocolTypes.hpp:25
Definition: velodyneProtocolTypes.hpp:10
uint16_t temperature
Definition: velodyneProtocolTypes.hpp:38
uint16_t rotational_pos
Definition: velodyneProtocolTypes.hpp:18
Definition: gps_rmc_type.h:6
uint32_t gps_timestamp
Definition: velodyneProtocolTypes.hpp:47
uint8_t sensor_type
Definition: velodyneProtocolTypes.hpp:26
uint8_t unused_2[160]
Definition: velodyneProtocolTypes.hpp:50
uint16_t gyro
Definition: velodyneProtocolTypes.hpp:37
uint8_t unused_4[234]
Definition: velodyneProtocolTypes.hpp:54
velodyne_lidar::VelodyneVLP16Driver __attribute__
uint16_t distance
Definition: velodyneProtocolTypes.hpp:11
Definition: velodyneProtocolTypes.hpp:43