The Frame class defined in C++ forms the basis for all 6-DOF kinematics and dynamics. It is designed for recursive chaining and represents the relationship of a frame to its parent.
The Frame Class
Description and Naming
The Frame class is a templated class with one template argument - T.
Frame<T>
represents a frame with the following key parameters relative to its parent:
-
pos_f_p__p
- Position of the child frame relative to its parent, in parent coordinates. -
vel_f_p__p
- Velocity of the child frame in the parent frame, in parent coordinates. -
quat_f_p
- Attitude quaternion of the child frame relative to its parent. -
ang_vel_f_p__f
- Angular velocity of the child frame relative to its parent, in frame coordinates.
The Frame class also includes translational and rotational joints to track degrees of freedom.
A Note on Freedom
The frame class’s chain kinematics are dependent on the concept of whether it is "free" to translate, that is, can have velocity, relative to its parent. Frames may be defined as fully free or fully locked. The default is locked. This functionality is handled by the frame’s joint (a separate class).
A Note on the Root Frame
A key concept in the ModelSpace is the root frame. This is a special frame which serves as the ultimate inertial refererence point relative to which the entire simulation is constructed. It is typically set to the planet relative to which the analysis is being performed by default (aligned to planet’s inertial reference frame), but may be a random reference (for flat earth scenarios) or another celestial body (for instance, the sun in interplanetary simulations). Many functions return frame states relative to root as the ultimate inertial reference point.
Doxygen
For a complete guide on interacting with the Frame class, refer to the Doxygen documentation: Frame Doxygen
Creating a Frame
Description | C++ Example | Python Example |
---|---|---|
Constructor for the frame class with only a name |
|
|
Constructor for the frame class with name and parent |
|
|
Constructor for the frame class with name, parent, and freedom. In this case set fully free relative to parent. |
|
|
Getting and Setting Values
Description | C++ Example | Python Example |
---|---|---|
Get Translational Joint - Retrieves the frame’s translational joint. |
|
|
Get Rotational Joint - Retrieves the frame’s rotational joint. |
|
|
Set Parent Frame - Sets the parent frame. |
|
|
Set Position Relative to Root - Sets the frame’s position relative to the root. |
|
|
Set Velocity Relative to Root - Sets the frame’s velocity relative to the root. |
|
|
Set Attitude Relative to Root - Sets the frame’s attitude relative to the root. |
|
|
Set Angular Velocity Relative to Root - Sets the frame’s angular velocity relative to the root. |
|
|
Getting Values Relative to Root
Description | C++ Example | Python Example |
---|---|---|
Get Position Relative to Root - Retrieves the frame’s position relative to the root. |
|
|
Get Velocity Relative to Root - Retrieves the frame’s velocity relative to the root. |
|
|
Get Acceleration Relative to Root - Retrieves the frame’s acceleration relative to the root. |
|
|
Get Attitude Quaternion Relative to Root - Retrieves the frame’s attitude quaternion relative to the root. |
|
|
Get Direction Cosine Matrix Relative to Root - Retrieves the frame’s DCM relative to the root. |
|
|
Get Angular Velocity Relative to Root - Retrieves the frame’s angular velocity relative to the root. |
|
|
Get Angular Acceleration Relative to Root - Retrieves the frame’s angular acceleration relative to the root. |
|
|