DI_CH08_1_3.h
Go to the documentation of this file.
1 /* This file provides the definition of the struct AlgoIFOutput in the interface version DIA1_1.3.
2 
3  It also provides endianess-aware functions to safely convert a binary buffer to an
4  instance of this struct (if possible).
5 */
6 
7 #ifndef IFM_O3M_ALGOIFOUTPUT_DIA1_1_3_CONVERTER_H_INCLUDED
8 #define IFM_O3M_ALGOIFOUTPUT_DIA1_1_3_CONVERTER_H_INCLUDED
9 
10 #include "ifm_types.h"
11 
12 /* The struct has explicit padding, so that it should be usable on any target
13  without special compiler flags or pragmas related to padding.
14 */
15 typedef struct
16 {
17  /*
18  Magic number of project, can be used to identify the output type.
19  */
20  ifm_o3m_sint8_t magic_no[4];
21  /*
22  Magic number of struct, can be used to identify the output type.
23  */
24  ifm_o3m_sint8_t struct_id[4];
25  /*
26  Version number of struct.
27  */
28  ifm_o3m_uint8_t version[2];
29  ifm_o3m_uint8_t pad_001; /* explicit padding, do not access this member */
30  ifm_o3m_uint8_t pad_002; /* explicit padding, do not access this member */
31  struct
32  {
33  /*
34  Sensor width included for completeness.
35 
36  Unit: [px]
37  Range: [64,64]
38  */
40  /*
41  Sensor height included for completeness.
42 
43  Unit: [px]
44  Range: [16,16]
45  */
47  /*
48  Radial distance measurements relative to the camera's optical center.
49 
50  Note: Pixels with invalid distance measurements are assigned a value of 1cm. This allows to derive
51  the pixel's 3D direction vector from the Cartesian coordinates (X,Y,Z) even for invalid pixels.
52 
53  Unit: [cm]
54  Range: [0,15000]
55  */
56  ifm_o3m_uint16_t distanceData[1024];
57  /*
58  Matrix of cartesian X coordinates, one for each pixel.
59 
60  Note: The 3D direction vector (dvx_i, dvy_i, dvz_i) associated with a given pixel index i can be
61  obtained by
62  dvx_i = DistanceImageResult::X[i] - DistanceImageResult::cameraCalibration.transX
63  dvy_i = DistanceImageResult::Y[i] - DistanceImageResult::cameraCalibration.transY
64  dvz_i = DistanceImageResult::Z[i] - DistanceImageResult::cameraCalibration.transZ
65 
66  Unit: [m]
67  Range: [-150.0,150.0]
68  */
70  /*
71  Matrix of cartesian Y coordinates, one for each pixel.
72 
73  Note: The 3D direction vector (dvx_i, dvy_i, dvz_i) associated with a given pixel index i can be
74  obtained by
75  dvx_i = DistanceImageResult::X[i] - DistanceImageResult::cameraCalibration.transX
76  dvy_i = DistanceImageResult::Y[i] - DistanceImageResult::cameraCalibration.transY
77  dvz_i = DistanceImageResult::Z[i] - DistanceImageResult::cameraCalibration.transZ
78 
79  Unit: [m]
80  Range: [-150.0,150.0]
81  */
83  /*
84  Matrix of cartesian Z coordinates, one for each pixel.
85 
86  Note: The 3D direction vector (dvx_i, dvy_i, dvz_i) associated with a given pixel index i can be
87  obtained by
88  dvx_i = DistanceImageResult::X[i] - DistanceImageResult::cameraCalibration.transX
89  dvy_i = DistanceImageResult::Y[i] - DistanceImageResult::cameraCalibration.transY
90  dvz_i = DistanceImageResult::Z[i] - DistanceImageResult::cameraCalibration.transZ
91 
92  Unit: [m]
93  Range: [-150.0,150.0]
94  */
96  /*
97  Matrix of confidence values, one for each pixel.
98 
99  Each confidence value c is a bitmask composed of the following bits:
100  (c & 1 ) != 0: pixel is regarded invalid
101  (c & 2 ) != 0: long exposure used for distance/amplitude calculataion
102  (c & 4 ) != 0: high gain channel used for distance/amplitude calculation
103  (c & 8 ) != 0: internal
104  (c & 16 ) != 0: itnernal
105  (c & 32 ) != 0: pixel has been clipped due to spatial filtering
106  (c & 64 ) != 0: pixel is classified as belonging to the ground (and there is a ground estimation)
107  (c & 128 ) != 0: pixel is classified as belonging to the ground (with default ground Z=0)
108  (c & 256 ) != 0: pixel is classified as spray/dust pixel
109  (c & 512 ) != 0: internal
110  (c & 1024) != 0: internal
111  (c & 2048) != 0: internal
112  (c & 4096) != 0: pixel has been invalidated due to low signal to noise ratio
113 
114  Unit: [N/A]
115  Range: [0,65535]
116  */
117  ifm_o3m_uint16_t confidence[1024];
118  /*
119  Matrix of raw amplitude values, one for each pixel.
120 
121  To calculate a normalized amplitude value for pixel with index i, use the following
122  formula:ampl_norm = amplitude[i] * amplitude_normalization[(confidence[i] >> 1) & 3]
123 
124  Unit: [N/A]
125  Range: [0,65535]
126  */
127  ifm_o3m_uint16_t amplitude[1024];
128  /*
129  Amplitude normalization factors.
130 
131 
132  [0]: factor for short exposure, low gain
133  [1]: factor for long exposure, low gain
134  [2]: factor for short exposure, high gain
135  [3]: factor for long exposure, high gain
136 
137  Unit: [N/A]
138  Range: [0,1000.f]
139  */
140  ifm_o3m_float32_t amplitude_normalization[4];
141  /*
142  Timestamp of the resulting data in masterclock domain.
143 
144  Unit: [1e-6 s]
145  Range: [0,MAX_UINT32]
146  */
148  /*
149  Rolling frame counter.
150 
151  Unit: [N/A]
152  Range: [0,MAX_UINT32]
153  */
155  /*
156  availability bitmask
157 
158 
159  available == 0 : available
160  (available & 1 ) != 0: interference detected
161  (available & 2 ) != 0: spray detected
162  (available & 4 ) != 0: tracking error (e.g. necessary vehicle data is not available)
163  (available & 8 ) != 0: invalid camera orientation
164  (available & 16 ) != 0: lvds cable length not detected
165  (available & 32 ) != 0: internal algo error
166  (available & 64 ) != 0: blockage detected
167  (available & 128) != 0: calibration in progress
168 
169  Unit: [enum]
170  Range: [0,255]
171  */
173  struct
174  {
175  /*
176  X component of the camera's translation vector expressed in world coordinates.
177 
178  If the standard vehicle coordinate system is used, this value is the distance from rear axle to the
179  camera's reference point parallel to the vehicle's driving direction. Positive values indicate that
180  the camera is in front of the rear axle.
181 
182  Unit: [m]
183  Range: [-30,30]
184  */
186  /*
187  Y component of the camera's translation vector expressed in world coordinates.
188 
189  If the standard vehicle coordinate system is used, this value is the distance from the vehicle's
190  longitudinal center plane to the camera's reference point. Positive values indicate that the camera
191  is located at the left side of the vehicle.
192 
193  Unit: [m]
194  Range: [-30,30]
195  */
197  /*
198  Z component of the camera's translation vector expressed in world coordinates.
199 
200  If the standard vehicle coordinate system is used, this value is the distance from the ground plane
201  to the camera's reference point. Positive values indicate that the camera is above the ground.
202 
203  Unit: [m]
204  Range: [-30,30]
205  */
207  /*
208  Camera rotation around the X axis.
209 
210  The camera orientation is expressed in so-called Euler angles.
211 
212  Unit: [rad]
213  Range: [-pi,pi]
214  */
216  /*
217  Camera rotation around the Y axis.
218 
219  The camera orientation is expressed in so-called Euler angles.
220 
221  Unit: [rad]
222  Range: [-pi,pi]
223  */
225  /*
226  Camera rotation around the Z axis.
227 
228  The camera orientation is expressed in so-called Euler angles.
229 
230  Unit: [rad]
231  Range: [-pi,pi]
232  */
234  } cameraCalibration;
235  struct
236  {
237  /*
238  Field of view, given as unit vectors in the world coordinate system.
239 
240  This is the vector (x,y,z) corresponding to the upper left corner.
241  */
242  ifm_o3m_float32_t upperLeft[3];
243  /*
244  Field of view, given as unit vectors in the world coordinate system.
245 
246  This is the vector (x,y,z) corresponding to the upper right corner.
247  */
248  ifm_o3m_float32_t upperRight[3];
249  /*
250  Field of view, given as unit vectors in the world coordinate system.
251 
252  This is the vector (x,y,z) corresponding to the lower left corner.
253  */
254  ifm_o3m_float32_t lowerLeft[3];
255  /*
256  Field of view, given as unit vectors in the world coordinate system.
257 
258  This is the vector (x,y,z) corresponding to the lower right corner.
259  */
260  ifm_o3m_float32_t lowerRight[3];
261  } fieldOfView;
262  struct
263  {
264  /*
265  Focal length x direction.
266 
267  Negative in case of mirroring enabled for x direction. Zero in case of no 2D sensor present.
268 
269  Unit: [px]
270  Range: [-MAX_FLOAT32,+MAX_FLOAT32]
271  */
273  /*
274  Focal length y direction.
275 
276  Negative in case of mirroring enabled for y direction. Zero in case of no 2D sensor present.
277 
278  Unit: [px]
279  Range: [-MAX_FLOAT32,+MAX_FLOAT32]
280  */
282  /*
283  Main point in x.
284 
285  Unit: [px]
286  Range: [-320,+320]
287  */
289  /*
290  Main point in y.
291 
292  Unit: [px]
293  Range: [-240,+240]
294  */
296  /*
297  skew parameter
298 
299  Unit: [N/A]
300  Range: [-1,+1]
301  */
303  /*
304  First radial distortion parameter.
305 
306  Unit: [N/A]
307  Range: [-10,10]
308  */
310  /*
311  Second radial distortion parameter.
312 
313  Unit: [N/A]
314  Range: [-10,10]
315  */
317  /*
318  Third radial distortion parameter.
319 
320  Unit: [N/A]
321  Range: [-10,10]
322  */
324  /*
325  First tangential distortion parameter.
326 
327  Unit: [N/A]
328  Range: [-10,10]
329  */
331  /*
332  Second tangential distortion parameter.
333 
334  Unit: [N/A]
335  Range: [-10,10]
336  */
338  /*
339  x coordinate of center point for extrinsic calibration
340 
341  Unit: [N/A]
342  Range: [-10,10]
343  */
345  /*
346  y coordinate of center point for extrinsic calibration
347 
348  Unit: [N/A]
349  Range: [-10,10]
350  */
352  /*
353  z coordinate of center point for extrinsic calibration
354 
355  Unit: [N/A]
356  Range: [-10,10]
357  */
359  /*
360  x coordinate of offset to ceneter point of extrinsic calibration
361 
362  Unit: [N/A]
363  Range: [-10,10]
364  */
366  /*
367  y coordinate of offset to ceneter point of extrinsic calibration
368 
369  Unit: [N/A]
370  Range: [-10,10]
371  */
373  /*
374  z coordinate of offset to ceneter point of extrinsic calibration
375 
376  Unit: [N/A]
377  Range: [-10,10]
378  */
380  /*
381  x rotation
382 
383  Unit: [rad]
384  Range: [-pi,pi]
385  */
387  /*
388  y rotation
389 
390  Unit: [rad]
391  Range: [-pi,pi]
392  */
394  /*
395  z rotation
396 
397  Unit: [rad]
398  Range: [-pi,pi]
399  */
401  } intrExtrCalib_2d;
402  /*
403  Absolute position of illumination in world coordinates [X,Y,Z].
404 
405  Unit: [m]
406  Range: [-100,100]
407  */
408  ifm_o3m_float32_t illuPosition[3];
409  /*
410  Blockage ratio (for transmission over CAN)
411 
412  Unit: [N/A]
413  Range: [0,1]
414  */
416  /*
417  Flag indicating if the blockage is available for this sample.
418 
419  Unit: [bool]
420  Range: [0,1]
421  */
423  ifm_o3m_uint8_t pad_001; /* explicit padding, do not access this member */
424  ifm_o3m_uint8_t pad_002; /* explicit padding, do not access this member */
425  ifm_o3m_uint8_t pad_003; /* explicit padding, do not access this member */
426  } distanceImageResult;
427  struct
428  {
429  struct
430  {
431  /*
432  valid flag for calibration
433  */
435  /*
436  Stable calibration counter, can be used as an acceptance criterium.
437  */
439  struct
440  {
441  /*
442  X component of the camera's translation vector expressed in world coordinates.
443 
444  If the standard vehicle coordinate system is used, this value is the distance from rear axle to the
445  camera's reference point parallel to the vehicle's driving direction. Positive values indicate that
446  the camera is in front of the rear axle.
447 
448  Unit: [m]
449  Range: [-30,30]
450  */
451  ifm_o3m_float32_t transX;
452  /*
453  Y component of the camera's translation vector expressed in world coordinates.
454 
455  If the standard vehicle coordinate system is used, this value is the distance from the vehicle's
456  longitudinal center plane to the camera's reference point. Positive values indicate that the camera
457  is located at the left side of the vehicle.
458 
459  Unit: [m]
460  Range: [-30,30]
461  */
462  ifm_o3m_float32_t transY;
463  /*
464  Z component of the camera's translation vector expressed in world coordinates.
465 
466  If the standard vehicle coordinate system is used, this value is the distance from the ground plane
467  to the camera's reference point. Positive values indicate that the camera is above the ground.
468 
469  Unit: [m]
470  Range: [-30,30]
471  */
472  ifm_o3m_float32_t transZ;
473  /*
474  Camera rotation around the X axis.
475 
476  The camera orientation is expressed in so-called Euler angles.
477 
478  Unit: [rad]
479  Range: [-pi,pi]
480  */
481  ifm_o3m_float32_t rotX;
482  /*
483  Camera rotation around the Y axis.
484 
485  The camera orientation is expressed in so-called Euler angles.
486 
487  Unit: [rad]
488  Range: [-pi,pi]
489  */
490  ifm_o3m_float32_t rotY;
491  /*
492  Camera rotation around the Z axis.
493 
494  The camera orientation is expressed in so-called Euler angles.
495 
496  Unit: [rad]
497  Range: [-pi,pi]
498  */
499  ifm_o3m_float32_t rotZ;
500  } calibResult;
501  } commonCalibrationResult;
502  struct
503  {
504  /*
505  Number of triangles detected.
506 
507  Unit: [N/A]
508  Range: [0,8]
509  */
511  ifm_o3m_uint8_t pad_001; /* explicit padding, do not access this member */
512  ifm_o3m_uint8_t pad_002; /* explicit padding, do not access this member */
513  ifm_o3m_uint8_t pad_003; /* explicit padding, do not access this member */
514  struct
515  {
516  /*
517  score of triangle detection (-1: inverse match, 1: perfect match)
518 
519  Unit: [N/A]
520  Range: [-1,1]
521  */
523  /*
524  Cartesian 3D position of triangle center (x, y, z)
525  */
527  /*
528  Corner 2D positions of triangle corners (for image overlay).
529 
530  The first index represents the corner point index in the triangle. The second index represents the
531  x (=0) or y (=1) coordinate on the 2D image plane.
532  */
533  ifm_o3m_float32_t corners[3][2];
534  } triangleDetections[8];
535  /*
536  Boolean indicating a valid Pattern Autocalibration frame.
537  */
539  /*
540  Mean calibration reprojection error per frame.
541 
542  Unit: [m]
543  Range: [0, 0.25]
544  */
546  } pacCalibrationResult;
547  struct
548  {
549  /*
550  Set to 1 if street estimation is considered valid and may be used for further processing.
551  */
553  struct
554  {
555  /*
556  Pitch angle of the camera in [rad].
557  */
559  /*
560  Roll angle of the camera in [rad].
561  */
563  /*
564  height of the camera in [m].
565  */
567  /*
568  normal vector of the currently estimated road plane (x component)
569 
570  This is derived directly from pitchAngle and rollAngle and is provided for convenience.
571  */
573  /*
574  normal vector of the currently estimated road plane (y component)
575 
576  This is derived directly from pitchAngle and rollAngle and is provided for convenience.
577  */
579  /*
580  normal vector of the currently estimated road plane (z component)
581 
582  This is derived directly from pitchAngle and rollAngle and is provided for convenience.
583  */
585  } planeEstimation;
586  /*
587  Plausibility [0,1] for the estimated plane parameters.
588  */
590  /*
591  Standard deviation of distance to plane of all pixels, which are assigned as street pixels.
592  */
594  } streetCalibrationResult;
595  } calibrationResult;
596  struct
597  {
598  /*
599  the digitial outputs of the logic graph
600 
601  This output should be assigned with PVO nodes addressing ChannelID 2, expression
602  "AlgoState.algoLogicState.ifOutput.digitalOutput[]". Using this pattern, it is possible to treat
603  the digital outputs as a kind of external memory for the logic graph.
604  */
605  ifm_o3m_uint8_t digitalOutput[100];
606  /*
607  the analog outputs of the logic graph
608 
609  This output should be assigned with PVO nodes addressing ChannelID 2, expression
610  "AlgoState.algoLogicState.ifOutput.analogOuptut[]". Using this pattern, it is possible to treat the
611  analog outputs as a kind of external memory for the logic graph.
612  */
613  ifm_o3m_float32_t analogOutput[20];
614  } logicOutput;
616 
617 
618 /* Casts the buffer to ifm_o3m_AlgoIFOutput_DIA1_1_3 (if possible) and returns a pointer to it.
619  Use this function on little Endian systems.
620 
621  Returns NULL in case of errors. */
623 
624 /* Converts the endianess of the buffer to native form and returns a pointer to ifm_o3m_AlgoIFOutput_DIA1_1_3.
625  Note: The original buffer is modified in place.
626  Use this function on big Endian systems.
627 
628  Returns NULL in case of errors. */
630 
631 #endif
ifm_o3m_float32_t extrCalib_delta_ty
Definition: DI_CH08_1_3.h:372
unsigned int ifm_o3m_uint32_t
Definition: ifm_types.h:7
signed int ifm_o3m_sint32_t
Definition: ifm_types.h:8
ifm_o3m_float32_t intrCalib_2D_fy
Definition: DI_CH08_1_3.h:281
ifm_o3m_float32_t intrCalib_alpha
Definition: DI_CH08_1_3.h:302
ifm_o3m_uint16_t sensorWidth
Definition: DI_CH08_1_3.h:39
ifm_o3m_float32_t normaly
Definition: DI_CH08_1_3.h:578
ifm_o3m_float32_t intrCalib_2D_mx
Definition: DI_CH08_1_3.h:288
ifm_o3m_float32_t extrCalib_delta_tx
Definition: DI_CH08_1_3.h:365
ifm_o3m_float32_t rollAngle
Definition: DI_CH08_1_3.h:562
ifm_o3m_float32_t camHeight
Definition: DI_CH08_1_3.h:566
ifm_o3m_float32_t intrCalib_k5
Definition: DI_CH08_1_3.h:323
ifm_o3m_sint32_t planeValid
Definition: DI_CH08_1_3.h:552
unsigned short ifm_o3m_uint16_t
Definition: ifm_types.h:4
ifm_o3m_float32_t extrCalib_rot_y
Definition: DI_CH08_1_3.h:393
ifm_o3m_AlgoIFOutput_DIA1_1_3 * ifm_o3m_ConvertBufferToBigEndian_DIA1_1_3(void *buffer, ifm_o3m_uint32_t bufferSize)
Definition: DI_CH08_1_3.cpp:34
ifm_o3m_float32_t intrCalib_k4
Definition: DI_CH08_1_3.h:337
ifm_o3m_float32_t extrCalib_rot_x
Definition: DI_CH08_1_3.h:386
ifm_o3m_float32_t extrCalib_rot_z
Definition: DI_CH08_1_3.h:400
ifm_o3m_float32_t intrCalib_k2
Definition: DI_CH08_1_3.h:316
ifm_o3m_uint16_t sensorHeight
Definition: DI_CH08_1_3.h:46
ifm_o3m_float32_t intrCalib_2D_fx
Definition: DI_CH08_1_3.h:272
ifm_o3m_float32_t extrCalib_center_tz
Definition: DI_CH08_1_3.h:358
ifm_o3m_uint32_t masterclockTimestamp
Definition: DI_CH08_1_3.h:147
ifm_o3m_uint32_t available
Definition: DI_CH08_1_3.h:172
float ifm_o3m_float32_t
Definition: ifm_types.h:13
signed char ifm_o3m_sint8_t
Definition: ifm_types.h:2
ifm_o3m_AlgoIFOutput_DIA1_1_3 * ifm_o3m_ConvertBufferToLittleEndian_DIA1_1_3(void *buffer, ifm_o3m_uint32_t bufferSize)
Definition: DI_CH08_1_3.cpp:12
ifm_o3m_float32_t frameReprojectError
Definition: DI_CH08_1_3.h:545
ifm_o3m_float32_t intrCalib_2D_my
Definition: DI_CH08_1_3.h:295
ifm_o3m_float32_t intrCalib_k1
Definition: DI_CH08_1_3.h:309
ifm_o3m_sint32_t frameValid
Definition: DI_CH08_1_3.h:538
ifm_o3m_sint32_t calibValid
Definition: DI_CH08_1_3.h:434
ifm_o3m_uint8_t blockageAvailable
Definition: DI_CH08_1_3.h:422
ifm_o3m_uint32_t frameCounter
Definition: DI_CH08_1_3.h:154
ifm_o3m_float32_t plausibility
Definition: DI_CH08_1_3.h:589
unsigned char ifm_o3m_uint8_t
Definition: ifm_types.h:1
ifm_o3m_float32_t distanceDeviation
Definition: DI_CH08_1_3.h:593
ifm_o3m_float32_t extrCalib_delta_tz
Definition: DI_CH08_1_3.h:379
ifm_o3m_float32_t normalx
Definition: DI_CH08_1_3.h:572
ifm_o3m_uint8_t numTrianglesDetected
Definition: DI_CH08_1_3.h:510
ifm_o3m_float32_t intrCalib_k3
Definition: DI_CH08_1_3.h:330
ifm_o3m_float32_t normalz
Definition: DI_CH08_1_3.h:584
ifm_o3m_float32_t extrCalib_center_ty
Definition: DI_CH08_1_3.h:351
ifm_o3m_float32_t blockageRatio
Definition: DI_CH08_1_3.h:415
ifm_o3m_float32_t transX
Definition: DI_CH08_1_3.h:185
ifm_o3m_float32_t transZ
Definition: DI_CH08_1_3.h:206
ifm_o3m_float32_t pitchAngle
Definition: DI_CH08_1_3.h:558
ifm_o3m_float32_t transY
Definition: DI_CH08_1_3.h:196
ifm_o3m_float32_t extrCalib_center_tx
Definition: DI_CH08_1_3.h:344
ifm_o3m_sint32_t calibrationStableCounter
Definition: DI_CH08_1_3.h:438


ifm_o3mxxx
Author(s):
autogenerated on Mon Jun 10 2019 13:34:12