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

Geodetic position structure. More...

#include <convertdef.h>

Collaboration diagram for geoidpos:

Public Member Functions

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

Public Attributes

double utc = 0.
 
gvector s
 Position vector. More...
 
gvector v
 Velocity vector. More...
 
gvector a
 Acceleration vector. More...
 
uint32_t pass = 0
 pass indicator: allows synchronization with other attitude and position values. More...
 

Detailed Description

Geodetic position structure.

Structure containing 3 geodetic vectors representing position, velocity and acceleration.

See also
gvector

Member Function Documentation

json11::Json geoidpos::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
275  {
276  return json11::Json::object {
277  { "utc" , utc },
278  { "s", s },
279  { "v", v },
280  { "a", a },
281  { "pass", static_cast<int>(pass) }
282  };
283  }
std::map< std::string, Json > object
Definition: json11.hpp:88
double utc
Definition: convertdef.h:261
gvector a
Acceleration vector.
Definition: convertdef.h:267
gvector s
Position vector.
Definition: convertdef.h:263
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:269
gvector v
Velocity vector.
Definition: convertdef.h:265
void geoidpos::from_json ( const string &  js)
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
291  {
292  string error;
293  json11::Json parsed = json11::Json::parse(js,error);
294  if(error.empty()) {
295  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
296  if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
297  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
298  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
299  if(!parsed["pass"].is_null()) pass = parsed["pass"].int_value();
300  } else {
301  cerr<<"ERROR = "<<error<<endl;
302  }
303  return;
304  }
Definition: json11.hpp:79
double utc
Definition: convertdef.h:261
void dump(std::string &out) const
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
gvector a
Acceleration vector.
Definition: convertdef.h:267
gvector s
Position vector.
Definition: convertdef.h:263
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:269
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:256
gvector v
Velocity vector.
Definition: convertdef.h:265

Member Data Documentation

double geoidpos::utc = 0.
gvector geoidpos::s

Position vector.

gvector geoidpos::v

Velocity vector.

gvector geoidpos::a

Acceleration vector.

uint32_t geoidpos::pass = 0

pass indicator: allows synchronization with other attitude and position values.


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