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

Rigid body dynamical model applying both force and torque to the spacecraft. More...

#include <rigid_body_staging.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 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...
 

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 ()
 Check for changed mass of children and recompute new adjusted center of mass.
 
ml_matrix get_adj_inertia ()
 Check for changed mass of children and recompute new adjusted inertia. More...
 
double get_adj_mass_derivative ()
 Check for changed mass of children and recompute new adjusted mass derivative. More...
 
ml_matrix get_adj_center_of_mass_derivative ()
 Check for changed mass of children and recompute new adjusted center of mass derivative. More...
 
ml_matrix get_adj_inertia_derivative ()
 Check for changed mass of children and recompute new adjusted inertia derivative. More...
 

Protected Attributes

dsim_variable spacecraft_name_dsim
 Spacecraft name.
 
dsim_variable spacecraft_type_dsim
 Spacecraft type.
 
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 mass_base
 dry mass (kg)
 
dsim_variable totalMass_dsim
 total mass, including mass of children
 
dsim_variable totalInertia_dsim
 total inertia, including children
 
dsim_variable centerOfMass_dsim
 object center of mass, including children
 
dsim_variable centerOfMass_base
 object center of mass
 
dsim_variable inertia_base
 rigid body inertia
 
dsim_variable totalMassDerivative_dsim
 mass derivative
 
dsim_variable totalCenterOfMassDerivative_dsim
 center of mass derivative
 
dsim_variable totalInertiaDerivative_dsim
 inertia derivative
 
dsim_variable frame_dsim
 frame for initial conditions
 
dsim_variable stagingCommand_dsim
 Staging command for rigid_body_staging_assembly.
 
dsim_variable ang_momentum_dsim
 Angular momentum.
 
dsim_variable acceleration_dsim
 object linear acceleration in body frame
 
dsim_variable angular_acceleration_dsim
 Angular acceleration.
 
dsim_variable parent_com
 Center of mass of parent.
 
dsim_variable parent_q_eci_to_body
 Quaternion of the parent.
 
dsim_variable parent_position
 Position of the parent.
 
std::string parent_path
 Path of the parent.
 
dsim_variable quaternionCommand_dsim
 Commanded quaternion.
 
ml_matrix inertia
 Stored inertia for computational efficiency.
 
ml_matrix invInertia
 Stored inverse inertia for computational efficiency.
 
ml_matrix force
 The external force on the spacecraft.
 
ml_matrix torque
 The external torque on the spacecraft.
 
double m_to_km
 Convert meters to kilometers.
 
double baseMass
 Base mass to be added to children.
 
bool child_obj
 Flag if child.
 

Detailed Description

Rigid body dynamical model applying both force and torque to the spacecraft.

Integrates the position, velocity, quaternion, and body rates. Allows the mass of the spacecraft to change. Children can use the apply_torque, apply_force, or mass_changed messages. Ignores any effect of or changes in center of mass. Does not add up or compute changes in inertia. Assumes all torques are about the center of mass.

Member Function Documentation

◆ rhs()

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

Computation done during numerical integration.

Quaternion kinematics and orbit derivative.

Uses qi_to_b_dot from the SCControl framework.

◆ handle_message()

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

Handle force and torque messages.

Handle the apply_force and apply_torque messages.

The units should be N and Nm. Force should be in the ECI frame and torque should be in the body frame.

◆ get_adj_mass()

double rigid_body_staging::get_adj_mass ( )
protected

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

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

Store the new mass and reset the changed mass flag.

◆ get_adj_inertia()

ml_matrix rigid_body_staging::get_adj_inertia ( )
protected

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

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_mass_derivative()

double rigid_body_staging::get_adj_mass_derivative ( )
protected

Check for changed mass of children and 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_staging::get_adj_center_of_mass_derivative ( )
protected

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

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

◆ get_adj_inertia_derivative()

ml_matrix rigid_body_staging::get_adj_inertia_derivative ( )
protected

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

Determine the time derivative of the inertia matrix.


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