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

Reaction Wheel structure: z axis is aligned with axis of rotation. More...

#include <jsondef.h>

Collaboration diagram for rwstruc:

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
 Rotates vectors from RW frame (axis of rotation = z) to body frame. More...
 
rvector mom
 Moments of inertia in RW frame. More...
 
float mxomg = 0.f
 Maximum omega in radians/second. More...
 
float mxalp = 0.f
 Maximum alpha in radians/second/second. More...
 
float tc = 0.f
 Acceleration Time Constant. More...
 
float omg = 0.f
 Current angular velocity. More...
 
float alp = 0.f
 Current angular acceleration. More...
 
float romg = 0.f
 Requested angular velocity. More...
 
float ralp = 0.f
 Requested angular acceleration. More...
 

Detailed Description

Reaction Wheel structure: z axis is aligned with axis of rotation.

Member Function Documentation

json11::Json rwstruc::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
1945  {
1946  return json11::Json::object {
1947  { "align" , align },
1948  { "mom" , mom },
1949  { "mxomg" , mxomg },
1950  { "mxalp" , mxalp },
1951  { "tc" , tc },
1952  { "omg" , omg },
1953  { "alp" , alp },
1954  { "romg" , romg },
1955  { "ralp" , ralp },
1956  };
1957  }
quaternion align
Rotates vectors from RW frame (axis of rotation = z) to body frame.
Definition: jsondef.h:1923
std::map< std::string, Json > object
Definition: json11.hpp:88
float omg
Current angular velocity.
Definition: jsondef.h:1933
float mxalp
Maximum alpha in radians/second/second.
Definition: jsondef.h:1929
float mxomg
Maximum omega in radians/second.
Definition: jsondef.h:1927
float romg
Requested angular velocity.
Definition: jsondef.h:1937
rvector mom
Moments of inertia in RW frame.
Definition: jsondef.h:1925
float alp
Current angular acceleration.
Definition: jsondef.h:1935
float ralp
Requested angular acceleration.
Definition: jsondef.h:1939
float tc
Acceleration Time Constant.
Definition: jsondef.h:1931
void rwstruc::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
1965  {
1966  string error;
1967  json11::Json parsed = json11::Json::parse(s,error);
1968  if(error.empty()) {
1969  if(!parsed["align"].is_null()) { align.from_json(parsed["align"].dump()); }
1970  if(!parsed["mom"].is_null()) { mom.from_json(parsed["mom"].dump()); }
1971  if(!parsed["mxomg"].is_null()) { mxomg = parsed["mxomg"].number_value(); }
1972  if(!parsed["bdmxalpot"].is_null()) { mxalp = parsed["mxalp"].number_value(); }
1973  if(!parsed["tc"].is_null()) { tc = parsed["tc"].number_value(); }
1974  if(!parsed["omg"].is_null()) { omg = parsed["omg"].number_value(); }
1975  if(!parsed["alp"].is_null()) { alp = parsed["alp"].number_value(); }
1976  if(!parsed["romg"].is_null()) { romg = parsed["romg"].number_value(); }
1977  if(!parsed["ralp"].is_null()) { ralp = parsed["ralp"].number_value(); }
1978  } else {
1979  cerr<<"ERROR: <"<<error<<">"<<endl;
1980  }
1981  return;
1982  }
quaternion align
Rotates vectors from RW frame (axis of rotation = z) to body frame.
Definition: jsondef.h:1923
Definition: json11.hpp:79
float omg
Current angular velocity.
Definition: jsondef.h:1933
float mxalp
Maximum alpha in radians/second/second.
Definition: jsondef.h:1929
float mxomg
Maximum omega in radians/second.
Definition: jsondef.h:1927
float romg
Requested angular velocity.
Definition: jsondef.h:1937
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
rvector mom
Moments of inertia in RW frame.
Definition: jsondef.h:1925
float alp
Current angular acceleration.
Definition: jsondef.h:1935
float ralp
Requested angular acceleration.
Definition: jsondef.h:1939
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80
float tc
Acceleration Time Constant.
Definition: jsondef.h:1931
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

quaternion rwstruc::align

Rotates vectors from RW frame (axis of rotation = z) to body frame.

rvector rwstruc::mom

Moments of inertia in RW frame.

float rwstruc::mxomg = 0.f

Maximum omega in radians/second.

float rwstruc::mxalp = 0.f

Maximum alpha in radians/second/second.

float rwstruc::tc = 0.f

Acceleration Time Constant.

float rwstruc::omg = 0.f

Current angular velocity.

float rwstruc::alp = 0.f

Current angular acceleration.

float rwstruc::romg = 0.f

Requested angular velocity.

float rwstruc::ralp = 0.f

Requested angular acceleration.


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