INSTINCT Code Coverage Report


Directory: src/
File: NodeData/IMU/ImuPos.hpp
Date: 2025-06-02 15:19:59
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 3 3 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // This file is part of INSTINCT, the INS Toolkit for Integrated
2 // Navigation Concepts and Training by the Institute of Navigation of
3 // the University of Stuttgart, Germany.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9 /// @file ImuPos.hpp
10 /// @brief Imu Position Data
11 /// @author T. Topp (topp@ins.uni-stuttgart.de)
12 /// @date 2020-09-11
13
14 #pragma once
15
16 #include "util/Eigen.hpp"
17
18 namespace NAV
19 {
20 // Forward declarations
21 class Imu;
22 class MultiImuFile;
23
24 /// IMU Position
25 class ImuPos
26 {
27 public:
28 /// IMU position in body frame coordinates in [m]
29 26813 [[nodiscard]] const Eigen::Vector3d& b_positionIMU_p() const
30 {
31 26813 return _b_positionIMU_p;
32 }
33
34 /// Quaternion from IMU platform frame to body frame
35 328368 [[nodiscard]] const Eigen::Quaterniond& b_quat_p() const
36 {
37 328368 return _b_quat_p;
38 }
39 /// Quaternion from body frame to IMU platform frame
40 5721067 [[nodiscard]] Eigen::Quaterniond p_quat_b() const
41 {
42 5721067 return _b_quat_p.conjugate();
43 }
44
45 private:
46 /// IMU position in body frame coordinates in [m]
47 Eigen::Vector3d _b_positionIMU_p = Eigen::Vector3d::Zero();
48
49 /// Quaternion from IMU platform frame to body frame
50 Eigen::Quaterniond _b_quat_p = Eigen::Quaterniond::Identity();
51
52 friend class Imu;
53 friend class MultiImuFile;
54 friend void from_json(const json& j, ImuPos& pos);
55 };
56
57 /// @brief Write info to a json object
58 /// @param[out] j Json output
59 /// @param[in] pos Object to read info from
60 void to_json(json& j, const ImuPos& pos);
61 /// @brief Read info from a json object
62 /// @param[in] j Json variable to read info from
63 /// @param[out] pos Output object
64 void from_json(const json& j, ImuPos& pos);
65
66 } // namespace NAV
67