3#include "ArduinoJson.h"
8 dst.
longitude = src[
"longitude"].as<
double>();
9 dst.
latitude = src[
"latitude"].as<
double>();
11 if (src[
"altitude"].is<float>()) {
12 dst.
altitude = src[
"altitude"].as<
float>();
17 dst.
east = src[
"east"].as<
float>();
18 dst.
north = src[
"north"].as<
float>();
20 if (src[
"up"].is<float>()) {
21 dst.
up = src[
"up"].as<
float>();
26 dst.
roll = src[
"roll"].as<
float>();
27 dst.
pitch = src[
"pitch"].as<
float>();
28 dst.
yaw = src[
"yaw"].as<
float>();
32 return src[
"latitude"].is<
double>() && src[
"longitude"].is<double>();
36 return src[
"east"].is<
double>() && src[
"north"].is<double>();
41 return src[
"roll"].is<
float>() && src[
"pitch"].is<float>() &&
42 src[
"yaw"].is<
float>();
46 JsonObject obj = dst.to<JsonObject>();
56 JsonObject obj = dst.to<JsonObject>();
57 obj[
"east"] = src.
east;
58 obj[
"north"] = src.
north;
66 JsonObject obj = dst.to<JsonObject>();
67 obj[
"roll"] = src.
roll;
68 obj[
"pitch"] = src.
pitch;
void convertToJson(const Nullable< T > &src, JsonVariant dst)
bool canConvertFromJson(JsonVariantConst src, const Position &)
Tells ArduinoJson whether the given JSON is a Position or not.
constexpr float kPositionInvalidAltitude
void convertFromJson(JsonVariantConst src, Nullable< T > &dst)
Container for attitude data.
Container for local tangent plane coordinates.