MBSim

Project Page
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
MBSim::RigidBody Class Reference

rigid bodies with arbitrary kinematics More...

#include <rigid_body.h>

Inheritance diagram for MBSim::RigidBody:
MBSim::Body MBSim::Object MBSim::Element

List of all members.

Public Member Functions

 RigidBody (const std::string &name)
 constructor
virtual ~RigidBody ()
 destructor
void addDependency (Constraint *constraint_)
virtual void updateT (double t)
virtual void updateh (double t, int j=0)
virtual void updateh0Fromh1 (double t)
virtual void updateW0FromW1 (double t)
virtual void updateV0FromV1 (double t)
virtual void updatehInverseKinetics (double t, int j=0)
virtual void updateStateDerivativeDependentVariables (double t)
virtual void updateM (double t, int i=0)
virtual void updateStateDependentVariables (double t)
virtual void updateJacobians (double t, int j=0)
void updateJacobians0 (double t)
void updateJacobians1 (double t)
virtual void calcqSize ()
virtual void calcuSize (int j=0)
virtual void updateqRef (const fmatvec::Vec &ref)
 references to positions of dynamic system parent
virtual void updateuRef (const fmatvec::Vec &ref)
 references to velocities of dynamic system parent
virtual void updateTRef (const fmatvec::Mat &ref)
 references to linear transformation matrix between differentiated positions and velocities of dynamic system parent
virtual void init (InitStage stage)
 initialize object at start of simulation with respect to contours and frames
virtual void initz ()
 initialize state of object at start of simulation
virtual void facLLM (int i=0)
 perform Cholesky decomposition of mass martix
virtual void setUpInverseKinetics ()
 TODO.
virtual std::string getType () const
virtual void plot (double t, double dt=1)
 plots time dependent data
virtual void updateKinematicsForSelectedFrame (double t)
 updates kinematics of kinematic Frame starting from reference Frame
virtual void updateJacobiansForSelectedFrame0 (double t)
 updates JACOBIAN for kinematics starting from reference Frame
virtual void updateKinematicsForRemainingFramesAndContours (double t)
 updates kinematics for remaining Frames starting with and from cog Frame
virtual void updateJacobiansForRemainingFramesAndContours (double t, int j=0)
 updates remaining JACOBIANS for kinematics starting with and from cog Frame
virtual void updateJacobiansForRemainingFramesAndContours1 (double t)
void setTranslation (Translation *fPrPK_)
 set Kinematic for translational motion
void setRotation (Rotation *fAPK_)
 set Kinematic for rotational motion
Translation * getTranslation ()
 get Kinematic for translational motion
Rotation * getRotation ()
 get Kinematic for rotational motion
void setJacobianOfTranslation (Jacobian *fPJT_)
void setJacobianOfRotation (Jacobian *fPJR_)
void setDerivativeOfJacobianOfTranslation (Function3< fmatvec::Mat, fmatvec::Vec, fmatvec::Vec, double > *fPdJT_)
void setDerivativeOfJacobianOfRotation (Function3< fmatvec::Mat, fmatvec::Vec, fmatvec::Vec, double > *fPdJR_)
void setGuidingVelocityOfTranslation (Function1< fmatvec::Vec, double > *fPjT_)
 Sets the time dependent function for the guiding velocity of translation.
void setGuidingVelocityOfRotation (Function1< fmatvec::Vec, double > *fPjR_)
 Sets the time dependent function for the guiding velocity of rotation.
void setDerivativeOfGuidingVelocityOfTranslation (Function1< fmatvec::Vec, double > *fPdjT_)
 Sets the time dependent function for the derivative of the guilding velocity of translation.
void setDerivativeOfGuidingVelocityOfRotation (Function1< fmatvec::Vec, double > *fPdjR_)
 Sets the time dependent function for the derivative of the guilding velocity of rotation.
void setMass (double m_)
double getMass () const
Frame * getFrameForKinematics ()
Frame * getFrameOfReference ()
void isFrameOfBodyForRotation (bool cb_)
std::vector< fmatvec::SqrMat > getContainerForFrameOrientations () const
std::vector< fmatvec::Vec > getContainerForFramePositions () const
std::vector< fmatvec::SqrMat > getContainerForContourOrientations () const
std::vector< fmatvec::Vec > getContainerForContourPositions () const
void setInertiaTensor (const fmatvec::SymMat &RThetaR, const Frame *refFrame=0)
const fmatvec::SymMat & getInertiaTensor () const
fmatvec::SymMat & getInertiaTensor ()
void addFrame (Frame *frame_, const fmatvec::Vec &RrRF, const fmatvec::SqrMat &ARF, const std::string &refFrameName)
void addFrame (Frame *frame_, const fmatvec::Vec &RrRF, const fmatvec::SqrMat &ARF, const Frame *refFrame=0)
void addFrame (const std::string &str, const fmatvec::Vec &RrRF, const fmatvec::SqrMat &ARF, const Frame *refFrame=0)
void addContour (Contour *contour, const fmatvec::Vec &RrRC, const fmatvec::SqrMat &ARC, const std::string &refFrameName)
void addContour (Contour *contour, const fmatvec::Vec &RrRC, const fmatvec::SqrMat &ARC, const Frame *refFrame=0)
void setFrameForKinematics (Frame *frame)
virtual void initializeUsingXML (TiXmlElement *element)
virtual void updatePositionAndOrientationOfFrame (double t, unsigned int i)
virtual void updateAccelerations (double t, unsigned int i)
virtual void updateRelativeJacobians (double t, unsigned int i)
virtual void updateRelativeJacobians (double t, unsigned int i, fmatvec::Mat &WJTrel, fmatvec::Mat &WJRrel)
const fmatvec::Mat & getWJTrel () const
const fmatvec::Mat & getWJRrel () const
fmatvec::Mat & getWJTrel ()
fmatvec::Mat & getWJRrel ()
fmatvec::Mat & getJRel (int i=0)
fmatvec::Vec & getjRel ()
fmatvec::Vec & getqRel ()
fmatvec::Vec & getuRel ()
fmatvec::Mat & getPJT (int i=0)
fmatvec::Mat & getPJR (int i=0)
- Public Member Functions inherited from MBSim::Body
 Body (const std::string &name)
 constructor
virtual ~Body ()
 destructor
void sethSize (int hSize_, int i=0)
void sethInd (int hInd_, int i=0)
virtual void closePlot ()
 closes plot file
virtual void setDynamicSystemSolver (DynamicSystemSolver *sys)
virtual void addContour (Contour *contour)
virtual void addFrame (Frame *frame)
virtual Contour * getContour (const std::string &name, bool check=true)
virtual Frame * getFrame (const std::string &name, bool check=true)
virtual const Frame * getFrameOfReference () const
virtual void setFrameOfReference (Frame *frame)
const std::vector< Frame * > & getFrames () const
const std::vector< Contour * > & getContours () const
int frameIndex (const Frame *frame_) const
int contourIndex (const Contour *contour_) const
virtual Element * getByPathSearch (std::string path)
 a general element search by path
- Public Member Functions inherited from MBSim::Object
 Object (const std::string &name)
 constructor
virtual ~Object ()
 destructor
virtual void updatedhdz (double t)
virtual void updatedq (double t, double dt)
virtual void updatedu (double t, double dt)
virtual void updateud (double t, int i=0)
virtual void updateqd (double t)
virtual void updatezd (double t)
virtual int gethSize (int i=0) const
virtual int getqSize () const
virtual int getuSize (int i=0) const
virtual int getuInd (int i=0)
virtual void setqInd (int qInd_)
virtual void setuInd (int uInd_, int i=0)
virtual const fmatvec::Vec & getq () const
virtual const fmatvec::Vec & getu () const
virtual H5::Group * getPlotGroup ()
virtual PlotFeatureStatus getPlotFeature (PlotFeature fp)
virtual PlotFeatureStatus getPlotFeatureForChildren (PlotFeature fp)
virtual void updateqdRef (const fmatvec::Vec &qdRef)
 references to differentiated positions of dynamic system parent
virtual void updateuallRef (const fmatvec::Vec &uallRef)
 references to velocities of dynamic system parent
virtual void updateudRef (const fmatvec::Vec &udRef, int i=0)
 references to differentiated velocities of dynamic system parent
virtual void updateudallRef (const fmatvec::Vec &udallRef, int i=0)
 references to differentiated velocities of dynamic system parent
virtual void updatehRef (const fmatvec::Vec &hRef, int i=0)
 references to smooth force vector of dynamic system parent
virtual void updateWRef (const fmatvec::Mat &WRef, int i=0)
virtual void updateVRef (const fmatvec::Mat &VRef, int i=0)
virtual void updatedhdqRef (const fmatvec::Mat &dhdqRef, int i=0)
 references to object Jacobian for implicit integration of dynamic system parent regarding positions
virtual void updatedhduRef (const fmatvec::SqrMat &dhduRef, int i=0)
 references to object Jacobian for implicit integration of dynamic system parent regarding velocities
virtual void updatedhdtRef (const fmatvec::Vec &dhdtRef, int i=0)
 references to object Jacobian for implicit integration of dynamic system parent regarding time
virtual void updaterRef (const fmatvec::Vec &ref, int i=0)
 references to nonsmooth force vector of dynamic system parent
virtual void updateMRef (const fmatvec::SymMat &ref, int i=0)
 references to mass matrix of dynamic system parent
virtual void updateLLMRef (const fmatvec::SymMat &ref, int i=0)
 references to Cholesky decomposition of dynamic system parent
std::vector< Object * > getObjectsDependingOn () const
 checks dependency on other objects.
void addDependency (Object *obj)
int cutDependencies ()
 computes the length of the pathes in the graph that represents the dependencies between all objects.
int computeLevel ()
virtual void calcSize (int j)
 calculates size of right hand side
virtual double computeKineticEnergy ()
virtual double computePotentialEnergy ()
void setqSize (int qSize_)
void setuSize (int uSize_, int i=0)
int getzSize () const
int gethInd (int i=0)
const fmatvec::Vec & geth (int i=0) const
fmatvec::Vec & geth (int i=0)
const fmatvec::Vec & getr (int i=0) const
fmatvec::Vec & getr (int i=0)
const fmatvec::SymMat & getM (int i=0) const
fmatvec::SymMat & getM (int i=0)
const fmatvec::Mat & getT () const
fmatvec::Mat & getT ()
const fmatvec::SymMat & getLLM (int i=0) const
fmatvec::SymMat & getLLM (int i=0)
fmatvec::Vec & getq ()
fmatvec::Vec & getu ()
const fmatvec::Vec & getq0 () const
const fmatvec::Vec & getu0 () const
fmatvec::Vec & getq0 ()
fmatvec::Vec & getu0 ()
const fmatvec::Vec & getqd () const
const fmatvec::Vec & getud (int i=0) const
fmatvec::Vec & getqd ()
fmatvec::Vec & getud (int i=0)
void setq (const fmatvec::Vec &q_)
void setu (const fmatvec::Vec &u_)
void setInitialGeneralizedPosition (const fmatvec::Vec &q0_)
void setInitialGeneralizedVelocity (const fmatvec::Vec &u0_)
void setInitialGeneralizedPosition (double q0_)
void setInitialGeneralizedVelocity (double u0_)
- Public Member Functions inherited from MBSim::Element
 Element (const std::string &name)
 constructor
virtual ~Element ()
 destructor
virtual void initDataInterfaceBase (DynamicSystemSolver *parentds)
 TODO.
virtual void plotAtSpecialEvent (double t, double dt=1)
 plots time dependent data at special events
const std::string & getName () const
const std::string getShortName () const
void setName (const std::string &str)
DynamicSystemSolver * getDynamicSystemSolver ()
virtual void createPlotGroup ()
 creates the plotGroup for H5-output
virtual void setPlotFeature (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature.
void setPlotFeatureForChildren (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature for the children of this object.
void setPlotFeatureRecursive (PlotFeature pf, PlotFeatureStatus value)
 Set a plot feature for this object and the children of this object.
template<class T >
T * getByPath (std::string path)
 a general element access
virtual Element * getParent ()
virtual const Element * getParent () const
virtual void setParent (Element *parent_)
std::string getPath (char pathDelim='.')

Protected Member Functions

void updateMConst (double t, int i=0)
 update constant mass matrix
void updateMNotConst (double t, int i=0)
 update time dependend mass matrix
void facLLMConst (int i=0)
 Cholesky decomposition of constant mass matrix.
void facLLMNotConst (int i=0)
 Cholesky decomposition of time dependent mass matrix.

Protected Attributes

double m
 mass
fmatvec::SymMat SThetaS
 inertia tensor with respect to centre of gravity in centre of gravity and world Frame
fmatvec::SymMat WThetaS
int iKinematics
 Frame indices for kinematics and inertia description.
int iInertia
fmatvec::SymMat Mbuf
 TODO.
bool cb
 boolean to use body fixed Frame for rotation
fmatvec::Mat PJT [2]
 JACOBIAN of translation, rotation and their derivatives in parent system.
fmatvec::Mat PJR [2]
fmatvec::Mat PdJT
fmatvec::Mat PdJR
fmatvec::Vec PjT
 guiding velocities of translation, rotation and their derivatives in parent system
fmatvec::Vec PjR
fmatvec::Vec PdjT
fmatvec::Vec PdjR
fmatvec::Mat PJR0
 TODO.
fmatvec::SqrMat APK
 rotation matrix from kinematic Frame to parent Frame
fmatvec::Vec PrPK
 translation from parent to kinematic Frame in parent and world system
fmatvec::Vec WrPK
fmatvec::Vec WvPKrel
 translational and angular velocity from parent to kinematic Frame in world system
fmatvec::Vec WomPK
std::vector< fmatvec::SqrMat > ASF
 vector of rotations from cog-Frame to specific Frame
std::vector< fmatvec::Vec > SrSF
 vector of translations from cog to specific Frame in cog- and world-system
std::vector< fmatvec::Vec > WrSF
std::vector< fmatvec::SqrMat > ASC
 vector of rotations from cog-Frame to specific contour
std::vector< fmatvec::Vec > SrSC
 vector of translations from cog to specific contour in cog- and world-system
std::vector< fmatvec::Vec > WrSC
Jacobian * fT
 JACOBIAN for linear transformation between differentiated positions and velocities.
Translation * fPrPK
 translation from parent Frame to kinematic Frame in parent system
Rotation * fAPK
 rotation from kinematic Frame to parent Frame
Jacobian * fPJT
 JACOBIAN of translation in parent system.
Jacobian * fPJR
 JACOBIAN of rotation in parent system.
Function3< fmatvec::Mat,
fmatvec::Vec, fmatvec::Vec,
double > * 
fPdJT
 differentiated JACOBIAN of translation in parent system
Function3< fmatvec::Mat,
fmatvec::Vec, fmatvec::Vec,
double > * 
fPdJR
 differentiated JACOBIAN of rotation in parent system
Function1< fmatvec::Vec, double > * fPjT
 guiding velocity of translation in parent system
Function1< fmatvec::Vec, double > * fPjR
 guiding velocity of rotation in parent system
Function1< fmatvec::Vec, double > * fPdjT
 differentiated guiding veclocity of translation in parent system
Function1< fmatvec::Vec, double > * fPdjR
 differentiated guiding veclocity of rotation in parent system
void(RigidBody::* updateM_ )(double t, int i)
 function pointer to update mass matrix
void(RigidBody::* facLLM_ )(int i)
 function pointer for Cholesky decomposition of mass matrix
void(RigidBody::* updateJacobians_ [2])(double t)
Frame * C
 a pointer to Frame "C"
fmatvec::Vec aT
fmatvec::Vec aR
fmatvec::Vec qRel
fmatvec::Vec uRel
fmatvec::Mat JRel [2]
fmatvec::Vec jRel
fmatvec::Mat WJTrel
fmatvec::Mat WJRrel
fmatvec::Vec WjTrel
fmatvec::Vec WjRrel
fmatvec::Mat TRel
Constraint * constraint
int nu [2]
int nq
- Protected Attributes inherited from MBSim::Body
std::vector< Frame * > frame
 vector of frames and contours
std::vector< Contour * > contour
Frame * frameOfReference
 frame of reference of the object
- Protected Attributes inherited from MBSim::Object
int qSize
 size of object positions
int uSize [2]
 size of object velocities
int hSize [2]
 size of object h-vector (columns of J)
int qInd
 indices of positions, velocities, right hand side
int uInd [2]
int hInd [2]
fmatvec::Vec q
 positions, velocities
fmatvec::Vec u
fmatvec::Vec uall
fmatvec::Vec q0
 initial position, velocity
fmatvec::Vec u0
fmatvec::Vec qd
 differentiated positions, velocities
fmatvec::Vec ud [2]
fmatvec::Vec udall [2]
fmatvec::Vec h [2]
 complete and object smooth and nonsmooth right hand side
fmatvec::Vec r [2]
fmatvec::Mat W [2]
fmatvec::Mat V [2]
fmatvec::Mat dhdq
 Jacobians of h.
fmatvec::SqrMat dhdu
fmatvec::Vec dhdt
fmatvec::Mat T
 linear relation matrix of differentiated position and velocity parameters
fmatvec::SymMat M [2]
 mass matrix
fmatvec::SymMat LLM [2]
 LU-decomposition of mass matrix.
std::vector< Object * > dependency
 indices for velocities and right hand side
- Protected Attributes inherited from MBSim::Element
Element * parent
std::string name
 name of element
DynamicSystemSolver * ds
 dynamic system
H5::VectorSerie< double > * plotVectorSerie
 time series
std::vector< double > plotVector
 one entry of time series
std::vector< std::string > plotColumns
 columns of time series
H5::Group * plotGroup
 associated plot group

Private Attributes

std::vector< std::string > saved_refFrameF
std::vector< std::string > saved_refFrameC
std::vector< fmatvec::Vec > saved_RrRF
std::vector< fmatvec::Vec > saved_RrRC
std::vector< fmatvec::SqrMat > saved_ARF
std::vector< fmatvec::SqrMat > saved_ARC

Detailed Description

rigid bodies with arbitrary kinematics

Author:
Martin Foerg
Date:
2009-04-08 some comments (Thorsten Schindler)
2009-07-16 splitted link / object right hand side (Thorsten Schindler)
2009-12-14 revised inverse kinetics (Martin Foerg)
2010-04-24 class can handle constraints on generalized coordinates (Martin Foerg)
2010-06-20 add getter for Kinematics; revision on doxygen comments (Roland Zander)
Todo:

kinetic energy TODO

Euler parameter TODO

check if inertial system for performance TODO

rigid bodies have a predefined canonic Frame 'C' in their centre of gravity


Constructor & Destructor Documentation

MBSim::RigidBody::RigidBody ( const std::string &  name)

constructor

Parameters:
namename of rigid body

Member Function Documentation

void MBSim::RigidBody::addContour ( Contour *  contour,
const fmatvec::Vec &  RrRC,
const fmatvec::SqrMat &  ARC,
const std::string &  refFrameName 
)
Parameters:
contourspecific contour to add
RrRCconstant relative vector from reference Frame to specific contour in reference system
ARCconstant relative rotation from specific contour to reference Frame
refFrameNamereference Frame name
void MBSim::RigidBody::addContour ( Contour *  contour,
const fmatvec::Vec &  RrRC,
const fmatvec::SqrMat &  ARC,
const Frame *  refFrame = 0 
)
Parameters:
contourspecific contour to add
RrRCconstant relative vector from reference Frame to specific contour in reference system
ARCconstant relative rotation from specific contour to reference Frame
refFrameNameoptional reference Frame, otherwise cog-Frame will be used as reference
void MBSim::RigidBody::addFrame ( Frame *  frame_,
const fmatvec::Vec &  RrRF,
const fmatvec::SqrMat &  ARF,
const std::string &  refFrameName 
)
Parameters:
framespecific Frame to add
RrRFconstant relative vector from reference Frame to specific Frame in reference system
ARFconstant relative rotation from specific Frame to reference Frame
refFrameNamereference Frame name
void MBSim::RigidBody::addFrame ( Frame *  frame_,
const fmatvec::Vec &  RrRF,
const fmatvec::SqrMat &  ARF,
const Frame *  refFrame = 0 
)
Parameters:
framespecific Frame to add
RrRFconstant relative vector from reference Frame to specific Frame in reference system
ARFconstant relative rotation from specific Frame to reference Frame
refFrameNameoptional reference Frame, otherwise cog-Frame will be used as reference
void MBSim::RigidBody::addFrame ( const std::string &  str,
const fmatvec::Vec &  RrRF,
const fmatvec::SqrMat &  ARF,
const Frame *  refFrame = 0 
)
Parameters:
strname of Frame to add
RrRFconstant relative vector from reference Frame to specific Frame in reference system
ARFconstant relative rotation from specific Frame to reference Frame
refFrameNameoptional reference Frame, otherwise cog-Frame will be used as reference
Frame* MBSim::RigidBody::getFrameOfReference ( )
inlinevirtual
Returns:
frame of reference

Reimplemented from MBSim::Body.

Rotation* MBSim::RigidBody::getRotation ( )
inline

get Kinematic for rotational motion

Returns:
rotational kinematic description
Translation* MBSim::RigidBody::getTranslation ( )
inline

get Kinematic for translational motion

Returns:
translational kinematic description
virtual std::string MBSim::RigidBody::getType ( ) const
inlinevirtual
Returns:
std::string representation

Reimplemented from MBSim::Body.

virtual void MBSim::RigidBody::plot ( double  t,
double  dt = 1 
)
virtual

plots time dependent data

Parameters:
simulationtime
simulationtime step size for derivative calculation

Reimplemented from MBSim::Body.

void MBSim::RigidBody::setFrameForKinematics ( Frame *  frame)
inline
Parameters:
frameFrame to be used for kinematical description depending on reference Frame and generalised positions / velocities
void MBSim::RigidBody::setInertiaTensor ( const fmatvec::SymMat &  RThetaR,
const Frame *  refFrame = 0 
)
inline
Parameters:
RThetaRinertia tensor
refFrameoptional reference Frame of inertia tensor, otherwise cog-Frame will be used as reference
void MBSim::RigidBody::setRotation ( Rotation *  fAPK_)
inline

set Kinematic for rotational motion

Parameters:
fAPKrotational kinematic description
void MBSim::RigidBody::setTranslation ( Translation *  fPrPK_)
inline

set Kinematic for translational motion

Parameters:
fPrPKtranslational kinematic description
virtual void MBSim::RigidBody::updateqRef ( const fmatvec::Vec &  qRef)
virtual

references to positions of dynamic system parent

Parameters:
qRefvector to be referenced

Reimplemented from MBSim::Object.

virtual void MBSim::RigidBody::updateTRef ( const fmatvec::Mat &  ref)
virtual

references to linear transformation matrix between differentiated positions and velocities of dynamic system parent

Parameters:
matrixto be referenced

Reimplemented from MBSim::Object.

virtual void MBSim::RigidBody::updateuRef ( const fmatvec::Vec &  uRef)
virtual

references to velocities of dynamic system parent

Parameters:
uRefvector to be referenced

Reimplemented from MBSim::Object.


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