Public Member Functions

dsim_rigid_body Class Reference
[Builtin Models]

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...

Inheritance diagram for dsim_rigid_body:

List of all members.

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)

Detailed Description

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.


Member Function Documentation

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.

Parameters:
sender_pathThe sending object
message_nameThe name of the effective message
argumentThe value being passed with the message
Returns:
Output value

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.

Parameters:
tElapsed time
jdJulian date of epoch

Reimplemented from dsim_model.

 All Classes Files Functions Typedefs Enumerations Enumerator