| 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 | #include "ImuPos.hpp" | ||
| 10 | |||
| 11 | #include <nlohmann/json.hpp> | ||
| 12 | using json = nlohmann::json; ///< json namespace | ||
| 13 | |||
| 14 | namespace NAV | ||
| 15 | { | ||
| 16 | ✗ | void 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 | ✗ | } | |
| 23 | 64 | void from_json(const json& j, ImuPos& pos) | |
| 24 | { | ||
| 25 |
2/2✓ Branch 1 taken 33 times.
✓ Branch 2 taken 31 times.
|
64 | if (j.contains("b_positionIMU_p")) |
| 26 | { | ||
| 27 | 33 | j.at("b_positionIMU_p").get_to(pos._b_positionIMU_p); | |
| 28 | } | ||
| 29 |
2/2✓ Branch 1 taken 33 times.
✓ Branch 2 taken 31 times.
|
64 | if (j.contains("b_quat_p")) |
| 30 | { | ||
| 31 | 33 | j.at("b_quat_p").get_to(pos._b_quat_p.coeffs()); | |
| 32 | } | ||
| 33 | 64 | } | |
| 34 | |||
| 35 | } // namespace NAV | ||
| 36 |