AerospacePackage 1.0
|
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... | |
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:
frame_dsim: Spice frame number of the initialization reference frame
rigid_body_assembly also handles the mass properties of child objects. In order for the mass properties to be calculated correctly, all children with mass should have the following variables:
mass: The total mass of the child
For children with time-varying mass properties, the following should also be included:
massDerivative: The time derivative of the mass
Use:
rigid_body_assembly integrates the state of the active stage with all of the mass properties of the inactive stages added to it. In complete_timestep, the state of each stage is calculated from the result of the active stage. The model accomodates a changing center of mass by re-adjusting the center of the coordinate frame at each time step, and then translating back to the original frame after the integration. Staging events are controlled by the commmand stageCommand. If this variable is set to 1 for the active stage, it will separate and the next stage will become active. Separated stages are then treated as single rigid body objects, and their states continue to be integrated.
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.
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. !
bool rigid_body_assembly::parse_setup | ( | const char * | command, |
const char * | data | ||
) |
Parse the setup.
Processes AddComponent commands.
The data is the following:
|
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.
|
protected |
Recompute new adjusted center of mass.
Determine the center of mass of this object and any children that have a mass variable.
|
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.
|
protected |
Recompute new adjusted inertia derivative.
Determine the time derivative of the inertia matrix.
|
protected |
Recompute new adjusted mass derivative.
Add up the mass of this object and any children that have a mass variable.
|
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.
|
protected |
Compute the jet damping vector.
Get the jet damping term for the rhs.