Rigid Body Dynamics Library
Body Struct Reference

Describes all properties of a single body. More...

Public Member Functions

 Body ()
 
 Body (const Body &body)
 
Bodyoperator= (const Body &body)
 
 Body (const double &mass, const Math::Vector3d &com, const Math::Vector3d &gyration_radii)
 Constructs a body from mass, center of mass and radii of gyration. More...
 
 Body (const double &mass, const Math::Vector3d &com, const Math::Matrix3d &inertia_C)
 Constructs a body from mass, center of mass, and a 3x3 inertia matrix. More...
 
void Join (const Math::SpatialTransform &transform, const Body &other_body)
 Joins inertial parameters of two bodies to create a composite body. More...
 
 ~Body ()
 

Data Fields

double mMass
 The mass of the body. More...
 
Math::Vector3d mCenterOfMass
 The position of the center of mass in body coordinates. More...
 
Math::Matrix3d mInertia
 Inertia matrix at the center of mass. More...
 
bool mIsVirtual
 

Detailed Description

Describes all properties of a single body.

A Body contains information about mass, the location of its center of mass, and the ineria tensor in the center of mass. This class is designed to use the given information and transform it such that it can directly be used by the spatial algebra.

Definition at line 26 of file Body.h.

Constructor & Destructor Documentation

Body ( )
inline

Definition at line 27 of file Body.h.

Body ( const Body body)
inline

Definition at line 33 of file Body.h.

Body ( const double &  mass,
const Math::Vector3d com,
const Math::Vector3d gyration_radii 
)
inline

Constructs a body from mass, center of mass and radii of gyration.

This constructor eases the construction of a new body as all the required parameters can be specified as parameters to the constructor. These are then used to generate the spatial inertia matrix which is expressed at the origin.

Parameters
massthe mass of the body
comthe position of the center of mass in the bodies coordinates
gyration_radiithe radii of gyration at the center of mass of the body

Definition at line 61 of file Body.h.

Body ( const double &  mass,
const Math::Vector3d com,
const Math::Matrix3d inertia_C 
)
inline

Constructs a body from mass, center of mass, and a 3x3 inertia matrix.

This constructor eases the construction of a new body as all the required parameters can simply be specified as parameters to the constructor. These are then used to generate the spatial inertia matrix which is expressed at the origin.

Parameters
massthe mass of the body
comthe position of the center of mass in the bodies coordinates
inertia_Cthe inertia at the center of mass

Definition at line 85 of file Body.h.

~Body ( )
inline

Definition at line 171 of file Body.h.

Member Function Documentation

void Join ( const Math::SpatialTransform transform,
const Body other_body 
)
inline

Joins inertial parameters of two bodies to create a composite body.

This function can be used to joint inertial parameters of two bodies to create a composite body that has the inertial properties as if the two bodies were joined by a fixed joint.

Note
Both bodies have to have their inertial parameters expressed in the same orientation.
Parameters
transformThe frame transformation from the origin of the original body to the origin of the added body
other_bodyThe other body that will be merged with *this.

Definition at line 107 of file Body.h.

References SpatialRigidBodyInertia::createFromMassComInertiaC(), SpatialTransform::E, LOG, Body::mCenterOfMass, Body::mInertia, Body::mMass, RigidBodyDynamics::Math::parallel_axis(), SpatialTransform::r, SpatialRigidBodyInertia::toMatrix(), and RigidBodyDynamics::Math::VectorCrossMatrix().

Body& operator= ( const Body body)
inline

Definition at line 39 of file Body.h.

References Body::mCenterOfMass, Body::mInertia, Body::mIsVirtual, and Body::mMass.

Field Documentation

Math::Vector3d mCenterOfMass

The position of the center of mass in body coordinates.

Definition at line 176 of file Body.h.

Math::Matrix3d mInertia

Inertia matrix at the center of mass.

Definition at line 178 of file Body.h.

bool mIsVirtual

Definition at line 180 of file Body.h.

double mMass

The mass of the body.

Definition at line 171 of file Body.h.


The documentation for this struct was generated from the following file: