Spacecraft Models Package 2.0
Spacecraft Models for DSim
Public Member Functions | List of all members
rigid_body_rwa Class Reference

Rigid body with multiple reaction wheels. More...

#include <rigid_body_rwa.h>

Inherits dsim_model.

Public Member Functions

void initialize_data ()
 Initialize outlets and output variables.
 
void initialization_complete ()
 Finish initialization.
 
void initialize_timestep ()
 Computation done prior to numerical integration.
 
void rhs (double t, double jd)
 Computation done during numerical integration. More...
 
void complete_timestep ()
 Computation done after numerical integration.
 
dsim_value handle_message (const std::string &sender_path, const std::string &message_name, const dsim_value &argument)
 Handle force and torque messages. More...
 

Protected Attributes

Integrated States
dsim_variable position_dsim
 object position
 
dsim_variable velocity_dsim
 object velocity
 
dsim_variable quaternion_dsim
 attitude quaternion ([scalar;x;y;z])
 
dsim_variable bodyRate_dsim
 body rotational rates (rad/s)
 
dsim_variable rWARate_dsim
 Reaction wheel rates.
 
Parameters
dsim_variable spacecraft_name_dsim
 Spacecraft name.
 
dsim_variable spacecraft_type_dsim
 Spacecraft type.
 
dsim_variable inertiaRWA_dsim
 Wheel polar inertia.
 
dsim_variable unitVectorRWA_dsim
 Wheel unit vectors.
 
dsim_variable mass_dsim
 dry mass (kg)
 
dsim_variable centerOfMass_dsim
 object center of mass
 
dsim_variable inertia_dsim
 rigid body inertia
 
dsim_variable frame_dsim
 frame for initial conditions
 

Outputs

dsim_variable totalMass_dsim
 total mass, including mass of children
 
dsim_variable ang_momentum_dsim
 Angular momentum.
 
dsim_variable acceleration_dsim
 object linear acceleration in body frame
 
dsim_variable angular_acceleration_dsim
 Angular acceleration.
 
double get_adj_mass ()
 Add up the mass of any children that have a mass variable. More...
 

Detailed Description

Rigid body with multiple reaction wheels.

Models a spacecraft with a set of identical reaction wheels. The default wheel set is orthogonal + skew (4 wheels). The torque must be provide by a child model. The model accepts apply_force, apply_torque, and apply_rwa_torque messages during rhs().

Member Function Documentation

◆ rhs()

void rigid_body_rwa::rhs ( double  t,
double  jd 
)

Computation done during numerical integration.

Quaternion kinematics and orbit derivative with wheels dynamics.

Uses qi_to_b_dot from the SCControl framework. Overwrites rigid_body's rhs without calling it.

References acceleration_dsim, angular_acceleration_dsim, bodyRate_dsim, get_adj_mass(), position_dsim, quaternion_dsim, rWARate_dsim, totalMass_dsim, and velocity_dsim.

◆ handle_message()

dsim_value rigid_body_rwa::handle_message ( const std::string &  sender_path,
const std::string &  message_name,
const dsim_value &  argument 
)

Handle force and torque messages.

Handles these message:

  • "apply_force"
  • "apply_torque"
  • "apply_rwa_torque"

◆ get_adj_mass()

double rigid_body_rwa::get_adj_mass ( )
protected

Add up the mass of any children that have a mass variable.

Store the new mass and reset the changed mass flag.


The documentation for this class was generated from the following files: