AerospacePackage 1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rigid_body_assembly Class Reference

Multi-stage rigid body model. More...

#include <rigid_body_assembly.h>

Inherits dsim_model.

Public Member Functions

 rigid_body_assembly (dsim_model_setup *setup)
 Constructor.
 
 ~rigid_body_assembly ()
 Destructor.
 
void initialize_data ()
 Initialize outlets and output variables.
 
void initialization_complete ()
 Finish initialization.
 
void initialize_timestep ()
 Computation done prior to numerical integration.
 
void complete_timestep ()
 Computation done after numerical integration.
 
void rhs (double t, double jd)
 Computation done during numerical integration. More...
 
dsim_value handle_message (const std::string &sender_path, const std::string &message_name, const dsim_value &argument)
 Handle force and torque messages. More...
 
void * describe_setup (void *ds)
 Describe the setup function.
 
bool parse_setup (const char *command, const char *data)
 Parse the setup. More...
 
void pre_calculate ()
 Computation done before rhs is called.
 

Protected Member Functions

double get_adj_mass ()
 Check for changed mass of children and recompute new adjusted mass. More...
 
ml_matrix get_adj_center_of_mass ()
 Recompute new adjusted center of mass. More...
 
ml_matrix get_adj_inertia ()
 Recompute new adjusted inertia matrix. More...
 
ml_matrix get_adj_inertia_derivative ()
 Recompute new adjusted inertia derivative. More...
 
double get_adj_mass_derivative ()
 Recompute new adjusted mass derivative. More...
 
ml_matrix get_adj_center_of_mass_derivative ()
 Recompute the derivative of the center of mass. More...
 
ml_matrix get_jet_damping ()
 Compute the jet damping vector. More...
 

Protected Attributes

dsim_variable spacecraft_name_dsim
 Spacecraft name.
 
dsim_variable spacecraft_type_dsim
 Spacecraft type.
 
ml_matrix force
 The external force on the spacecraft.
 
ml_matrix torque
 The external torque on the spacecraft.
 
dsim_variable totalMass_dsim
 total mass, including mass of children
 
dsim_variable center_of_mass_dsim
 Center of mass of combined stages and children.
 
dsim_variable accelTranslational_dsim
 Linear acceleration in body frame.
 
dsim_variable accelAngular_dsim
 Angular acceleration in body frame.
 
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 inertia_dsim
 inertia about the center of mass (kg-m2)
 
dsim_variable mass_derivative_dsim
 Mass derivative of connected stages.
 
dsim_variable inertia_derivative_dsim
 Moment of inertia derivative of combined stages.
 
dsim_variable center_of_mass_derivative_dsim
 Center of mass derivative of combined stages.
 
dsim_variable frame_dsim
 frame for initial conditions
 
dsim_variable ang_momentum_dsim
 Angular momentum.
 
dsim_variable angular_acceleration_dsim
 Angular acceleration.
 
dsim_variable parent_com_dsim
 Center of mass of parent.
 
dsim_variable parent_q_eci_to_body_dsim
 Quaternion of the parent.
 
dsim_variable parent_position_dsim
 Position of the parent.
 
std::string parent_path
 Path of the parent.
 
dsim_variable stagingCommand_dsim
 Staging command.
 
dsim_variable torque_out_dsim
 torque
 
std::string componentList [100]
 List of the components of the assembly.
 
ml_matrix connectionVector
 Stage connections.
 
int nComponents
 Number of connected components;.
 
ml_matrix quaternionArray
 Stage attitude array.
 
bool child_obj
 Flag if child.
 

Detailed Description

Multi-stage rigid body model.

Rigid body dynamical model applying both force and torque to the spacecraft stage. Models offset center of mass and changing inertia properties.

Integrates the position, velocity, quaternion, and body rates. Allows the mass of the spacecraft to change. Children can use the apply_torque or apply_force messages.

Setup:

The rigid_body_assembly requires initialization of position, velocity, quaternion, body_rate, center_mass, mass_base, and inertia just like rigid_body, but also some additional parameters:

Member Function Documentation

◆ rhs()

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

Computation done during numerical integration.

Quaternion kinematics and orbit derivative.

The coordinate frame is previously translated to the center of mass, so simple rigid body dynamics are appropriate. The results are translated back to the original frame. Uses qi_to_b_dot from the SCControl framework.

◆ handle_message()

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

Handle force and torque messages.

rigid_body_assembly supports the following messages: 'apply_force','apply_torque','stage_event','add_stage','set_state_to_stage' apply_force - Adds the argument to the force vector applied to the rigid body.

Argument should be in the ECI frame. apply_torque - Adds the argument to the torque vector applied to the rigid body. Argument should be in the body frame. !

◆ parse_setup()

bool rigid_body_assembly::parse_setup ( const char *  command,
const char *  data 
)

Parse the setup.

Processes AddComponent commands.

The data is the following:

  • name of object (as recognized by DSim)
  • position (vector to component's body frame origin)
  • quaternion (assembly-to-body rotation of the child)

◆ get_adj_mass()

double rigid_body_assembly::get_adj_mass ( )
protected

Check for changed mass of children and recompute new adjusted mass.

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

◆ get_adj_center_of_mass()

ml_matrix rigid_body_assembly::get_adj_center_of_mass ( )
protected

Recompute new adjusted center of mass.

Determine the center of mass of this object and any children that have a mass variable.

◆ get_adj_inertia()

ml_matrix rigid_body_assembly::get_adj_inertia ( )
protected

Recompute new adjusted inertia matrix.

If the child has an inertia matrix, rotate and translate and add to parent inertia If the child has a mass value, but not inertia, treat as a point mass and add to parent inertia if a center_mass value is available.

◆ get_adj_inertia_derivative()

ml_matrix rigid_body_assembly::get_adj_inertia_derivative ( )
protected

Recompute new adjusted inertia derivative.

Determine the time derivative of the inertia matrix.

◆ get_adj_mass_derivative()

double rigid_body_assembly::get_adj_mass_derivative ( )
protected

Recompute new adjusted mass derivative.

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

◆ get_adj_center_of_mass_derivative()

ml_matrix rigid_body_assembly::get_adj_center_of_mass_derivative ( )
protected

Recompute the derivative of the center of mass.

Determine the center of mass derivaitve of this object and any children that have a mass variable.

◆ get_jet_damping()

ml_matrix rigid_body_assembly::get_jet_damping ( )
protected

Compute the jet damping vector.

Get the jet damping term for the rhs.


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