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

Inertial Measurement Unit (IMU) structure. More...

#include <jsondef.h>

Collaboration diagram for imustruc:

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
 alignment quaternion More...
 
rvector accel
 Position acceleration vector. More...
 
quaternion theta
 Attitude quaternion. More...
 
avector euler
 Attitude Euler angles. More...
 
rvector omega
 Attitude rate vector. More...
 
rvector alpha
 Attitude acceleration vector. More...
 
rvector mag
 Magnetic field in sensor frame. More...
 
rvector bdot
 Magnetic field rate change in sensor frame. More...
 

Detailed Description

Inertial Measurement Unit (IMU) structure.

Member Function Documentation

json11::Json imustruc::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
1881  {
1882  return json11::Json::object {
1883  { "align" , align },
1884  { "accel" , accel },
1885  { "theta" , theta },
1886  { "euler" , euler },
1887  { "omega" , omega },
1888  { "alpha" , alpha },
1889  { "mag" , mag },
1890  { "bdot" , bdot }
1891  };
1892  }
std::map< std::string, Json > object
Definition: json11.hpp:88
rvector mag
Magnetic field in sensor frame.
Definition: jsondef.h:1873
rvector omega
Attitude rate vector.
Definition: jsondef.h:1869
avector euler
Attitude Euler angles.
Definition: jsondef.h:1867
quaternion align
alignment quaternion
Definition: jsondef.h:1861
rvector bdot
Magnetic field rate change in sensor frame.
Definition: jsondef.h:1875
quaternion theta
Attitude quaternion.
Definition: jsondef.h:1865
rvector accel
Position acceleration vector.
Definition: jsondef.h:1863
rvector alpha
Attitude acceleration vector.
Definition: jsondef.h:1871
void imustruc::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
1900  {
1901  string error;
1902  json11::Json parsed = json11::Json::parse(s,error);
1903  if(error.empty()) {
1904  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
1905  if(!parsed["accel"].is_null()) { accel.from_json(parsed["accel"].dump()); }
1906  if(!parsed["theta"].is_null()) { theta.from_json(parsed["theta"].dump()); }
1907  if(!parsed["euler"].is_null()) { euler.from_json(parsed["euler"].dump()); }
1908  if(!parsed["omega"].is_null()) { omega.from_json(parsed["omega"].dump()); }
1909  if(!parsed["alpha"].is_null()) { alpha.from_json(parsed["alpha"].dump()); }
1910  if(!parsed["mag"].is_null()) { mag.from_json(parsed["mag"].dump()); }
1911  if(!parsed["bdot"].is_null()) { bdot.from_json(parsed["bdot"].dump()); }
1912  } else {
1913  cerr<<"ERROR: <"<<error<<">"<<endl;
1914  }
1915  return;
1916  }
Definition: json11.hpp:79
rvector mag
Magnetic field in sensor frame.
Definition: jsondef.h:1873
rvector omega
Attitude rate vector.
Definition: jsondef.h:1869
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:311
avector euler
Attitude Euler angles.
Definition: jsondef.h:1867
quaternion align
alignment quaternion
Definition: jsondef.h:1861
rvector bdot
Magnetic field rate change in sensor frame.
Definition: jsondef.h:1875
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
quaternion theta
Attitude quaternion.
Definition: jsondef.h:1865
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:431
rvector accel
Position acceleration vector.
Definition: jsondef.h:1863
rvector alpha
Attitude acceleration vector.
Definition: jsondef.h:1871
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80

Member Data Documentation

quaternion imustruc::align

alignment quaternion

rvector imustruc::accel

Position acceleration vector.

quaternion imustruc::theta

Attitude quaternion.

avector imustruc::euler

Attitude Euler angles.

rvector imustruc::omega

Attitude rate vector.

rvector imustruc::alpha

Attitude acceleration vector.

rvector imustruc::mag

Magnetic field in sensor frame.

rvector imustruc::bdot

Magnetic field rate change in sensor frame.


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