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