rbd::MultiBody Class Reference

#include <RBDyn/RBDyn/MultiBody.h>

Public Member Functions

 MultiBody ()
 
 MultiBody (std::vector< Body > bodies, std::vector< Joint > joints, std::vector< int > pred, std::vector< int > succ, std::vector< int > parent, std::vector< sva::PTransformd > Xt)
 
int nrBodies () const
 
int nrJoints () const
 
const std::vector< Body > & bodies () const
 
void bodies (std::vector< Body > b)
 Set bodies of the multibody system. More...
 
const Bodybody (int num) const
 
void body (int num, const Body &b)
 Set the body num in bodies list. More...
 
const std::vector< Joint > & joints () const
 
const Jointjoint (int num) const
 
const std::vector< int > & predecessors () const
 
int predecessor (int num) const
 
const std::vector< int > & successors () const
 
int successor (int num) const
 
const std::vector< int > & parents () const
 
int parent (int num) const
 
const std::vector< sva::PTransformd > & transforms () const
 
void transforms (std::vector< sva::PTransformd > Xt)
 
const sva::PTransformd & transform (int num) const
 
void transform (int num, const sva::PTransformd &Xt)
 Set the transformation from the body base to joint num. More...
 
int bodyIndexByName (const std::string &name) const
 
int jointIndexByName (const std::string &name) const
 
const std::unordered_map< std::string, int > & bodyIndexByName () const
 
const std::unordered_map< std::string, int > & jointIndexByName () const
 
int jointPosInParam (int i) const
 
int jointPosInDof (int i) const
 
const std::vector< int > & jointsPosInParam () const
 
const std::vector< int > & jointsPosInDof () const
 
int nrParams () const
 
int nrDof () const
 
void sBodies (std::vector< Body > b)
 
const BodysBody (int num) const
 
void sBody (int num, const Body &b)
 
const JointsJoint (int num) const
 
int sPredecessor (int num) const
 
int sSuccessor (int num) const
 
int sParent (int num) const
 
void sTransforms (std::vector< sva::PTransformd > Xt)
 
const sva::PTransformd & sTransform (int num) const
 
void sTransform (int num, const sva::PTransformd &Xt)
 
int sJointPosInParam (int i) const
 
int sJointPosInDof (int i) const
 
int sBodyIndexByName (const std::string &name) const
 
int sJointIndexByName (const std::string &name) const
 

Protected Attributes

std::vector< Bodybodies_
 
std::vector< Jointjoints_
 
std::vector< int > pred_
 
std::vector< int > succ_
 
std::vector< int > parent_
 
std::vector< sva::PTransformd > Xt_
 Transformation from the body base to joint i. More...
 
std::unordered_map< std::string, int > bodyNameToInd_
 
std::unordered_map< std::string, int > jointNameToInd_
 
std::vector< int > jointPosInParam_
 Position of joint i in parameter vector. More...
 
std::vector< int > jointPosInDof_
 Position of joint i in dof vector (velocity, acceleration...). More...
 
int nrParams_
 
int nrDof_
 

Detailed Description

Kinematic tree of a multibody system. Same representation as featherstone except joint 0 is the root joint.

Constructor & Destructor Documentation

◆ MultiBody() [1/2]

rbd::MultiBody::MultiBody ( )

◆ MultiBody() [2/2]

rbd::MultiBody::MultiBody ( std::vector< Body bodies,
std::vector< Joint joints,
std::vector< int >  pred,
std::vector< int >  succ,
std::vector< int >  parent,
std::vector< sva::PTransformd >  Xt 
)
Parameters
bodiesBodies of the multibody system.
jointsJoints of the mutibody system.
predPredeccesor body index of each joint.
succSuccessor body index of each joint.
parentParent body index of each body.
XtTransformation from the body base to joint i.

Member Function Documentation

◆ bodies() [1/2]

const std::vector<Body>& rbd::MultiBody::bodies ( ) const
inline
Returns
Bodies of the multibody system.

◆ bodies() [2/2]

void rbd::MultiBody::bodies ( std::vector< Body b)
inline

Set bodies of the multibody system.

◆ body() [1/2]

const Body& rbd::MultiBody::body ( int  num) const
inline
Returns
Body at num position in bodies list.

◆ body() [2/2]

void rbd::MultiBody::body ( int  num,
const Body b 
)
inline

Set the body num in bodies list.

◆ bodyIndexByName() [1/2]

const std::unordered_map<std::string, int>& rbd::MultiBody::bodyIndexByName ( ) const
inline
Returns
Hash map of body index by name.

◆ bodyIndexByName() [2/2]

int rbd::MultiBody::bodyIndexByName ( const std::string &  name) const
inline
Returns
Index of the body with name 'name'.

◆ joint()

const Joint& rbd::MultiBody::joint ( int  num) const
inline
Returns
Joint at num position in joint list.

◆ jointIndexByName() [1/2]

const std::unordered_map<std::string, int>& rbd::MultiBody::jointIndexByName ( ) const
inline
Returns
Hash map of joint index by name.

◆ jointIndexByName() [2/2]

int rbd::MultiBody::jointIndexByName ( const std::string &  name) const
inline
Returns
Index of the joint with name 'name'.

◆ jointPosInDof()

int rbd::MultiBody::jointPosInDof ( int  i) const
inline
Returns
the joint i position in dof vector (alpha, alphaD...).

◆ jointPosInParam()

int rbd::MultiBody::jointPosInParam ( int  i) const
inline
Returns
the joint i position in parameter vector (q).

◆ joints()

const std::vector<Joint>& rbd::MultiBody::joints ( ) const
inline
Returns
Joints of the multibody system.

◆ jointsPosInDof()

const std::vector<int>& rbd::MultiBody::jointsPosInDof ( ) const
inline
Returns
the joint position in dof vector (alpha, alphaD...).

◆ jointsPosInParam()

const std::vector<int>& rbd::MultiBody::jointsPosInParam ( ) const
inline
Returns
the joint position in parameter vector (q).

◆ nrBodies()

int rbd::MultiBody::nrBodies ( ) const
inline
Returns
Number of bodies.

◆ nrDof()

int rbd::MultiBody::nrDof ( ) const
inline
Returns
Total number of DoF.

◆ nrJoints()

int rbd::MultiBody::nrJoints ( ) const
inline
Returns
Number of joints.

◆ nrParams()

int rbd::MultiBody::nrParams ( ) const
inline
Returns
Total number of parameters.

◆ parent()

int rbd::MultiBody::parent ( int  num) const
inline
Returns
Parent body of body num.

◆ parents()

const std::vector<int>& rbd::MultiBody::parents ( ) const
inline
Returns
Parent body index of each body.

◆ predecessor()

int rbd::MultiBody::predecessor ( int  num) const
inline
Returns
Predecessor body of joint num.

◆ predecessors()

const std::vector<int>& rbd::MultiBody::predecessors ( ) const
inline
Returns
Predeccesor body index of each joint.

◆ sBodies()

void rbd::MultiBody::sBodies ( std::vector< Body b)
inline

Safe version of

See also
bodies.
Exceptions
std::runtime_error.

◆ sBody() [1/2]

const Body& rbd::MultiBody::sBody ( int  num) const
inline

Safe version of

See also
body.
Exceptions
std::out_of_range.

◆ sBody() [2/2]

void rbd::MultiBody::sBody ( int  num,
const Body b 
)
inline

Safe version of

See also
body.
Exceptions
std::out_of_range.

◆ sBodyIndexByName()

int rbd::MultiBody::sBodyIndexByName ( const std::string &  name) const
inline

Safe version of

See also
bodyIndexByName.
Exceptions
std::out_of_range

◆ sJoint()

const Joint& rbd::MultiBody::sJoint ( int  num) const
inline

Safe version of

See also
joint.
Exceptions
std::out_of_range.

◆ sJointIndexByName()

int rbd::MultiBody::sJointIndexByName ( const std::string &  name) const
inline

Safe version of

See also
jointIndexByName.
Exceptions
std::out_of_range

◆ sJointPosInDof()

int rbd::MultiBody::sJointPosInDof ( int  i) const
inline

Safe version of

See also
jointPosInDof.
Exceptions
std::out_of_range.

◆ sJointPosInParam()

int rbd::MultiBody::sJointPosInParam ( int  i) const
inline

Safe version of

See also
jointPosInParam.
Exceptions
std::out_of_range.

◆ sParent()

int rbd::MultiBody::sParent ( int  num) const
inline

Safe version of

See also
parent.
Exceptions
std::out_of_range.

◆ sPredecessor()

int rbd::MultiBody::sPredecessor ( int  num) const
inline

Safe version of

See also
predecessor.
Exceptions
std::out_of_range.

◆ sSuccessor()

int rbd::MultiBody::sSuccessor ( int  num) const
inline

Safe version of

See also
successor.
Exceptions
std::out_of_range.

◆ sTransform() [1/2]

const sva::PTransformd& rbd::MultiBody::sTransform ( int  num) const
inline

Safe version of

See also
transform.
Exceptions
std::out_of_range.

◆ sTransform() [2/2]

void rbd::MultiBody::sTransform ( int  num,
const sva::PTransformd &  Xt 
)
inline

Safe version of

See also
transform.
Exceptions
std::out_of_range.

◆ sTransforms()

void rbd::MultiBody::sTransforms ( std::vector< sva::PTransformd >  Xt)
inline

Safe version of

See also
transforms.
Exceptions
std::runtime_error.

◆ successor()

int rbd::MultiBody::successor ( int  num) const
inline
Returns
Successor body of joint num.

◆ successors()

const std::vector<int>& rbd::MultiBody::successors ( ) const
inline
Returns
Successor body index of each joint.

◆ transform() [1/2]

const sva::PTransformd& rbd::MultiBody::transform ( int  num) const
inline
Returns
Transformation from the body base to joint num

◆ transform() [2/2]

void rbd::MultiBody::transform ( int  num,
const sva::PTransformd &  Xt 
)
inline

Set the transformation from the body base to joint num.

◆ transforms() [1/2]

const std::vector<sva::PTransformd>& rbd::MultiBody::transforms ( ) const
inline
Returns
Transformation from the body base to joint i

◆ transforms() [2/2]

void rbd::MultiBody::transforms ( std::vector< sva::PTransformd >  Xt)
inline
Returns
Set Transformation from the body base to joint i

Member Data Documentation

◆ bodies_

std::vector<Body> rbd::MultiBody::bodies_
protected

◆ bodyNameToInd_

std::unordered_map<std::string, int> rbd::MultiBody::bodyNameToInd_
protected

◆ jointNameToInd_

std::unordered_map<std::string, int> rbd::MultiBody::jointNameToInd_
protected

◆ jointPosInDof_

std::vector<int> rbd::MultiBody::jointPosInDof_
protected

Position of joint i in dof vector (velocity, acceleration...).

◆ jointPosInParam_

std::vector<int> rbd::MultiBody::jointPosInParam_
protected

Position of joint i in parameter vector.

◆ joints_

std::vector<Joint> rbd::MultiBody::joints_
protected

◆ nrDof_

int rbd::MultiBody::nrDof_
protected

◆ nrParams_

int rbd::MultiBody::nrParams_
protected

◆ parent_

std::vector<int> rbd::MultiBody::parent_
protected

◆ pred_

std::vector<int> rbd::MultiBody::pred_
protected

◆ succ_

std::vector<int> rbd::MultiBody::succ_
protected

◆ Xt_

std::vector<sva::PTransformd> rbd::MultiBody::Xt_
protected

Transformation from the body base to joint i.


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