0.4.1
Loading...
Searching...
No Matches
ImuPos.hpp
Go to the documentation of this file.
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
18namespace NAV
19{
20// Forward declarations
21class Imu;
22class MultiImuFile;
23
24/// IMU Position
25class ImuPos
26{
27 public:
28 /// IMU position in body frame coordinates in [m]
29 [[nodiscard]] const Eigen::Vector3d& b_positionIMU_p() const
30 {
31 return _b_positionIMU_p;
32 }
33
34 /// Quaternion from IMU platform frame to body frame
35 [[nodiscard]] const Eigen::Quaterniond& b_quat_p() const
36 {
37 return _b_quat_p;
38 }
39 /// Quaternion from body frame to IMU platform frame
40 [[nodiscard]] Eigen::Quaterniond p_quat_b() const
41 {
42 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
60void 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
64void from_json(const json& j, ImuPos& pos);
65
66} // namespace NAV
Vector space operations.
nlohmann::json json
json namespace
IMU Position.
Definition ImuPos.hpp:26
const Eigen::Vector3d & b_positionIMU_p() const
IMU position in body frame coordinates in [m].
Definition ImuPos.hpp:29
friend void from_json(const json &j, ImuPos &pos)
Read info from a json object.
Definition ImuPos.cpp:23
Eigen::Quaterniond p_quat_b() const
Quaternion from body frame to IMU platform frame.
Definition ImuPos.hpp:40
Eigen::Quaterniond _b_quat_p
Quaternion from IMU platform frame to body frame.
Definition ImuPos.hpp:50
Eigen::Vector3d _b_positionIMU_p
IMU position in body frame coordinates in [m].
Definition ImuPos.hpp:47
const Eigen::Quaterniond & b_quat_p() const
Quaternion from IMU platform frame to body frame.
Definition ImuPos.hpp:35
friend class Imu
Definition ImuPos.hpp:52
friend class MultiImuFile
Definition ImuPos.hpp:53
Abstract IMU Class.
Definition Imu.hpp:24
File reader for Multi-IMU data log files.
void to_json(json &j, const Node &node)
Converts the provided node into a json object.
Definition Node.cpp:990
void from_json(const json &j, Node &node)
Converts the provided json object into a node object.
Definition Node.cpp:1007