ibeo_core.h
Go to the documentation of this file.
1 /*
2 * Unpublished Copyright (c) 2009-2019 AutonomouStuff, LLC, All Rights Reserved.
3 *
4 * This file is part of the ibeo_core ROS driver which is released under the MIT license.
5 * See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details.
6 */
7 
8 #ifndef IBEO_CORE_IBEO_CORE_H
9 #define IBEO_CORE_IBEO_CORE_H
10 
11 #include <vector>
12 #include <cstdio>
13 #include <iostream>
14 #include <memory>
15 #include <cmath>
16 
17 #include <sys/time.h>
18 
19 #include <ibeo_core/utils.h>
20 #include <network_interface/common.h>
21 
23 
24 namespace AS
25 {
26 namespace Drivers
27 {
28 namespace Ibeo
29 {
30 const uint8_t IBEO_HEADER_SIZE = 24; // LUX_MESSAGE_DATA_OFFSET and LUX_HEADER_SIZE
31 const int32_t IBEO_PAYLOAD_SIZE = 10000; // LUX_PAYLOAD_SIZE
32 
34 {
40  CAR,
42 };
43 
45 {
46  FRONT = 0,
48 };
49 
51 {
52  SCANNER = 0,
54 };
55 
57 {
58  CLOCKWISE = 0,
60 };
61 
63 {
64  COG = 0,
74  INVALID = 255
75 };
76 
78 {
79  DYNAMIC = 0,
81 };
82 
84 {
87 };
88 
90 {
94 };
95 
97 {
98  JPEG = 0,
103 };
104 
105 struct Point3D
106 {
107  double x;
108  double y;
109  double z;
110 };
111 
112 struct Point3DL :
113  public Point3D
114 {
115  uint32_t label;
116 };
117 
119 {
120 public:
121  float yaw_angle;
122  float pitch_angle;
123  float roll_angle;
124  float x_position;
125  float y_position;
126  float z_position;
127 
128  void parse(
129  const std::vector<uint8_t>& in,
130  const uint16_t& offset);
131 };
132 
133 class Point2Df // LUX: Float2D and Point2D
134 {
135 public:
136  float x;
137  float y;
138 
139  void parse(
140  const std::vector<uint8_t>& in,
141  const uint16_t& offset,
142  ByteOrder bo);
143 };
144 
145 class Point2Di
146 {
147 public:
148  int16_t x;
149  int16_t y;
150 
151  void parse(
152  const std::vector<uint8_t>& in,
153  const uint16_t& offset,
154  ByteOrder bo);
155 };
156 
158 {
159 public:
160  uint16_t x;
161  uint16_t y;
162 
163  void parse(
164  const std::vector<uint8_t>& in,
165  const uint16_t& offset,
166  ByteOrder bo);
167 };
168 
169 class Sigma2D
170 {
171 public:
172  uint16_t sigma_x;
173  uint16_t sigma_y;
174 
175  void parse(
176  const std::vector<uint8_t>& in,
177  const uint16_t& offset,
178  ByteOrder bo);
179 };
180 
181 class Size2D
182 {
183 public:
184  uint16_t size_x;
185  uint16_t size_y;
186 
187  void parse(
188  const std::vector<uint8_t>& in,
189  const uint16_t& offset,
190  ByteOrder bo);
191 };
192 
193 class Size2Df
194 {
195 public:
196  float size_x;
197  float size_y;
198 };
199 
201 {
202 public:
203  int16_t velocity_x;
204  int16_t velocity_y;
205 
206  void parse(
207  const std::vector<uint8_t>& in,
208  const uint16_t& offset,
209  ByteOrder bo);
210 };
211 
213 {
214 public:
215  uint8_t x_sigma;
216  uint8_t y_sigma;
217 
218  void parse(
219  const std::vector<uint8_t>& in,
220  const uint16_t& offset,
221  ByteOrder bo);
222 };
223 
224 class ResolutionInfo // LUX: Resolution
225 {
226 public:
228  float resolution;
229 
230  void parse(
231  const std::vector<uint8_t>& in,
232  const uint16_t& offset);
233 };
234 
236 {
237 public:
238  uint8_t device_id;
239  uint8_t scanner_type;
240  uint16_t scan_number;
241  float start_angle;
242  float end_angle;
243  float yaw_angle;
244  float pitch_angle;
245  float roll_angle;
246  float offset_x;
247  float offset_y;
248  float offset_z;
249 
250  void parse(
251  const std::vector<uint8_t>& in,
252  const uint16_t& offset);
253 };
254 
256 {
257 public:
258  uint8_t device_id;
259  uint8_t scanner_type;
260  uint16_t scan_number;
261  float start_angle;
262  float end_angle;
268  float beam_tilt;
269  uint32_t scan_flags;
271  ResolutionInfo resolutions[8];
272 
273  void parse(
274  const std::vector<uint8_t>& in,
275  const uint16_t& offset);
276 };
277 
279 {
280 public:
290  std::vector<ContourPointSigma> contour_point_list;
291 
292  void parse(
293  const std::vector<uint8_t>& in,
294  const uint16_t& offset);
295 };
296 
298 {
299 public:
300  uint16_t object_age;
321  int16_t yaw_rate;
322  uint16_t yaw_rate_sigma;
324  std::vector<ContourPointSigma> contour_point_list;
325 
326  void parse(
327  const std::vector<uint8_t>& in,
328  const uint16_t& offset);
329 };
330 
332 {
333 public:
334  uint8_t layer;
335  uint8_t echo;
338  bool ground;
339  bool dirt;
341  uint16_t radial_distance;
343 
344  void parse(
345  const std::vector<uint8_t>& in,
346  const uint16_t& offset);
347 };
348 
350 {
351 public:
352  float x_position;
353  float y_position;
354  float z_position;
355  float echo_width;
356  uint8_t device_id;
357  uint8_t layer;
358  uint8_t echo;
359  uint32_t time_offset;
360  bool ground;
361  bool dirt;
363 
364  void parse(
365  const std::vector<uint8_t>& in,
366  const uint16_t& offset);
367 };
368 
370 {
371 public:
372  float x_position;
373  float y_position;
374  float z_position;
375  float echo_width;
376  uint8_t device_id;
377  uint8_t layer;
378  uint8_t echo;
379  uint32_t time_offset;
380  bool ground;
381  bool dirt;
384 
385  void parse(
386  const std::vector<uint8_t>& in,
387  const uint16_t& offset);
388 };
389 
391 {
392 public:
393  uint8_t echo;
394  uint8_t layer;
397  bool ground;
398  bool dirt;
400  uint16_t radial_distance;
402 
403  void parse(
404  const std::vector<uint8_t>& in,
405  const uint16_t& offset);
406 };
407 
409 {
410  uint16_t id;
411  uint32_t age;
412  uint16_t prediction_age;
427  uint16_t classification;
431  std::vector<Point3D> contour_point_list;
432 };
433 
435 {
436 public:
437  uint16_t id;
438  uint16_t age;
439  uint16_t prediction_age;
457  std::vector<Point2Di> contour_point_list;
458 
459  void parse(
460  const std::vector<uint8_t>& in,
461  const uint16_t& offset);
462 };
463 
465 {
466 public:
467  uint16_t id;
468  uint32_t age;
479  float yaw_angle;
486  std::vector<Point2Df> contour_point_list;
487 
488  void parse(
489  const std::vector<uint8_t>& in,
490  const uint16_t& offset);
491 };
492 
494 {
495 public:
496  uint16_t id;
497  uint16_t age;
498  uint16_t prediction_age;
526  std::vector<Point2Di> contour_point_list;
527 
528  void parse(
529  const std::vector<uint8_t>& in,
530  const uint16_t& offset);
531 };
532 
534 {
535 public:
536  uint32_t id;
541 
542  void parse(
543  const std::vector<uint8_t>& in,
544  const uint16_t& offset);
545 };
546 
548 {
549 public:
550  uint16_t id;
554  uint32_t object_age;
575  uint16_t object_priority;
577  std::vector<Point2Df> contour_point_list;
578 
579  void parse(
580  const std::vector<uint8_t>& in,
581  const uint16_t& offset);
582 };
583 
584 class IbeoDataHeader // LUX: LuxHeader_TX_Message
585 {
586 public:
588  uint32_t message_size;
589  uint8_t device_id;
590  uint16_t data_type_id;
592 
593  std::vector<uint8_t> encoded_data;
594 
595  void parse(const std::vector<uint8_t>& in);
596  void encode();
597 };
598 
599 // Start the top-level messages.
601 {
602 public:
607  uint16_t data_type;
608 
609  IbeoTxMessage();
610  IbeoTxMessage(bool scan_points, bool contour_points, bool objects);
611 
612  static std::shared_ptr<IbeoTxMessage> make_message(const uint16_t& data_type);
613  virtual void parse(const std::vector<uint8_t>& in) = 0;
614  virtual std::vector<Point3DL> get_scan_points();
615  virtual std::vector<Point3D> get_contour_points();
616  virtual std::vector<IbeoObject> get_objects();
617 };
618 
620 {
621 public:
622  static const int32_t DATA_TYPE;
623 
661 
662  void parse(const std::vector<uint8_t>& in);
663 };
664 
665 class ScanData2202 : public IbeoTxMessage // LUX: LuxScandata_TX_Message
666 {
667 public:
668  static const int32_t DATA_TYPE;
669 
670  uint16_t scan_number;
671  uint16_t scanner_status; // Not yet available for ScaLa.
689  std::vector<ScanPoint2202> scan_point_list;
690 
691  ScanData2202();
692 
693  void parse(const std::vector<uint8_t>& in);
694  std::vector<Point3DL> get_scan_points();
695 };
696 
698 {
699 public:
700  static const int32_t DATA_TYPE;
701 
710  uint16_t scan_number;
711  uint16_t scan_points;
713  std::vector<ScannerInfo2204> scanner_info_list;
714  std::vector<ScanPoint2204> scan_point_list;
715 
716  ScanData2204();
717 
718  void parse(const std::vector<uint8_t>& in);
719  std::vector<Point3DL> get_scan_points();
720 };
721 
723 {
724 public:
725  static const int32_t DATA_TYPE;
726 
732  uint16_t scan_number;
733  uint16_t scan_points;
735  std::vector<ScannerInfo2205> scanner_info_list;
736  std::vector<ScanPoint2205> scan_point_list;
737 
738  ScanData2205();
739 
740  void parse(const std::vector<uint8_t>& in);
741  std::vector<Point3DL> get_scan_points();
742 };
743 
745 {
746 public:
747  static const int32_t DATA_TYPE;
748 
749  uint16_t scan_number;
750  uint16_t scanner_type;
751  bool motor_on;
752  bool laser_on;
756  uint32_t scan_flags;
763  uint8_t device_id;
768  uint8_t subflags;
770  int16_t mirror_tilt;
772  std::vector<ScanPoint2208> scan_point_list;
773 
774  ScanData2208();
775 
776  void parse(const std::vector<uint8_t>& in);
777  std::vector<Point3DL> get_scan_points();
778 };
779 
781 {
782 public:
783  static const int32_t DATA_TYPE;
784 
787  std::vector<Object2221> object_list;
788 
789  ObjectData2221();
790 
791  void parse(const std::vector<uint8_t>& in);
792  std::vector<Point3D> get_contour_points();
793  std::vector<IbeoObject> get_objects();
794 };
795 
797 {
798 public:
799  static const int32_t DATA_TYPE;
800 
803  std::vector<Object2225> object_list;
804 
805  ObjectData2225();
806 
807  void parse(const std::vector<uint8_t>& in);
808  std::vector<Point3D> get_contour_points();
809  std::vector<IbeoObject> get_objects();
810 };
811 
813 {
814 public:
815  static const int32_t DATA_TYPE;
816 
820  std::vector<Object2270> object_list;
821 
822  ObjectData2270();
823 
824  void parse(const std::vector<uint8_t>& in);
825  std::vector<Point3D> get_contour_points();
826  std::vector<IbeoObject> get_objects();
827 };
828 
830 {
831 public:
832  static const int32_t DATA_TYPE;
833 
835  uint16_t scan_number;
837  std::vector<Object2271> object_list;
838 
839  ObjectData2271();
840 
841  void parse(const std::vector<uint8_t>& in);
842  std::vector<Point3D> get_contour_points();
843  std::vector<IbeoObject> get_objects();
844 };
845 
847 {
848 public:
849  static const int32_t DATA_TYPE;
850 
853  std::vector<Object2280> object_list;
854 
855  ObjectData2280();
856 
857  void parse(const std::vector<uint8_t>& in);
858  std::vector<Point3D> get_contour_points();
859  std::vector<IbeoObject> get_objects();
860 };
861 
863 {
864 public:
865  static const int32_t DATA_TYPE;
866 
870  uint8_t device_id;
874  uint16_t image_width;
875  uint16_t image_height;
876  uint32_t compressed_size;
877  std::vector<uint8_t> image_buffer;
878 
879  CameraImage();
880 
881  void parse(const std::vector<uint8_t>& in);
882 };
883 
885 {
886 public:
887  static const int32_t DATA_TYPE;
888 
890  uint16_t scan_number;
891  uint16_t error_flags;
895  int32_t x_position;
896  int32_t y_position;
897  int16_t course_angle;
898  uint16_t time_difference;
899  int16_t x_difference;
900  int16_t y_difference;
903 
905 
906  void parse(const std::vector<uint8_t>& in);
907 };
908 
910 {
911 public:
912  static const int32_t DATA_TYPE;
913 
915  int32_t distance_x;
916  int32_t distance_y;
919  float yaw_rate;
931 
933 
934  void parse(const std::vector<uint8_t>& in);
935 };
936 
938 {
939 public:
940  static const int32_t DATA_TYPE;
941 
943  int32_t distance_x;
944  int32_t distance_y;
947  float yaw_rate;
960 
962 
963  void parse(const std::vector<uint8_t>& in);
964 };
965 
967 {
968 public:
969  static const int32_t DATA_TYPE;
970 
971  uint8_t scanner_type;
973  float frequency;
974 
975  DeviceStatus();
976 
977  void parse(const std::vector<uint8_t>& in);
978 };
979 
981 {
982 public:
985  uint16_t version;
988 
989  std::vector<uint8_t> encoded_data;
990 
991  void encode();
992 };
993 
994 } // namespace Ibeo
995 } // namespace Drivers
996 } // namespace AS
997 
998 #endif // IBEO_CORE_IBEO_CORE_H
Classification classification
Definition: ibeo_core.h:471
PointLocation reference_point_location
Definition: ibeo_core.h:500
std::vector< Object2221 > object_list
Definition: ibeo_core.h:787
uint16_t relative_moment_of_measurement
Definition: ibeo_core.h:499
std::vector< uint8_t > encoded_data
Definition: ibeo_core.h:593
CoordinateSystem coordinate_system
Definition: ibeo_core.h:731
const int32_t IBEO_PAYLOAD_SIZE
Definition: ibeo_core.h:31
std::vector< Point3D > contour_point_list
Definition: ibeo_core.h:431
const uint8_t IBEO_HEADER_SIZE
Definition: ibeo_core.h:30
std::vector< Object2280 > object_list
Definition: ibeo_core.h:853
std::vector< ScanPoint2208 > scan_point_list
Definition: ibeo_core.h:772
std::vector< Point2Df > contour_point_list
Definition: ibeo_core.h:577
Classification classification
Definition: ibeo_core.h:557
std::vector< Point2Di > contour_point_list
Definition: ibeo_core.h:526
static const int32_t DATA_TYPE
Definition: ibeo_core.h:815
static const int32_t DATA_TYPE
Definition: ibeo_core.h:700
static const int32_t DATA_TYPE
Definition: ibeo_core.h:622
PointLocation reference_point_location
Definition: ibeo_core.h:415
std::vector< ScanPoint2205 > scan_point_list
Definition: ibeo_core.h:736
static const int32_t DATA_TYPE
Definition: ibeo_core.h:725
Classification classification
Definition: ibeo_core.h:453
TrackingModel tracking_model
Definition: ibeo_core.h:551
std::vector< Object2271 > object_list
Definition: ibeo_core.h:837
std::vector< Point2Df > contour_point_list
Definition: ibeo_core.h:486
TrackedProperties tracked_properties
Definition: ibeo_core.h:540
Classification classification
Definition: ibeo_core.h:519
std::vector< Object2225 > object_list
Definition: ibeo_core.h:803
static const int32_t DATA_TYPE
Definition: ibeo_core.h:832
Point2Df reference_point_coordinate_sigma
Definition: ibeo_core.h:573
static const int32_t DATA_TYPE
Definition: ibeo_core.h:865
static const int32_t DATA_TYPE
Definition: ibeo_core.h:969
float reference_point_position_correction_coefficient
Definition: ibeo_core.h:574
MotorRotatingDirection motor_rotating_direction
Definition: ibeo_core.h:754
TrackingModel tracking_model
Definition: ibeo_core.h:520
static const int32_t DATA_TYPE
Definition: ibeo_core.h:783
std::vector< ScannerInfo2204 > scanner_info_list
Definition: ibeo_core.h:713
std::vector< uint8_t > encoded_data
Definition: ibeo_core.h:989
CoordinateSystem object_coordinate_system
Definition: ibeo_core.h:414
MountingPositionF mounting_position
Definition: ibeo_core.h:871
static const int32_t DATA_TYPE
Definition: ibeo_core.h:799
PointLocation reference_point_location
Definition: ibeo_core.h:571
static const int32_t DATA_TYPE
Definition: ibeo_core.h:747
int16_t object_box_orientation_angle_sigma
Definition: ibeo_core.h:510
uint16_t reference_point_position_sigma_y
Definition: ibeo_core.h:504
std::vector< Object2270 > object_list
Definition: ibeo_core.h:820
uint64_t NTPTime
Definition: utils.h:24
std::vector< uint8_t > image_buffer
Definition: ibeo_core.h:877
std::vector< ScanPoint2204 > scan_point_list
Definition: ibeo_core.h:714
static const int32_t DATA_TYPE
Definition: ibeo_core.h:668
std::vector< ScanPoint2202 > scan_point_list
Definition: ibeo_core.h:689
static const int32_t DATA_TYPE
Definition: ibeo_core.h:849
MountingPositionF mounting_position
Definition: ibeo_core.h:270
std::vector< Point2Di > contour_point_list
Definition: ibeo_core.h:457
UntrackedProperties untracked_properties
Definition: ibeo_core.h:539
std::vector< ContourPointSigma > contour_point_list
Definition: ibeo_core.h:324
std::vector< ScannerInfo2205 > scanner_info_list
Definition: ibeo_core.h:735
uint16_t reference_point_position_sigma_x
Definition: ibeo_core.h:503
std::vector< ContourPointSigma > contour_point_list
Definition: ibeo_core.h:290
CoordinateSystem coordinate_system
Definition: ibeo_core.h:709


ibeo_core
Author(s): Joshua Whitley , Daniel Stanek
autogenerated on Fri Jun 7 2019 21:53:43