COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
gpsstruc Struct Reference

#include <jsondef.h>

Collaboration diagram for gpsstruc:

Public Member Functions

json11::Json to_json () const
 Convert class contents to JSON object. More...
 
void from_json (const string &s)
 Set class contents from JSON string. More...
 

Public Attributes

double dutc = 0.
 UTC time error. More...
 
rvector geocs
 
rvector geocv
 Geocentric velocity: x, y, z. More...
 
rvector dgeocs
 Geocentric position error: x, y, z. More...
 
rvector dgeocv
 Geocentric velocity error: x, y, z. More...
 
gvector geods
 Geodetic position: longitude, latitude, altitude. More...
 
gvector geodv
 Geodetic velocity: longitude, latitude, altitude. More...
 
gvector dgeods
 Geodetic position error: longitude, latitude, altitude. More...
 
gvector dgeodv
 Geodetic velocity error: longitude, latitude, altitude. More...
 
float heading = 0.f
 GPS heading. More...
 
uint16_t sats_used = 0
 number of satellites used by GPS receiver More...
 
uint16_t sats_visible = 0
 number of satellites visible by GPS receiver More...
 
uint16_t time_status = 0
 Time Status. More...
 
uint16_t position_type = 0
 Position Type. More...
 
uint16_t solution_status = 0
 Solution Status. More...
 

Member Function Documentation

json11::Json gpsstruc::to_json ( ) const
inline

Convert class contents to JSON object.

Returns a json11 JSON object of the class

Returns
A json11 JSON object containing every member variable within the class
2196  {
2197  return json11::Json::object {
2198  { "dutc" , dutc },
2199  { "geocs" , geocs },
2200  { "geocv" , geocv },
2201  { "dgeocs" , dgeocs },
2202  { "dgeocv" , dgeocv },
2203  { "geods" , geods },
2204  { "geodv" , geodv },
2205  { "dgeods" , dgeods },
2206  { "dgeodv" , dgeodv },
2207  { "heading", heading },
2208  { "sats_used" , sats_used },
2209  { "sats_visible" , sats_visible },
2210  { "time_status" , time_status },
2211  { "position_type", position_type },
2212  { "solution_status", solution_status }
2213  };
2214  }
uint16_t time_status
Time Status.
Definition: jsondef.h:2186
std::map< std::string, Json > object
Definition: json11.hpp:88
rvector dgeocs
Geocentric position error: x, y, z.
Definition: jsondef.h:2168
uint16_t position_type
Position Type.
Definition: jsondef.h:2188
float heading
GPS heading.
Definition: jsondef.h:2180
rvector dgeocv
Geocentric velocity error: x, y, z.
Definition: jsondef.h:2170
rvector geocs
Definition: jsondef.h:2164
gvector geods
Geodetic position: longitude, latitude, altitude.
Definition: jsondef.h:2172
rvector geocv
Geocentric velocity: x, y, z.
Definition: jsondef.h:2166
gvector dgeods
Geodetic position error: longitude, latitude, altitude.
Definition: jsondef.h:2176
uint16_t sats_visible
number of satellites visible by GPS receiver
Definition: jsondef.h:2184
uint16_t sats_used
number of satellites used by GPS receiver
Definition: jsondef.h:2182
gvector geodv
Geodetic velocity: longitude, latitude, altitude.
Definition: jsondef.h:2174
double dutc
UTC time error.
Definition: jsondef.h:2160
uint16_t solution_status
Solution Status.
Definition: jsondef.h:2190
gvector dgeodv
Geodetic velocity error: longitude, latitude, altitude.
Definition: jsondef.h:2178
void gpsstruc::from_json ( const string &  s)
inline

Set class contents from JSON string.

Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()

Parameters
sJSON-formatted string to set class contents to
Returns
n/a
2222  {
2223  string error;
2224  json11::Json parsed = json11::Json::parse(s,error);
2225  if(error.empty()) {
2226  if(!parsed["dutc"].is_null()) { dutc = parsed["dutc"].number_value(); }
2227  if(!parsed["geocs"].is_null()) { geocs.from_json(parsed["geocs"].dump()); }
2228  if(!parsed["geocv"].is_null()) { geocv.from_json(parsed["geocv"].dump()); }
2229  if(!parsed["dgeocs"].is_null()) { dgeocs.from_json(parsed["dgeocs"].dump()); }
2230  if(!parsed["dgeocv"].is_null()) { dgeocv.from_json(parsed["dgeocv"].dump()); }
2231  if(!parsed["geods"].is_null()) { geods.from_json(parsed["geods"].dump()); }
2232  if(!parsed["geodv"].is_null()) { geodv.from_json(parsed["geodv"].dump()); }
2233  if(!parsed["dgeods"].is_null()) { dgeods.from_json(parsed["dgeods"].dump()); }
2234  if(!parsed["dgeodv"].is_null()) { dgeodv.from_json(parsed["dgeodv"].dump()); }
2235  if(!parsed["heading"].is_null()) { heading = parsed["heading"].number_value(); }
2236  if(!parsed["sats_used"].is_null()) { sats_used = parsed["sats_used"].int_value(); }
2237  if(!parsed["sats_visible"].is_null()) { sats_visible = parsed["sats_visible"].int_value(); }
2238  if(!parsed["time_status"].is_null()) { time_status = parsed["time_status"].int_value(); }
2239  if(!parsed["position_type"].is_null()) { position_type = parsed["position_type"].int_value(); }
2240  if(!parsed["solution_status"].is_null()) { solution_status = parsed["solution_status"].int_value(); }
2241  } else {
2242  cerr<<"ERROR: <"<<error<<">"<<endl;
2243  }
2244  return;
2245  }
uint16_t time_status
Time Status.
Definition: jsondef.h:2186
Definition: json11.hpp:79
rvector dgeocs
Geocentric position error: x, y, z.
Definition: jsondef.h:2168
uint16_t position_type
Position Type.
Definition: jsondef.h:2188
float heading
GPS heading.
Definition: jsondef.h:2180
rvector dgeocv
Geocentric velocity error: x, y, z.
Definition: jsondef.h:2170
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
rvector geocs
Definition: jsondef.h:2164
gvector geods
Geodetic position: longitude, latitude, altitude.
Definition: jsondef.h:2172
rvector geocv
Geocentric velocity: x, y, z.
Definition: jsondef.h:2166
gvector dgeods
Geodetic position error: longitude, latitude, altitude.
Definition: jsondef.h:2176
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80
uint16_t sats_visible
number of satellites visible by GPS receiver
Definition: jsondef.h:2184
uint16_t sats_used
number of satellites used by GPS receiver
Definition: jsondef.h:2182
gvector geodv
Geodetic velocity: longitude, latitude, altitude.
Definition: jsondef.h:2174
double dutc
UTC time error.
Definition: jsondef.h:2160
uint16_t solution_status
Solution Status.
Definition: jsondef.h:2190
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:256
int int_value() const
Definition: json11.cpp:281
gvector dgeodv
Geodetic velocity error: longitude, latitude, altitude.
Definition: jsondef.h:2178
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

double gpsstruc::dutc = 0.

UTC time error.

rvector gpsstruc::geocs

Geocentric position: x, y, z ECEF coordinates

rvector gpsstruc::geocv

Geocentric velocity: x, y, z.

rvector gpsstruc::dgeocs

Geocentric position error: x, y, z.

rvector gpsstruc::dgeocv

Geocentric velocity error: x, y, z.

gvector gpsstruc::geods

Geodetic position: longitude, latitude, altitude.

gvector gpsstruc::geodv

Geodetic velocity: longitude, latitude, altitude.

gvector gpsstruc::dgeods

Geodetic position error: longitude, latitude, altitude.

gvector gpsstruc::dgeodv

Geodetic velocity error: longitude, latitude, altitude.

float gpsstruc::heading = 0.f

GPS heading.

uint16_t gpsstruc::sats_used = 0

number of satellites used by GPS receiver

uint16_t gpsstruc::sats_visible = 0

number of satellites visible by GPS receiver

uint16_t gpsstruc::time_status = 0

Time Status.

uint16_t gpsstruc::position_type = 0

Position Type.

uint16_t gpsstruc::solution_status = 0

Solution Status.


The documentation for this struct was generated from the following file: