Built-in example class for rigid body objects.This class provides variables for a physical object, such as position and velocity, and supports forces and torques applied between objects with apply_force and apply_torque messages. More...
Public Member Functions | |
void | initialize_data () |
void | initialize_timestep () |
void | complete_timestep () |
void | rhs (double t, double jd) |
dsim_value | handle_message (const std::string &sender_path, const std::string &message_name, const dsim_value &argument) |
Built-in example class for rigid body objects.
This class provides variables for a physical object, such as position and velocity, and supports forces and torques applied between objects with apply_force and apply_torque messages.
void dsim_rigid_body::complete_timestep | ( | ) | [virtual] |
Apply the quaternion sign convention at the end of the timestep. The first component should always be positive.
Reimplemented from dsim_model.
dsim_value dsim_rigid_body::handle_message | ( | const std::string & | sender_path, |
const std::string & | message_name, | ||
const dsim_value & | argument | ||
) | [virtual] |
Handle apply_force and apply_torque messages. The argument should be a 3x1 matrix of the force or torque values. The objects using these messages must ensure units consistency.
sender_path | The sending object |
message_name | The name of the effective message |
argument | The value being passed with the message |
Reimplemented from dsim_model.
void dsim_rigid_body::initialize_data | ( | ) | [virtual] |
Create the rigid body states. The integrated states are position, velocity, quaternion, and rotational velocity. The non-integrated states are mass, center of mass, and inertia.
Reimplemented from dsim_model.
void dsim_rigid_body::initialize_timestep | ( | ) | [virtual] |
Zero the force and torque matrices at the beginning of the timestep.
Reimplemented from dsim_model.
void dsim_rigid_body::rhs | ( | double | t, |
double | jd | ||
) | [virtual] |
Compute the derivatives of the position, velocity, quaternion, and rotational velocity. The acceleration is the force divided by the mass.
Uses rigid body kinematics for the quaternion. The angular acceleration of a rigid body is computed from the equation Iw' + w x Iw = T.
t | Elapsed time |
jd | Julian date of epoch |
Reimplemented from dsim_model.