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