0.2.0
Loading...
Searching...
No Matches
PositionInput.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
13
14#pragma once
15
16#include <cstdint>
17#include <Eigen/Core>
18#include <nlohmann/json.hpp>
19using json = nlohmann::json;
20
21#include "Navigation/Transformations/Units.hpp"
23
24namespace NAV
25{
26namespace gui::widgets
27{
28
31{
33 enum class ReferenceFrame
34 {
35 ECEF,
36 LLA,
37 COUNT,
38 };
39
43 Eigen::Vector3d e_position = trafo::lla2ecef_WGS84(Eigen::Vector3d::Zero());
44
46 [[nodiscard]] double latitude() const { return trafo::ecef2lla_WGS84(e_position)(0); }
48 [[nodiscard]] double longitude() const { return trafo::ecef2lla_WGS84(e_position)(1); }
50 [[nodiscard]] double altitude() const { return trafo::ecef2lla_WGS84(e_position)(2); }
52 [[nodiscard]] double latitude_deg() const { return trafo::ecef2lla_WGS84(e_position)(0); }
54 [[nodiscard]] double longitude_deg() const { return trafo::ecef2lla_WGS84(e_position)(1); }
55
57 [[nodiscard]] Eigen::Vector3d latLonAlt() const { return trafo::ecef2lla_WGS84(e_position); }
59 [[nodiscard]] Eigen::Vector3d latLonAlt_deg() const
60 {
61 auto lla = trafo::ecef2lla_WGS84(e_position);
62 return { rad2deg(lla(0)), rad2deg(lla(1)), lla(2) };
63 }
64};
65
77void to_json(json& j, const PositionWithFrame& position);
81void from_json(const json& j, PositionWithFrame& position);
82
85{
88 TWO_ROWS,
89};
90
97bool PositionInput(const char* str, PositionWithFrame& position, PositionInputLayout layout = PositionInputLayout::SINGLE_COLUMN, float itemWidth = 140.0F);
98
99} // namespace gui::widgets
100
105
106} // namespace NAV
Transformation collection.
void from_json(const json &j, DynamicInputPins &obj, Node *node)
Converts the provided json object into a node object.
void to_json(json &j, const DynamicInputPins &obj)
Converts the provided object into json.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
PositionInputLayout
Layout options for the Position input.
Definition PositionInput.hpp:85
@ SINGLE_ROW
All elements in a single row.
@ SINGLE_COLUMN
All elements in a single column.
bool PositionInput(const char *str, PositionWithFrame &position, PositionInputLayout layout=PositionInputLayout::SINGLE_COLUMN, float itemWidth=140.0F)
Inputs to edit an Position object.
Position with Reference frame, used for GUI input.
Definition PositionInput.hpp:31
double latitude() const
Latitude in [rad].
Definition PositionInput.hpp:46
double latitude_deg() const
Latitude in [deg].
Definition PositionInput.hpp:52
Eigen::Vector3d latLonAlt_deg() const
Latitude in [deg, deg, m].
Definition PositionInput.hpp:59
double longitude_deg() const
Longitude in [deg].
Definition PositionInput.hpp:54
Eigen::Vector3d latLonAlt() const
Latitude in [rad, rad, m].
Definition PositionInput.hpp:57
double longitude() const
Longitude in [rad].
Definition PositionInput.hpp:48
Eigen::Vector3d e_position
Position in ECEF coordinates in [m].
Definition PositionInput.hpp:43
double altitude() const
Altitude in [m].
Definition PositionInput.hpp:50
ReferenceFrame
Reference frames.
Definition PositionInput.hpp:34
ReferenceFrame frame
Reference frame used for the input, not for the storage of values.
Definition PositionInput.hpp:41