Hosted by: BerliOS Developer Logo

OpenMBV C++ Interface

BerliOS Project Page
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
OpenMBV::RigidBody Class Reference

Abstract base class for all rigid bodies. More...

#include <rigidbody.h>

Inheritance diagram for OpenMBV::RigidBody:
OpenMBV::DynamicColoredBody OpenMBV::Body OpenMBV::Object OpenMBV::CompoundRigidBody OpenMBV::Cube OpenMBV::Cuboid OpenMBV::Extrusion OpenMBV::Frame OpenMBV::Frustum OpenMBV::Grid OpenMBV::InvisibleBody OpenMBV::IvBody OpenMBV::Rotation OpenMBV::Sphere

List of all members.

Public Member Functions

void setLocalFrame (bool f)
 Draw local frame of this object in the viewer if true (the default)
bool getLocalFrame ()
void setReferenceFrame (bool f)
 Draw reference frame of this object in the viewer if true (the default)
bool getReferenceFrame ()
void setPath (bool p)
 Draw path of this object in the viewer if true (the default)
bool getPath ()
void setDragger (bool p)
 Draw dragger of this object in the viewer if true (default: false)
bool getDragger ()
void setInitialTranslation (const std::vector< double > &initTrans)
 Set initial translaton between the local frame of the body and the reference frame.
std::vector< double > getInitialTranslation ()
void setInitialTranslation (double x, double y, double z)
 Set initial translaton between the local frame of the body and the reference frame.
void setInitialRotation (const std::vector< double > &initRot)
 Set initial rotation between the local frame of the body and the reference frame.
std::vector< double > getInitialRotation ()
void setInitialRotation (double a, double b, double g)
 Set initial rotation between the local frame of the body and the reference frame.
void setScaleFactor (double scale)
 Set the scale factor of the body.
double getScaleFactor ()
void append (const std::vector< double > &row)
 Append a data vector the the h5 datsset.
int getRows ()
 Get the number of rows of the default data.
std::vector< double > getRow (int i)
 Get row number i of the default data.
virtual void initializeUsingXML (xercesc::DOMElement *element)
 Initializes the time invariant part of the object using a XML node.
xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *parent)
virtual std::string getFullName (bool includingFileName=false, bool stopAtSeparateFile=false)
 Returns the full name (path) of the object.
boost::shared_ptr< Group > getSeparateGroup ()
 return the first Group in the tree which is an separateFile
boost::shared_ptr< Group > getTopLevelGroup ()
 return the top level Group

Protected Member Functions

void createHDF5File ()
void openHDF5File ()

Protected Attributes

std::string localFrameStr
std::string referenceFrameStr
std::string pathStr
std::string draggerStr
std::vector< double > initialTranslation
std::vector< double > initialRotation
double scaleFactor
H5::VectorSerie< double > * data
boost::weak_ptr
< CompoundRigidBody > 
compound

Friends

class CompoundRigidBody

Detailed Description

Abstract base class for all rigid bodies.

Each rigid body has a body fixed local coordinate system L and a reference coordinate system R which has a fixed relative position and rotation with respect to L (see figure). And there is a inertial fixed world coordinate system W.

rigidbodycos.png
Coordinate Systems of Rigid Body

The fixed translation from system R to system L is given by the vector initialTranslation $[_R x_B, _R y_B, _R z_B]^T$ which coordinates are given in system R.

The fixed rotation between the systems R and L is given by the vector initialRotation $[\alpha_B, \beta_B, \gamma_B]^T$ which are the kardan angles of the transformation matrix

\[ A_{RL}= \textrm{cardan}(\alpha_B, \beta_B, \gamma_B) \]

from system L to system R.

The time dependend translation between the systems W and R is given in the HDF5 dataset by the vector $ [_W x_P, _W y_P, _W z_P]^T=_W r_P $ which coordinates are given in system W.

The time dependend rotation between the systems W and R is given in the HDF5 dataset by the vector $ [\alpha_P, \beta_P, \gamma_P] $ which are the kardan angles of the transformation matrix

\[ A_{WR}= \textrm{cardan}(\alpha_P, \beta_P, \gamma_P) \]

from system R to system W.

HDF5-Dataset: The HDF5 dataset of this object is a 2D array of double precision values. Each row represents one dataset in time. A row consists of the following columns in order: time, $ _W x_P $, $ _W y_P $, $ _W z_P $, $ \alpha_P $, $ \beta_P $, $ \gamma_P $, color


Member Function Documentation

std::vector<double> OpenMBV::RigidBody::getRow ( int  i) [inline, virtual]

Get row number i of the default data.

NOTE: see also append()

Implements OpenMBV::Body.

int OpenMBV::RigidBody::getRows ( ) [inline, virtual]

Get the number of rows of the default data.

Returns -1, if no default data is avaliable. NOTE: see also append()

Implements OpenMBV::Body.

void OpenMBV::RigidBody::setInitialRotation ( const std::vector< double > &  initRot) [inline]

Set initial rotation between the local frame of the body and the reference frame.

Use cardan angles to represent the transformation matrix

void OpenMBV::RigidBody::setInitialRotation ( double  a,
double  b,
double  g 
) [inline]

Set initial rotation between the local frame of the body and the reference frame.

Use cardan angles to represent the transformation matrix


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