source: pacpussensors/trunk/Sick/SickLMSData.h@ 110

Last change on this file since 110 was 74, checked in by DHERBOMEZ Gérald, 10 years ago
  • Modification of Sick LMS sensor to get the RSSI signal (reflectivity of the laser)
  • Minor changes in data replay component of Sick LDMRS
  • CanGateway: Choose by default of Vector CAN XL card
File size: 6.1 KB
RevLine 
[37]1/*********************************************************************
2// created: 2014/02/11 - 12:08
3// filename: SickLMSData.cpp
4//
5// author: Cyril Fougeray
6// Copyright Heudiasyc UMR UTC/CNRS 6599
7//
8// version: $Id: $
9//
10// purpose: Structures to store Sick LMS data
11//
12*********************************************************************/
13
14#ifndef __SICKLMS_DATA_H__
15#define __SICKLMS_DATA_H__
16
17#include "Pacpus/kernel/cstdint.h"
18#include "Pacpus/kernel/road_time.h"
19
20// Export macro for SickLMS DLL for Windows only
21#ifdef WIN32
22# ifdef SICKLMS_EXPORTS
23 // make DLL
24# define SICKLMS_API __declspec(dllexport)
25# else
26 // use DLL
27# define SICKLMS_API __declspec(dllimport)
28# endif
29#else
30 // On other platforms, simply ignore this
31# define SICKLMS_API
32#endif
33
34
35namespace pacpus{
36
37/*!
38* \brief Structure containing scan configuration.
39* \author Based on Konrad Banachowicz work.
40*/
41typedef struct _scanCfg {
42 /*!
43 * \brief Scanning frequency.
44 * 1/100 Hz
45 */
46 int scaningFrequency;
47
48 /*!
49 * \brief Scanning resolution.
50 * 1/10000 degree
51 */
52 int angleResolution;
53
54 /*!
55 * \brief Start angle.
56 * 1/10000 degree
57 */
58 int startAngle;
59
60 /*!
61 * \brief Stop angle.
62 * 1/10000 degree
63 */
64 int stopAngle;
65} scanCfg;
66
67
68/*!
69* \brief Structure containing single scan message.
70* \author Based on Konrad Banachowicz work.
71*/
72typedef struct _scanData {
73
74 /*!
75 * \brief Scanning frequency.
76 * 1/100 Hz
77 */
[61]78 uint32_t scanFrequency;
[37]79
80 /*!
81 * \brief Scanning resolution.
82 * 1/10000 degree
83 */
[61]84 uint32_t angleResolution;
[37]85
86 /*!
87 * \brief Start angle.
88 * 1/10000 degree
89 */
90 int32_t startAngle;
91
92 /////////////////////////////////////////////////////
93 ////////////////// LMS1xx & LMS5xx //////////////////
94
95 /*!
96 * \brief Number of samples in dist1.
97 *
98 */
99 int dist_len1;
100
101 /*!
102 * \brief Radial distance for the first reflected pulse
103 *
104 */
105 uint16_t* dist1;
106
107 /*!
108 * \brief Number of samples in dist2.
109 *
110 */
111 int dist_len2;
112
113 /*!
114 * \brief Radial distance for the second reflected pulse
115 *
116 */
117 uint16_t* dist2;
118
119
120 /////////////////////////////////////////////////////
121 ////////////////// LMS5xx only //////////////////
122
123 /*!
124 * \brief Number of samples in dist3.
125 *
126 */
127 int dist_len3;
128
129 /*!
130 * \brief Radial distance for the first reflected pulse
131 *
132 */
133 uint16_t* dist3;
134
135 /*!
136 * \brief Number of samples in dist4.
137 *
138 */
139 int dist_len4;
140
141 /*!
142 * \brief Radial distance for the second reflected pulse
143 *
144 */
145 uint16_t* dist4;
146
147 /*!
148 * \brief Number of samples in dist5.
149 *
150 */
151 int dist_len5;
152
153 /*!
154 * \brief Radial distance for the second reflected pulse
155 *
156 */
157 uint16_t* dist5;
158
159
160 /////////////////////////////////////////////////////
161 ////////////////// LMS1xx only //////////////////
162
163 /*!
164 * \brief Number of samples in rssi1.
165 *
166 */
167 int rssi_len1;
[74]168 //int rssi_len1_8;
[37]169 /*!
170 * \brief Energy values for the first reflected pulse
171 *
172 */
173 uint16_t* rssi1;
174
[74]175 //uint8_t* rssi1_8;
176
[37]177 /*!
178 * \brief Number of samples in rssi2.
179 *
180 */
181 int rssi_len2;
[74]182 //int rssi_len2_8;
[37]183 /*!
184 * \brief Energy values for the second reflected pulse
185 *
186 */
187 uint16_t* rssi2;
[74]188 //uint8_t* rssi2_8;
[37]189} scanData;
190
191
192/*!
193 * \brief Status of the scanner
194 */
195typedef enum {
196 undefined = 0,
197 initialisation = 1,
198 configuration = 2,
199 idle = 3,
200 rotated = 4,
201 in_preparation = 5,
202 ready = 6,
203 ready_for_measurement = 7
204} status_t;
205
206
207typedef struct{
[61]208 uint16_t scanNumber; //!< number of the scan
209 uint16_t scannerStatus;
[37]210 //!< - 00 00 OK
211 //!< - 00 01 Error
212 //!< - 00 02 Pollution Warning
213 //!< - 00 04 Pollution Error
214
215 road_time_t time; //!< DBT timestamp
216 road_timerange_t timerange; //!< DBT timerange
[61]217 uint32_t scanFrequency; //!< Frequency of the scan [1/100 Hz]
218 uint32_t angleResolution; //!< Angle resolution (default is 5000 <=> 0.5 degree) [1/10000 degree]
[37]219 int32_t startAngle; //!< Angle of the first scanned point.
220 int dist_len1; //!< Number of points (1st echo).
221 uint32_t dataPos_dist1; //!< Distance between the sensor and the remote point (1st echo).
222 int dist_len2; //!< Number of points (2nd echo).
223 uint32_t dataPos_dist2; //!< Distance between the sensor and the remote point (2nd echo).
224 int dist_len3; //!< Number of points (3rd echo).
225 uint32_t dataPos_dist3; //!< Distance between the sensor and the remote point (3rd echo). @b LMS5xx @b only.
226 int dist_len4; //!< Number of points (4th echo).
227 uint32_t dataPos_dist4; //!< Distance between the sensor and the remote point (4th echo). @b LMS5xx @b only.
228 int dist_len5; //!< Number of points (5th echo).
229 uint32_t dataPos_dist5; //!< Distance between the sensor and the remote point (5th echo). @b LMS5xx @b only.
230 int rssi_len1; //!< Number of energy values (1st echo).
231 uint32_t dataPos_rssi1; //!< Energy of the returned pulse (1st echo). @b LMS1xx @b only.
232 int rssi_len2; //!< Number of energy values (2nd echo).
233 uint32_t dataPos_rssi2; //!< Energy of the returned pulse (2nd echo). @b LMS1xx @b only.
[74]234 //chunlei
235 //int rssi_len1_8; //!< Number of energy values (1st echo).
236 //uint32_t dataPos_rssi1_8; //!< Energy of the returned pulse (1st echo). @b LMS1xx @b only. 8bit
237 //int rssi_len2_8;
238 //uint32_t dataPos_rssi2_8; //!< Energy of the returned pulse (1st echo). @b LMS1xx @b only. 8bit
[37]239}SickLMS_dbt;
240
241}
242#endif
Note: See TracBrowser for help on using the repository browser.