SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
position.h
Go to the documentation of this file.
1#ifndef SENSESP_TYPES_POSITION_H_
2#define SENSESP_TYPES_POSITION_H_
3
4#include <ArduinoJson.h>
5#include <limits>
6
7namespace sensesp {
8
10constexpr double kInvalidDouble = std::numeric_limits<double>::lowest();
11constexpr float kPositionInvalidAltitude = std::numeric_limits<float>::lowest();
12
30
47
55 // Ordering chosen to match the order of fields in Signal K
56 float roll;
57 float pitch;
58 float yaw; // heading
59
62 AttitudeVector(float roll, float pitch, float yaw)
63 : roll(roll), pitch(pitch), yaw(yaw) {}
64};
65
78void convertFromJson(JsonVariantConst src, Position &dst);
79void convertFromJson(JsonVariantConst src, ENUVector &dst);
80void convertFromJson(JsonVariantConst src, AttitudeVector &dst);
81
93bool canConvertFromJson(JsonVariantConst src, const Position &);
94bool canConvertFromJson(JsonVariantConst src, const ENUVector &);
95bool canConvertFromJson(JsonVariantConst src, const AttitudeVector &);
96
97void convertToJson(const Position &src, JsonVariant dst);
98void convertToJson(const ENUVector &src, JsonVariant dst);
99void convertToJson(const AttitudeVector &src, JsonVariant dst);
100
101} // namespace sensesp
102
103#endif // SENSESP_TYPES_POSITION_H_
void convertToJson(const Nullable< T > &src, JsonVariant dst)
Definition nullable.h:67
constexpr double kInvalidDouble
Value used to indicate an invalid or missing altitude.
Definition position.h:10
bool canConvertFromJson(JsonVariantConst src, const Position &)
Tells ArduinoJson whether the given JSON is a Position or not.
Definition position.cpp:31
constexpr float kPositionInvalidAltitude
Definition position.h:11
void convertFromJson(JsonVariantConst src, Nullable< T > &dst)
Definition nullable.h:58
Container for attitude data.
Definition position.h:54
AttitudeVector(float roll, float pitch, float yaw)
Definition position.h:62
Container for local tangent plane coordinates.
Definition position.h:38
ENUVector(float east, float north, float up=kPositionInvalidAltitude)
Definition position.h:44
Position data container.
Definition position.h:20
Position(double latitude, double longitude, float altitude=kPositionInvalidAltitude)
Definition position.h:26