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 
48  struct Calibration
49  {
50  using Ptr = std::shared_ptr<struct Calibration>;
51  uint32_t model_id;
52  std::array<float, 32> model_parameters;
53  void
54  Read(const uint8_t* data)
55  {
56  model_id = mkval<uint32_t>(data);
57  mkarray<float, 32>(data + sizeof(uint32_t), model_parameters);
58  }
59  };
60  /*@brief Intrisnsic parameter model for the device/head*/
61  using IntrinsicCalibration = struct Calibration;
62  /*@brief Inverse intrisnsic parameter model for the device/head*/
64  } // end namespace calibration
65 
66 } // end namespace ifm3d
67 
68 #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:48