0.3.0
Loading...
Searching...
No Matches
ImuPos.cpp
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#include "ImuPos.hpp"
10
11#include <nlohmann/json.hpp>
12using json = nlohmann::json; ///< json namespace
13
14namespace NAV
15{
16void to_json(json& j, const ImuPos& pos)
17{
18 j = json{
19 { "b_positionIMU_p", pos.b_positionIMU_p() },
20 { "b_quat_p", pos.b_quat_p().coeffs() },
21 };
22}
23void from_json(const json& j, ImuPos& pos)
24{
25 if (j.contains("b_positionIMU_p"))
26 {
27 j.at("b_positionIMU_p").get_to(pos._b_positionIMU_p);
28 }
29 if (j.contains("b_quat_p"))
30 {
31 j.at("b_quat_p").get_to(pos._b_quat_p.coeffs());
32 }
33}
34
35} // namespace NAV
nlohmann::json json
json namespace
Imu Position Data.
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
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
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