45 void MountingPositionF::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
47 yaw_angle = read_be<float>(in, offset);
48 pitch_angle = read_be<float>(in, offset + 4);
49 roll_angle = read_be<float>(in, offset + 8);
50 x_position = read_be<float>(in, offset + 12);
51 y_position = read_be<float>(in, offset + 16);
52 z_position = read_be<float>(in, offset + 20);
55 void ContourPointSigma::parse(
56 const std::vector<uint8_t>& in,
57 const uint16_t& offset,
60 parse_tuple<int16_t>(in, &x, &y, bo, offset);
61 parse_tuple<uint8_t>(in, &x_sigma, &y_sigma, bo, offset);
65 const std::vector<uint8_t>& in,
66 const uint16_t& offset,
69 parse_tuple<float>(in, &x, &y, bo, offset);
73 const std::vector<uint8_t>& in,
74 const uint16_t& offset,
77 parse_tuple<int16_t>(in, &x, &y, bo, offset);
80 void Point2Dui::parse(
81 const std::vector<uint8_t>& in,
82 const uint16_t& offset,
85 parse_tuple<uint16_t>(in, &x, &y, bo, offset);
89 const std::vector<uint8_t>& in,
90 const uint16_t& offset,
93 parse_tuple<uint16_t>(in, &sigma_x, &sigma_y, bo, offset);
97 const std::vector<uint8_t>& in,
98 const uint16_t& offset,
101 parse_tuple<uint16_t>(in, &size_x, &size_y, bo, offset);
104 void Velocity2D::parse(
105 const std::vector<uint8_t>& in,
106 const uint16_t& offset,
109 parse_tuple<int16_t>(in, &velocity_x, &velocity_y, bo, offset);
112 void ResolutionInfo::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
114 resolution_start_angle = read_be<float>(in, offset);
115 resolution = read_be<float>(in, offset + 4);
118 void ScannerInfo2204::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
120 device_id = read_be<uint8_t>(in, offset);
121 scanner_type = read_be<uint8_t>(in, offset + 1);
122 scan_number = read_be<uint16_t>(in, offset + 2);
123 start_angle = read_be<float>(in, offset + 8);
124 end_angle = read_be<float>(in, offset + 12);
125 yaw_angle = read_be<float>(in, offset + 16);
126 pitch_angle = read_be<float>(in, offset + 20);
127 roll_angle = read_be<float>(in, offset + 24);
128 offset_x = read_be<float>(in, offset + 28);
129 offset_y = read_be<float>(in, offset + 32);
130 offset_z = read_be<float>(in, offset + 36);
133 void ScannerInfo2205::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
135 device_id = read_be<uint8_t>(in, offset);
136 scanner_type = read_be<uint8_t>(in, offset + 1);
137 scan_number = read_be<uint16_t>(in, offset + 2);
138 start_angle = read_be<float>(in, offset + 8);
139 end_angle = read_be<float>(in, offset + 12);
140 scan_start_time = read_be<NTPTime>(in, offset + 16);
141 scan_end_time = read_be<NTPTime>(in, offset + 24);
142 scan_start_time_from_device = read_be<NTPTime>(in, offset + 32);
143 scan_end_time_from_device = read_be<NTPTime>(in, offset + 40);
144 scan_frequency = read_be<float>(in, offset + 48);
145 beam_tilt = read_be<float>(in, offset + 52);
146 scan_flags = read_be<float>(in, offset + 56);
147 mounting_position.parse(in, offset + 60);
148 resolutions[0].parse(in, offset + 84);
149 resolutions[1].parse(in, offset + 92);
150 resolutions[2].parse(in, offset + 100);
151 resolutions[3].parse(in, offset + 108);
152 resolutions[4].parse(in, offset + 116);
153 resolutions[5].parse(in, offset + 124);
154 resolutions[6].parse(in, offset + 132);
155 resolutions[7].parse(in, offset + 140);
159 void UntrackedProperties::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
161 relative_time_of_measurement = read_be<uint16_t>(in, offset + 1);
162 position_closest_point.parse(in, offset + 3, ByteOrder::BE);
163 object_box_size.parse(in, offset + 9, ByteOrder::BE);
164 object_box_size_sigma.parse(in, offset + 13, ByteOrder::BE);
165 object_box_orientation = read_be<int16_t>(in, offset + 17);
166 object_box_orientation_sigma = read_be<uint16_t>(in, offset + 19);
167 tracking_point_coordinate.parse(in, offset + 23, ByteOrder::BE);
168 tracking_point_coordinate_sigma.parse(in, offset + 27, ByteOrder::BE);
169 number_of_contour_points = read_be<uint8_t>(in, offset + 34);
171 if (number_of_contour_points == 255)
172 number_of_contour_points = 0;
174 for (uint8_t i = 0; i < number_of_contour_points; i++)
177 new_contour_point.
parse(in, offset + 35 + (i * 8), ByteOrder::BE);
178 contour_point_list.push_back(new_contour_point);
182 void TrackedProperties::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
184 object_age = read_be<uint16_t>(in, offset + 1);
185 hidden_status_age = read_be<uint16_t>(in, offset + 3);
186 uint8_t dynamic_flags = read_be<uint8_t>(in, offset + 5);
188 dynamic_property =
static_cast<DynamicProperty>((dynamic_flags & 0x70) > 0);
189 relative_time_of_measure = read_be<uint16_t>(in, offset + 6);
190 position_closest_point.parse(in, offset + 8, ByteOrder::BE);
191 relative_velocity.parse(in, offset + 12, ByteOrder::BE);
192 relative_velocity_sigma.parse(in, offset + 16, ByteOrder::BE);
193 classification =
static_cast<Classification>(read_be<uint8_t>(in, offset + 20));
194 classification_age = read_be<uint16_t>(in, offset + 22);
195 object_box_size.parse(in, offset + 26, ByteOrder::BE);
196 object_box_size_sigma.parse(in, offset + 30, ByteOrder::BE);
197 object_box_orientation = read_be<int16_t>(in, offset + 34);
198 object_box_orientation_sigma = read_be<uint16_t>(in, offset + 36);
199 tracking_point_location =
static_cast<PointLocation>(read_be<uint8_t>(in, offset + 39));
200 tracking_point_coordinate.parse(in, offset + 40, ByteOrder::BE);
201 tracking_point_coordinate_sigma.parse(in, offset + 44, ByteOrder::BE);
202 velocity.parse(in, offset + 51, ByteOrder::BE);
203 velocity_sigma.parse(in, offset + 55, ByteOrder::BE);
204 acceleration.parse(in, offset + 61, ByteOrder::BE);
205 acceleration_sigma.parse(in, offset + 65, ByteOrder::BE);
206 yaw_rate = read_be<int16_t>(in, offset + 71);
207 yaw_rate_sigma = read_be<uint16_t>(in, offset + 73);
208 number_of_contour_points = read_be<uint8_t>(in, offset + 75);
210 if (number_of_contour_points == 255)
211 number_of_contour_points = 0;
213 for (uint8_t i = 0; i < number_of_contour_points; i++)
216 new_contour_point.
parse(in, offset + 76 + (i * 8), ByteOrder::BE);
217 contour_point_list.push_back(new_contour_point);
221 void ScanPoint2202::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
223 uint8_t layer_and_offset = read_le<uint8_t>(in, offset);
224 std::cout << std::hex;
225 layer = (layer_and_offset & 0x0F);
226 echo = ((layer_and_offset & 0xF0) >> 4);
227 uint8_t flags = read_le<uint8_t>(in, offset + 1);
228 transparent_point = ((flags & 0x01) > 0);
229 clutter_atmospheric = ((flags & 0x02) > 0);
230 ground = ((flags & 0x04) > 0);
231 dirt = ((flags & 0x08) > 0);
232 horizontal_angle = read_le<int16_t>(in, offset + 2);
233 radial_distance = read_le<uint16_t>(in, offset + 4);
234 echo_pulse_width = read_le<uint16_t>(in, offset + 6);
237 void ScanPoint2204::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
239 x_position = read_be<float>(in, offset + 0);
240 y_position = read_be<float>(in, offset + 4);
241 z_position = read_be<float>(in, offset + 8);
242 echo_width = read_be<float>(in, offset + 12);
243 device_id = read_be<uint8_t>(in, offset + 16);
244 layer = read_be<uint8_t>(in, offset + 17);
245 echo = read_be<uint8_t>(in, offset + 18);
246 time_offset = read_be<uint32_t>(in, offset + 20);
248 uint16_t flags = read_be<uint16_t>(in, offset + 24);
250 ground = ((flags & 0x0001) > 0);
251 dirt = ((flags & 0x0002) > 0);
252 precipitation = ((flags & 0x0004) > 0);
255 void ScanPoint2205::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
257 x_position = read_be<float>(in, offset);
258 y_position = read_be<float>(in, offset + 4);
259 z_position = read_be<float>(in, offset + 8);
260 echo_width = read_be<float>(in, offset + 12);
261 device_id = read_be<uint8_t>(in, offset + 16);
262 layer = read_be<uint8_t>(in, offset + 17);
263 echo = read_be<uint8_t>(in, offset + 18);
264 time_offset = read_be<uint8_t>(in, offset + 20);
265 uint16_t flags = read_be<uint8_t>(in, offset + 24);
266 ground = ((flags & 0x0001) > 0);
267 dirt = ((flags & 0x0002) > 0);
268 precipitation = ((flags & 0x0004) > 2);
269 transparent = ((flags & 0x1000) > 12);
272 void ScanPoint2208::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
274 echo = (read_be<uint8_t>(in, offset) & 0x0C);
275 layer = read_be<uint8_t>(in, offset + 1);
276 uint16_t flags = read_be<uint16_t>(in, offset + 2);
277 transparent_point = ((flags & 0x0001) > 0);
278 clutter_atmospheric = ((flags & 0x0002) > 0);
279 ground = ((flags & 0x0004) > 0);
280 dirt = ((flags & 0x0008) > 0);
281 horizontal_angle = read_be<int16_t>(in, offset + 4);
282 radial_distance = read_be<uint16_t>(in, offset + 6);
283 echo_pulse_width = read_be<uint16_t>(in, offset + 8);
286 void Object2221::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
288 id = read_le<uint16_t>(in, offset);
289 age = read_le<uint16_t>(in, offset + 2);
290 prediction_age = read_le<uint16_t>(in, offset + 4);
291 relative_timestamp = read_le<uint16_t>(in, offset + 6);
292 reference_point.x = read_le<int16_t>(in, offset + 8);
293 reference_point.y = read_le<int16_t>(in, offset + 10);
294 reference_point_sigma.x = read_le<int16_t>(in, offset + 12);
295 reference_point_sigma.y = read_le<int16_t>(in, offset + 14);
296 closest_point.x = read_le<int16_t>(in, offset + 16);
297 closest_point.y = read_le<int16_t>(in, offset + 18);
298 bounding_box_center.x = read_le<int16_t>(in, offset + 20);
299 bounding_box_center.y = read_le<int16_t>(in, offset + 22);
300 bounding_box_width = read_le<uint16_t>(in, offset + 24);
301 bounding_box_length = read_le<uint16_t>(in, offset + 26);
302 object_box_center.x = read_le<int16_t>(in, offset + 28);
303 object_box_center.y = read_le<int16_t>(in, offset + 30);
304 object_box_size.size_x = read_le<uint16_t>(in, offset + 32);
305 object_box_size.size_y = read_le<uint16_t>(in, offset + 34);
306 object_box_orientation = read_le<int16_t>(in, offset + 36);
307 absolute_velocity.x = read_le<int16_t>(in, offset + 38);
308 absolute_velocity.y = read_le<int16_t>(in, offset + 40);
309 absolute_velocity_sigma.size_x = read_le<uint16_t>(in, offset + 42);
310 absolute_velocity_sigma.size_y = read_le<uint16_t>(in, offset + 44);
311 relative_velocity.x = read_le<int16_t>(in, offset + 46);
312 relative_velocity.y = read_le<int16_t>(in, offset + 48);
313 classification =
static_cast<Classification>(read_le<uint8_t>(in, offset + 50));
314 classification_age = read_le<uint16_t>(in, offset + 52);
315 classification_certainty = read_le<uint16_t>(in, offset + 54);
316 number_of_contour_points = read_le<uint16_t>(in, offset + 56);
318 if (number_of_contour_points == 65535)
319 number_of_contour_points = 0;
321 for (uint16_t i = 0; i < number_of_contour_points; i++)
324 contour_point.
parse(in, offset + 58 + (i * 4), ByteOrder::LE);
325 contour_point_list.push_back(contour_point);
329 void Object2225::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
331 id = read_be<uint16_t>(in, offset);
332 age = read_be<uint32_t>(in, offset + 4);
333 timestamp = read_be<NTPTime>(in, offset + 8);
334 hidden_status_age = read_be<uint16_t>(in, offset + 16);
335 classification =
static_cast<Classification>(read_be<uint8_t>(in, offset + 18));
336 classification_certainty = read_be<uint8_t>(in, offset + 19);
337 classification_age = read_be<uint32_t>(in, offset + 20);
338 bounding_box_center.parse(in, offset + 24, ByteOrder::BE);
339 bounding_box_size.parse(in, offset + 32, ByteOrder::BE);
340 object_box_center.parse(in, offset + 40, ByteOrder::BE);
341 object_box_center_sigma.parse(in, offset + 48, ByteOrder::BE);
342 object_box_size.parse(in, offset + 56, ByteOrder::BE);
343 yaw_angle = read_be<float>(in, offset + 72);
344 relative_velocity.parse(in, offset + 80, ByteOrder::BE);
345 relative_velocity_sigma.parse(in, offset + 88, ByteOrder::BE);
346 absolute_velocity.parse(in, offset + 96, ByteOrder::BE);
347 absolute_velocity_sigma.parse(in, offset + 104, ByteOrder::BE);
348 number_of_contour_points = read_be<uint8_t>(in, offset + 130);
349 closest_point_index = read_be<uint8_t>(in, offset + 131);
351 if (number_of_contour_points == 255)
352 number_of_contour_points = 0;
354 for (uint8_t i = 0; i < number_of_contour_points; i++)
357 contour_point.
parse(in, offset + 132 + (i * 8), ByteOrder::BE);
358 contour_point_list.push_back(contour_point);
362 void Object2270::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
364 id = read_le<uint16_t>(in, offset);
365 age = read_le<uint16_t>(in, offset + 2);
366 prediction_age = read_le<uint16_t>(in, offset + 4);
367 relative_moment_of_measurement = read_le<uint16_t>(in, offset + 6);
368 reference_point_location =
static_cast<PointLocation>(read_le<uint8_t>(in, offset + 9));
369 reference_point_position_x = read_le<int16_t>(in, offset + 10);
370 reference_point_position_y = read_le<int16_t>(in, offset + 12);
371 reference_point_position_sigma_x = read_le<uint16_t>(in, offset + 14);
372 reference_point_position_sigma_y = read_le<uint16_t>(in, offset + 16);
373 contour_points_cog_x = read_le<int16_t>(in, offset + 36);
374 contour_points_cog_y = read_le<int16_t>(in, offset + 38);
375 object_box_length = read_le<uint16_t>(in, offset + 40);
376 object_box_width = read_le<uint16_t>(in, offset + 42);
377 object_box_orientation_angle = read_le<int16_t>(in, offset + 44);
378 object_box_orientation_angle_sigma = read_le<int16_t>(in, offset + 50);
379 absolute_velocity_x = read_le<int16_t>(in, offset + 52);
380 absolute_velocity_y = read_le<int16_t>(in, offset + 54);
381 absolute_velocity_sigma_x = read_le<uint16_t>(in, offset + 56);
382 absolute_velocity_sigma_y = read_le<uint16_t>(in, offset + 58);
383 relative_velocity_x = read_le<int16_t>(in, offset + 60);
384 relative_velocity_y = read_le<int16_t>(in, offset + 62);
385 relative_velocity_sigma_x = read_le<uint16_t>(in, offset + 64);
386 relative_velocity_sigma_y = read_le<uint16_t>(in, offset + 66);
387 classification =
static_cast<Classification>(read_le<uint8_t>(in, offset + 68));
388 uint8_t flags = read_le<uint8_t>(in, offset + 69);
390 mobile_detected = ((flags & 0x02) > 0);
391 track_valid = ((flags & 0x04) > 0);
392 classification_age = read_le<uint16_t>(in, offset + 70);
393 classification_confidence = read_le<uint16_t>(in, offset + 72);
394 number_of_contour_points = read_le<uint16_t>(in, offset + 74);
396 if (number_of_contour_points == 65535)
397 number_of_contour_points = 0;
399 for (uint16_t i = 0; i < number_of_contour_points; i++)
402 contour_point.
parse(in, offset + 76 + (i * 4), ByteOrder::LE);
403 contour_point_list.push_back(contour_point);
407 void Object2271::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
409 id = read_be<uint32_t>(in, offset);
410 uint8_t properties_available = read_be<uint8_t>(in, offset + 6);
411 untracked_properties_available = ((properties_available & 0x02) > 0);
412 tracked_properties_available = ((properties_available & 0x08) > 0);
414 if (untracked_properties_available)
416 untracked_properties.parse(in, offset + 7);
420 untracked_properties.number_of_contour_points = 0;
423 if (tracked_properties_available)
425 tracked_properties.parse(in, offset + 42 + (untracked_properties.number_of_contour_points * 8));
429 tracked_properties.number_of_contour_points = 0;
433 void Object2280::parse(
const std::vector<uint8_t>& in,
const uint16_t& offset)
435 id = read_be<uint16_t>(in, offset);
437 uint16_t flags = read_be<uint16_t>(in, offset + 2);
439 mobility_of_dyn_object_detected = ((flags & 0x80) > 0);
440 motion_model_validated = ((flags & 0x100) > 0);
441 object_age = read_be<uint32_t>(in, offset + 4);
442 timestamp = read_be<NTPTime>(in, offset + 8);
443 object_prediction_age = read_be<uint16_t>(in, offset + 16);
444 classification =
static_cast<Classification>(read_be<uint8_t>(in, offset + 18));
445 classification_certainty = read_be<uint8_t>(in, offset + 19);
446 classification_age = read_be<uint32_t>(in, offset + 20);
447 object_box_center.parse(in, offset + 40, ByteOrder::BE);
448 object_box_center_sigma.parse(in, offset + 48, ByteOrder::BE);
449 object_box_size.parse(in, offset + 56, ByteOrder::BE);
450 object_box_orientation_angle = read_be<float>(in, offset + 72);
451 object_box_orientation_angle_sigma = read_be<float>(in, offset + 76);
452 relative_velocity.parse(in, offset + 80, ByteOrder::BE);
453 relative_velocity_sigma.parse(in, offset + 88, ByteOrder::BE);
454 absolute_velocity.parse(in, offset + 96, ByteOrder::BE);
455 absolute_velocity_sigma.parse(in, offset + 104, ByteOrder::BE);
456 number_of_contour_points = read_be<uint8_t>(in, offset + 130);
457 closest_point_index = read_be<uint8_t>(in, offset + 131);
458 reference_point_location =
static_cast<PointLocation>(read_be<uint16_t>(in, offset + 132));
459 reference_point_coordinate.parse(in, offset + 134, ByteOrder::BE);
460 reference_point_coordinate_sigma.parse(in, offset + 142, ByteOrder::BE);
461 reference_point_position_correction_coefficient = read_be<float>(in, offset + 150);
462 object_priority = read_be<uint16_t>(in, offset + 162);
463 object_existence_measurement = read_be<float>(in, offset + 164);
465 if (number_of_contour_points == 255)
466 number_of_contour_points = 0;
468 for (uint8_t i = 0; i < number_of_contour_points; i++)
471 new_contour_point.
parse(in, offset + 168 + (i * 8), ByteOrder::BE);
472 contour_point_list.push_back(new_contour_point);
477 void IbeoDataHeader::parse(
const std::vector<uint8_t>& in)
479 previous_message_size = read_be<uint32_t>(in, 4);
480 message_size = read_be<uint32_t>(in, 8);
481 device_id = read_be<uint8_t>(in, 13);
482 data_type_id = read_be<uint16_t>(in, 14);
483 time = read_be<NTPTime>(in, 16);
486 void IbeoDataHeader::encode()
488 encoded_data.clear();
491 encoded_data.push_back(0xAF);
492 encoded_data.push_back(0xFE);
493 encoded_data.push_back(0xC0);
494 encoded_data.push_back(0xC2);
496 encoded_data.push_back(0x00);
497 encoded_data.push_back(0x00);
498 encoded_data.push_back(0x00);
499 encoded_data.push_back(0x00);
502 std::vector<uint8_t> encoded_message_size = write_be<uint32_t>(&message_size);
503 encoded_data.insert(encoded_data.end(), encoded_message_size.begin(), encoded_message_size.end());
505 encoded_data.push_back(0x00);
507 encoded_data.push_back(0x00);
509 std::vector<uint8_t> encoded_data_type_id = write_be<uint16_t>(&data_type_id);
510 encoded_data.insert(encoded_data.end(), encoded_data_type_id.begin(), encoded_data_type_id.end());
512 std::vector<uint8_t> encoded_time = write_be<NTPTime>(&time);
513 encoded_data.insert(encoded_data.end(), encoded_time.begin(), encoded_time.end());
516 IbeoTxMessage::IbeoTxMessage() :
517 has_scan_points(false),
518 has_contour_points(false),
533 return std::shared_ptr<IbeoTxMessage>(
new ErrorWarning);
536 return std::shared_ptr<IbeoTxMessage>(
new ScanData2202);
539 return std::shared_ptr<IbeoTxMessage>(
new ScanData2205);
542 return std::shared_ptr<IbeoTxMessage>(
new ScanData2208);
560 return std::shared_ptr<IbeoTxMessage>(
new CameraImage);
572 return std::shared_ptr<IbeoTxMessage>(
new DeviceStatus);
581 return std::vector<Point3DL>();
586 return std::vector<Point3D>();
591 return std::vector<IbeoObject>();
600 uint16_t err_reg_1 = read_le<uint16_t>(in, hdr);
601 uint16_t err_reg_2 = read_le<uint16_t>(in, hdr + 2);
602 uint16_t wrn_reg_1 = read_le<uint16_t>(in, hdr + 4);
603 uint16_t wrn_reg_2 = read_le<uint16_t>(in, hdr + 6);
605 err_internal_error = ((err_reg_1 & 0x0001) > 0);
606 err_motor_1_fault = ((err_reg_1 & 0x0002) > 0);
607 err_buffer_error_xmt_incomplete = ((err_reg_1 & 0x0004) > 0);
608 err_buffer_error_overflow = ((err_reg_1 & 0x0008) > 0);
609 err_apd_over_temperature = ((err_reg_1 & 0x0100) > 0);
610 err_apd_under_temperature = ((err_reg_1 & 0x0200) > 0);
611 err_apd_temperature_sensor_defect = (err_apd_over_temperature && err_apd_under_temperature);
612 err_motor_2_fault = ((err_reg_1 & 0x0400) > 0);
613 err_motor_3_fault = ((err_reg_1 & 0x0800) > 0);
614 err_motor_4_fault = ((err_reg_1 & 0x1000) > 0);
615 err_motor_5_fault = ((err_reg_1 & 0x2000) > 0);
617 err_int_no_scan_data = ((err_reg_2 & 0x0001) > 0);
618 err_int_communication_error = ((err_reg_2 & 0x0002) > 0);
619 err_int_incorrect_scan_data = ((err_reg_2 & 0x0004) > 0);
620 err_config_fpga_not_configurable = ((err_reg_2 & 0x0008) > 0);
621 err_config_incorrect_config_data = ((err_reg_2 & 0x0010) > 0);
622 err_config_contains_incorrect_params = ((err_reg_2 & 0x0020) > 0);
623 err_timeout_data_processing = ((err_reg_2 & 0x0040) > 0);
624 err_timeout_env_model_computation_reset = ((err_reg_2 & 0x0080) > 0);
626 wrn_int_communication_error = ((wrn_reg_1 & 0x0001) > 0);
627 wrn_low_temperature = ((wrn_reg_1 & 0x0008) > 0);
628 wrn_high_temperature = ((wrn_reg_1 & 0x0010) > 0);
629 wrn_int_motor_1 = ((wrn_reg_1 & 0x0020) > 0);
630 wrn_sync_error = ((wrn_reg_1 & 0x0080) > 0);
631 wrn_laser_1_start_pulse_missing = ((wrn_reg_1 & 0x1000) > 0);
632 wrn_laser_2_start_pulse_missing = ((wrn_reg_1 & 0x2000) > 0);
634 wrn_can_interface_blocked = ((wrn_reg_2 & 0x0001) > 0);
635 wrn_eth_interface_blocked = ((wrn_reg_2 & 0x0002) > 0);
636 wrn_incorrect_can_data_rcvd = ((wrn_reg_2 & 0x0004) > 0);
637 wrn_int_incorrect_scan_data = ((wrn_reg_2 & 0x0008) > 0);
638 wrn_eth_unkwn_incomplete_data = ((wrn_reg_2 & 0x0010) > 0);
639 wrn_incorrect_or_forbidden_cmd_rcvd = ((wrn_reg_2 & 0x0020) > 0);
640 wrn_memory_access_failure = ((wrn_reg_2 & 0x0040) > 0);
641 wrn_int_overflow = ((wrn_reg_2 & 0x0080) > 0);
642 wrn_ego_motion_data_missing = ((wrn_reg_2 & 0x0100) > 0);
643 wrn_incorrect_mounting_params = ((wrn_reg_2 & 0x0200) > 0);
644 wrn_no_obj_comp_due_to_scan_freq = ((wrn_reg_2 & 0x0400) > 0);
673 uint16_t flags = read_le<uint16_t>(in, hdr + 42);
682 new_scan_point.
parse(in, hdr + 44 + (i * 10));
689 std::vector<Point3DL> v;
690 double cm_to_m = 100.0;
694 if (sp.echo == 0 && sp.layer < 4 && !sp.transparent_point && !sp.clutter_atmospheric && !sp.ground && !sp.dirt)
704 double rho = sp.radial_distance / cm_to_m;
709 theta = (88.4 * (M_PI / 180.0));
712 theta = (89.2 * (M_PI / 180.0));
715 theta = (90.8 * (M_PI / 180.0));
718 theta = (91.6 * (M_PI / 180.0));
722 p3d.
x = rho * sin(theta) * cos(phi);
723 p3d.
y = rho * sin(theta) * sin(phi);
724 p3d.
z = rho * cos(theta);
726 p3d.
label = sp.layer;
748 uint32_t flags = read_be<uint32_t>(in, hdr + 12);
763 scanner_info.
parse(in, hdr + 24 + (i * 40));
770 scan_point.
parse(in, hdr + 24 + (number_of_scanner_infos * 40) + (i * 28));
777 std::vector<Point3DL> v;
781 if (sp.echo == 0 && sp.layer < 4 && !sp.ground && !sp.dirt && !sp.precipitation)
785 p3d.
x = sp.x_position;
786 p3d.
y = sp.y_position;
787 p3d.
z = sp.z_position;
788 p3d.
label = sp.layer;
809 uint32_t flags = read_be<uint32_t>(in, hdr + 12);
823 new_scanner_info.
parse(in, hdr + 24 + (i * 148));
830 new_scan_point.
parse(in, hdr + 24 + (number_of_scanner_infos * 148) + (i * 28));
837 std::vector<Point3DL> v;
841 if (sp.echo == 0 && sp.layer < 4 && !sp.transparent && !sp.ground && !sp.dirt && !sp.precipitation)
845 p3d.
x = sp.x_position;
846 p3d.
y = sp.y_position;
847 p3d.
z = sp.z_position;
848 p3d.
label = sp.layer;
868 uint16_t scanner_status = read_be<uint16_t>(in, hdr + 4);
869 motor_on = ((scanner_status & 0x0001) > 0);
870 laser_on = ((scanner_status & 0x0002) > 0);
881 device_id = read_be<uint8_t>(in, hdr + 50);
886 subflags = read_be<uint8_t>(in, hdr + 72);
894 new_scan_point.
parse(in, hdr + 88 + (i * 11));
901 std::vector<Point3DL> v;
902 double cm_to_m = 100.0;
906 if (sp.echo == 0 && sp.layer < 4 && !sp.transparent_point && !sp.clutter_atmospheric && !sp.ground && !sp.dirt)
916 double rho = sp.radial_distance / cm_to_m;
921 theta = (88.4 * (M_PI / 180.0));
924 theta = (89.2 * (M_PI / 180.0));
927 theta = (90.8 * (M_PI / 180.0));
930 theta = (91.6 * (M_PI / 180.0));
934 p3d.
x = rho * sin(theta) * cos(phi);
935 p3d.
y = rho * sin(theta) * sin(phi);
936 p3d.
z = rho * cos(theta);
938 p3d.
label = sp.layer;
940 p3d.
label = sp.layer;
962 uint32_t offset = hdr + 10;
967 new_object.
parse(in, offset);
976 std::vector<Point3D> contour_points;
980 for (
Point2Di p2d : o.contour_point_list)
983 p3d.
x =
static_cast<double>(p2d.
x) / 100.0;
984 p3d.
y =
static_cast<double>(p2d.
y) / 100.0;
986 contour_points.push_back(p3d);
990 return contour_points;
995 std::vector<IbeoObject> io_list;
1038 io_list.push_back(io);
1057 uint32_t offset = hdr + 10;
1062 new_object.
parse(in, offset);
1071 std::vector<Point3D> contour_points;
1075 for (
Point2Df p2d : o.contour_point_list)
1078 p3d.
x =
static_cast<double>(p2d.
x) / 100.0;
1079 p3d.
y =
static_cast<double>(p2d.
y) / 100.0;
1081 contour_points.push_back(p3d);
1085 return contour_points;
1090 std::vector<IbeoObject> io_list;
1130 io_list.push_back(io);
1150 uint32_t offset = hdr + 12;
1155 new_object.
parse(in, offset);
1165 std::vector<Point3D> contour_points;
1169 for (
Point2Di p2d : o.contour_point_list)
1172 p3d.
x =
static_cast<double>(p2d.
x) / 100.0;
1173 p3d.
y =
static_cast<double>(p2d.
y) / 100.0;
1175 contour_points.push_back(p3d);
1179 return contour_points;
1184 std::vector<IbeoObject> io_list;
1209 switch (o.reference_point_location)
1264 io_list.push_back(io);
1284 uint32_t offset = hdr + 20;
1289 new_object.
parse(in, offset);
1293 offset += (118 + 4);
1303 std::vector<Point3D> points;
1305 double m_to_cm = 100.0;
1310 if (o.untracked_properties_available)
1315 p.
x = cp.
x / m_to_cm;
1316 p.
y = cp.
y / m_to_cm;
1317 points.push_back(p);
1321 if (o.tracked_properties_available)
1326 p.
x = cp.
x / m_to_cm;
1327 p.
y = cp.
y / m_to_cm;
1329 points.push_back(p);
1341 std::vector<IbeoObject> io_list;
1357 if (o.tracked_properties_available)
1359 io.
age = o.tracked_properties.object_age;
1362 io.
closest_point.
x = o.tracked_properties.position_closest_point.x / 100.0;
1363 io.
closest_point.
y = o.tracked_properties.position_closest_point.y / 100.0;
1368 100.0 * (M_PI / 180.0);
1373 switch (o.tracked_properties.tracking_point_location)
1426 if (o.untracked_properties_available)
1430 io.
closest_point.
x = o.untracked_properties.position_closest_point.x / 100.0;
1431 io.
closest_point.
y = o.untracked_properties.position_closest_point.y / 100.0;
1436 100.0 * (M_PI / 180.0);
1441 io.
reference_point.
x = o.untracked_properties.tracking_point_coordinate.x / 100.0;
1442 io.
reference_point.
y = o.untracked_properties.tracking_point_coordinate.y / 100.0;
1451 io_list.push_back(io);
1470 uint32_t offset = hdr + 10;
1475 new_object.
parse(in, offset);
1486 std::vector<Point3D> contour_points;
1490 for (
Point2Df p2d : o.contour_point_list)
1492 if (!std::isnan(p2d.
x) && !std::isnan(p2d.
y) && fabs(p2d.
x) < 300.0 && fabs(p2d.
y) < 300.0)
1495 p3d.
x =
static_cast<double>(p2d.
x);
1496 p3d.
y =
static_cast<double>(p2d.
y);
1498 contour_points.push_back(p3d);
1503 return contour_points;
1508 std::vector<IbeoObject> io_list;
1514 io.
age = o.object_age;
1547 io_list.push_back(io);
1565 timestamp = read_be<NTPTime>(in, hdr + 6);
1566 device_id = read_be<uint8_t>(in, hdr + 14);
1616 timestamp = read_le<NTPTime>(in, hdr + 4);
1621 yaw_rate = read_le<float>(in, hdr + 24);
1645 timestamp = read_le<NTPTime>(in, hdr + 4);
1650 yaw_rate = read_le<float>(in, hdr + 24);
1678 frequency = read_le<float>(in, hdr + 40);
1688 gettimeofday(&tv, NULL);
1689 tm = localtime(&tv.tv_sec);
1695 command_identifier = 0x0005;
1697 begin_filter_range = 0x0000;
1698 end_filter_range = 0xFFFF;
1700 std::vector<uint8_t> encoded_command_identifier = write_be<uint16_t>(&command_identifier);
1701 std::vector<uint8_t> encoded_version = write_be<uint16_t>(&version);
1702 std::vector<uint8_t> encoded_begin_filter_range = write_be<uint16_t>(&begin_filter_range);
1703 std::vector<uint8_t> encoded_end_filter_range = write_be<uint16_t>(&end_filter_range);
1705 encoded_data.insert(encoded_data.end(), encoded_command_identifier.begin(), encoded_command_identifier.end());
1706 encoded_data.insert(encoded_data.end(), encoded_version.begin(), encoded_version.end());
1707 encoded_data.insert(encoded_data.end(), encoded_begin_filter_range.begin(), encoded_begin_filter_range.end());
1708 encoded_data.insert(encoded_data.end(), encoded_end_filter_range.begin(), encoded_end_filter_range.end());
std::vector< IbeoObject > get_objects()
std::vector< Point3DL > get_scan_points()
std::vector< Object2221 > object_list
uint16_t angle_ticks_per_rotation
double ticks_to_angle(int16_t angle_ticks, uint16_t angle_ticks_per_rotation)
std::vector< Point3D > get_contour_points()
CoordinateSystem coordinate_system
std::vector< Point3D > contour_point_list
const uint8_t IBEO_HEADER_SIZE
std::vector< Object2280 > object_list
int16_t mounting_pitch_angle_ticks
void parse(const std::vector< uint8_t > &in, const uint16_t &offset, ByteOrder bo)
int16_t longitudinal_velocity
std::vector< ScanPoint2208 > scan_point_list
uint8_t number_of_scanner_infos
static std::shared_ptr< IbeoTxMessage > make_message(const uint16_t &data_type)
NTPTime scan_start_timestamp
uint16_t object_list_number
void parse(const std::vector< uint8_t > &in, const uint16_t &offset, ByteOrder bo)
void parse(const std::vector< uint8_t > &in)
void parse(const std::vector< uint8_t > &in, const uint16_t &offset, ByteOrder bo)
int16_t steering_wheel_angle
float object_box_orientation
uint16_t relative_timestamp
void parse(const std::vector< uint8_t > &in)
int16_t mounting_position_y
static const int32_t DATA_TYPE
static const int32_t DATA_TYPE
uint16_t number_of_contour_points
static const int32_t DATA_TYPE
virtual std::vector< IbeoObject > get_objects()
void parse(const std::vector< uint8_t > &in)
std::vector< IbeoObject > get_objects()
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
static const int32_t DATA_TYPE
int16_t mounting_yaw_angle_ticks
PointLocation reference_point_location
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
void parse(const std::vector< uint8_t > &in)
Point2Df object_box_center
std::vector< ScanPoint2205 > scan_point_list
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
double vertical_opening_angle
uint8_t number_of_contour_points
static const int32_t DATA_TYPE
uint32_t scan_end_time_offset
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
NTPTime start_scan_timestamp
float rear_axle_to_vehicle_rear
std::vector< Object2271 > object_list
uint16_t number_of_objects
std::vector< Point3DL > get_scan_points()
void parse(const std::vector< uint8_t > &in)
TrackedProperties tracked_properties
std::vector< Object2225 > object_list
IbeoDataHeader ibeo_header
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
double horizontal_opening_angle
uint16_t number_of_contour_points
int16_t mounting_roll_angle_ticks
int16_t heading_difference
static const int32_t DATA_TYPE
void parse(const std::vector< uint8_t > &in)
NTPTime mid_scan_timestamp
uint16_t number_of_scanner_infos
static const int32_t DATA_TYPE
std::vector< Point3D > get_contour_points()
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
uint16_t classification_age
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
void parse(const std::vector< uint8_t > &in)
int16_t front_wheel_angle
Point2Df absolute_velocity
std::vector< Point3DL > get_scan_points()
static const int32_t DATA_TYPE
Point2Df absolute_velocity_sigma
uint16_t number_of_objects
static const int32_t DATA_TYPE
Point2Df reference_point_sigma
int16_t start_angle_ticks
MotorRotatingDirection motor_rotating_direction
void parse(const std::vector< uint8_t > &in)
Point2Df relative_velocity
static const int32_t DATA_TYPE
uint16_t number_of_objects
static const int32_t DATA_TYPE
std::vector< IbeoObject > get_objects()
Size2Df bounding_box_size
std::vector< ScannerInfo2204 > scanner_info_list
void parse(const std::vector< uint8_t > &in)
CoordinateSystem object_coordinate_system
MountingPositionF mounting_position
static const int32_t DATA_TYPE
float vehicle_front_to_front_axle
float steering_wheel_angle
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
std::vector< Point3D > get_contour_points()
int16_t mounting_yaw_angle_ticks
float rear_axle_to_front_axle
uint16_t number_of_scan_points
uint8_t number_of_contour_points
int16_t mounting_position_z
static const int32_t DATA_TYPE
std::vector< Object2270 > object_list
uint32_t scan_end_time_offset
std::vector< Point3D > get_contour_points()
void parse(const std::vector< uint8_t > &in)
uint8_t number_of_contour_points
uint16_t sync_phase_offset
float rear_axle_to_vehicle_rear
float steering_wheel_angle
int16_t mounting_pitch_angle_ticks
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
std::vector< uint8_t > image_buffer
int16_t mounting_position_y
std::vector< ScanPoint2204 > scan_point_list
void parse(const std::vector< uint8_t > &in)
uint16_t angle_ticks_per_rotation
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
uint16_t number_of_objects
void parse(const std::vector< uint8_t > &in)
Point2Df bounding_box_center
NTPTime unix_time_to_ntp(struct tm *tm, struct timeval *tv)
static const int32_t DATA_TYPE
std::vector< ScanPoint2202 > scan_point_list
static const int32_t DATA_TYPE
std::vector< IbeoObject > get_objects()
std::vector< Point3D > get_contour_points()
NTPTime start_scan_timestamp
std::vector< Point3DL > get_scan_points()
NTPTime mid_scan_timestamp
float longitudinal_velocity
void parse(const std::vector< uint8_t > &in)
float rear_axle_to_front_axle
std::vector< IbeoObject > get_objects()
virtual std::vector< Point3D > get_contour_points()
int16_t start_angle_ticks
float longitudinal_velocity
virtual std::vector< Point3DL > get_scan_points()
int16_t mounting_position_x
float vehicle_front_to_front_axle
uint16_t number_of_contour_points
UntrackedProperties untracked_properties
uint8_t number_of_contour_points
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
std::vector< ScannerInfo2205 > scanner_info_list
uint16_t scan_points_count
int16_t mounting_position_z
float longitudinal_acceleration
void parse(const std::vector< uint8_t > &in)
int16_t mounting_position_x
uint16_t number_of_objects
CoordinateSystem coordinate_system
uint32_t us_since_power_on
void parse(const std::vector< uint8_t > &in)
void parse(const std::vector< uint8_t > &in, const uint16_t &offset)
uint16_t classification_certainty
int16_t mounting_roll_angle_ticks