ifm3d
deserialize_o3d_buffers.hpp
1 // -*- c++ -*-
2 /*
3  * Copyright 2023-present ifm electronic, gmbh
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef IFM3D_DESERIALIZE_O3D_BUFFERS_HPP
8 #define IFM3D_DESERIALIZE_O3D_BUFFERS_HPP
9 
10 #include <ifm3d/device/err.h>
11 #include <ifm3d/fg/organizer_utils.h>
12 #include <ifm3d/fg/buffer.h>
13 #include <ifm3d/deserialize/deserialize_utils.hpp>
14 
15 namespace ifm3d
16 {
17  // intrinsic param key which cahn be used for indexing the vector of the
18  // intrinsic parameter
19  enum class intrinsic_param : std::uint32_t
20  {
21  F_X = 0, // Focal length of the camera in the sensor's x axis direction.
22  F_Y = 1, // Focal length of the camera in the sensor's y axis direction.
23  M_X = 2, // Main point in the sensor's x direction
24  M_Y = 3, // Main point in the sensor's x direction
25  ALPHA = 4, // Skew parameter
26  K1 = 5, // First radial distortion coefficient
27  K2 = 6, // Second radial distortion coefficient
28  K5 = 7, // Third radial distortion coefficient
29  K3 = 8, // First tangential distortion coefficient
30  K4 = 9, // Second tangential distortion coefficient
31  TRANS_X = 10, // Translation along x-direction in meters.
32  TRANS_Y = 11, // Translation along y-direction in meters.
33  TRANS_Z = 12, // Translation along Z-direction in meters.
34  ROT_X = 13, // Rotation along x-axis in radians. Positive values indicate
35  // clockwise rotation.
36  ROT_Y = 14, // Rotation along y-axis in radians. Positive values indicate
37  // clockwise rotation.
38  ROT_Z = 15 // Rotation along z-axis in radians. Positive values indicate
39  // clockwise rotation.
40  };
41 
42  namespace
43  {
44  constexpr auto O3D_NUMBER_OF_INTRINSIC_CALIBRATION_PARAM = 16;
45  constexpr auto O3D_NUMBER_OF_INVERSE_INTRINSIC_CALIBRATION_PARAM =
46  O3D_NUMBER_OF_INTRINSIC_CALIBRATION_PARAM;
47  constexpr auto O3D_NUMBER_OF_EXTRINSIC_PARAM = 6;
48  constexpr auto O3D_NUMBER_OF_EXPOSURE_TIMES = 3;
49  constexpr auto O3D_ILLU_TEMP_VALUES = 1;
50  }
51 
58  ArrayDeserialize<float, O3D_NUMBER_OF_INTRINSIC_CALIBRATION_PARAM>;
59 
67  ArrayDeserialize<float, O3D_NUMBER_OF_INVERSE_INTRINSIC_CALIBRATION_PARAM>;
68 
75  ArrayDeserialize<float, O3D_NUMBER_OF_EXTRINSIC_PARAM>;
76 
82  using O3DExposureTimes =
83  ArrayDeserialize<uint32_t, O3D_NUMBER_OF_EXPOSURE_TIMES>;
84 
90  using O3DILLUTemperature = ArrayDeserialize<float, O3D_ILLU_TEMP_VALUES>;
91 
92 } // end namespace ifm3d
93 
94 #endif // IFM3D_DESERIALIZE_O3D_BUFFERS_HPP
O3DILLUTemperature
O3DExtrinsicCalibration
O3DInverseInstrinsicCalibration
O3DExposureTimes
O3DInstrinsicCalibration