ifm3d
struct_calibration.hpp
1 // -*- c++ -*-
2 /*
3  * Copyright 2022-present ifm electronic, gmbh
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef IFM3D_DESERIALIZE_STRUCT_CALIBRATION_HPP
8 #define IFM3D_DESERIALIZE_STRUCT_CALIBRATION_HPP
9 
10 #include <array>
11 #include <chrono>
12 #include <ifm3d/deserialize/deserialize_utils.hpp>
13 
14 namespace ifm3d
15 {
16  namespace calibration
17  {
25  {
26  using Ptr = std::shared_ptr<struct ExtrinsicOpticToUser>;
27  float trans_x; // value in meter
28  float trans_y; // value in meter
29  float trans_z; // value in meter
30  float rot_x; // value in radians
31  float rot_y; // value in radians
32  float rot_z; // value in radians
33 
34  void
35  Read(const uint8_t* data)
36  {
37  trans_x = mkval<float>(data + sizeof(float) * 0);
38  trans_y = mkval<float>(data + sizeof(float) * 1);
39  trans_z = mkval<float>(data + sizeof(float) * 2);
40  rot_x = mkval<float>(data + sizeof(float) * 3);
41  rot_y = mkval<float>(data + sizeof(float) * 4);
42  rot_z = mkval<float>(data + sizeof(float) * 5);
43  }
44  };
46 
61  struct Calibration
62  {
63  using Ptr = std::shared_ptr<struct Calibration>;
64  uint32_t model_id;
65  std::array<float, 32> model_parameters;
66  void
67  Read(const uint8_t* data)
68  {
69  model_id = mkval<uint32_t>(data);
70  mkarray<float, 32>(data + sizeof(uint32_t), model_parameters);
71  }
72  };
73  /*@brief Intrisnsic parameter model for the device/head*/
74  using IntrinsicCalibration = struct Calibration;
75  /*@brief Inverse intrisnsic parameter model for the device/head*/
77  } // end namespace calibration
78 
79 } // end namespace ifm3d
80 
81 #endif // IFM3D_DESERIALIZE_STRUCT_CALIBRATION_HPP
ifm3d::calibration::ExtrinsicOpticToUser
All items are given in SI units, i.e. transXYZ are in [m] and rotXYZ are in [rad].
Definition: struct_calibration.hpp:24
ifm3d::calibration::Calibration
Definition: struct_calibration.hpp:61