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

Motion Capture Camera (MCC) Structure. More...

#include <jsondef.h>

Collaboration diagram for mccstruc:

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

quaternion align
 Sensor alignment quaternion. More...
 
quaternion q
 attitude More...
 
rvector o
 
rvector a
 

Detailed Description

Motion Capture Camera (MCC) Structure.

Member Function Documentation

json11::Json mccstruc::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
2998  {
2999  return json11::Json::object {
3000  { "align" , align },
3001  { "q" , q },
3002  { "o" , o },
3003  { "a" , a }
3004  };
3005  }
std::map< std::string, Json > object
Definition: json11.hpp:88
rvector a
Definition: jsondef.h:2992
quaternion q
attitude
Definition: jsondef.h:2990
rvector o
Definition: jsondef.h:2991
quaternion align
Sensor alignment quaternion.
Definition: jsondef.h:2988
void mccstruc::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
3013  {
3014  string error;
3015  json11::Json parsed = json11::Json::parse(s,error);
3016  if(error.empty()) {
3017  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
3018  if(!parsed["q"].is_null()) { q.from_json(parsed["q"].dump()); }
3019  if(!parsed["o"].is_null()) { o.from_json(parsed["o"].dump()); }
3020  if(!parsed["a"].is_null()) { a.from_json(parsed["a"].dump()); }
3021  } else {
3022  cerr<<"ERROR: <"<<error<<">"<<endl;
3023  }
3024  return;
3025  }
rvector a
Definition: jsondef.h:2992
Definition: json11.hpp:79
quaternion q
attitude
Definition: jsondef.h:2990
rvector o
Definition: jsondef.h:2991
quaternion align
Sensor alignment quaternion.
Definition: jsondef.h:2988
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:431
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80

Member Data Documentation

quaternion mccstruc::align

Sensor alignment quaternion.

quaternion mccstruc::q

attitude

rvector mccstruc::o
rvector mccstruc::a

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