Computation of the center of mass of a subtree of a kinematic tree. More...
#include <hpp/pinocchio/center-of-mass-computation.hh>
Public Types | |
typedef std::vector< JointIndex > | JointRootIndexes_t |
Public Member Functions | |
void | add (const JointPtr_t &rootOfSubtree) |
Add a subtree to the computation of the center of mass. More... | |
void | compute (const Computation_t &flag=COMPUTE_ALL) |
Compute the center of mass and Jacobian of the sub-trees. More... | |
const vector3_t & | com () const |
Get center of mass of the subtree. More... | |
const value_type & | mass () const |
Get mass of the sub-tree. More... | |
const ComJacobian_t & | jacobian () const |
Get Jacobian of center of mass of the sub-tree. More... | |
const JointRootIndexes_t & | roots () const |
Get const reference to the vector of sub-tree roots. More... | |
~CenterOfMassComputation () | |
Static Public Member Functions | |
static CenterOfMassComputationPtr_t | create (const DevicePtr_t &device) |
Create instance and return shared pointer. More... | |
Protected Member Functions | |
CenterOfMassComputation (const DevicePtr_t &device) | |
Computation of the center of mass of a subtree of a kinematic tree.
To use this class, create an instance using CenterOfMassComputation::create method and call method CenterOfMassComputation::add with parameter the root joint of the subtree.
In most cases, the root joint of the subtree is the root joint of the robot (hpp::pinocchio::Device::rootJoint ()), but in a manipulation context, the kinematic tree contains several robots and objects. This class enables users to compute the center of mass of only one robot or object.
typedef std::vector<JointIndex> hpp::pinocchio::CenterOfMassComputation::JointRootIndexes_t |
hpp::pinocchio::CenterOfMassComputation::~CenterOfMassComputation | ( | ) |
Referenced by roots().
|
protected |
Referenced by roots().
void hpp::pinocchio::CenterOfMassComputation::add | ( | const JointPtr_t & | rootOfSubtree | ) |
Add a subtree to the computation of the center of mass.
When several subtrees are provided, method compute
computes the center of mass of the union of the subtrees.
|
inline |
Get center of mass of the subtree.
References pinocchio::DataTpl< _Scalar, _Options, JointCollectionTpl >::com.
void hpp::pinocchio::CenterOfMassComputation::compute | ( | const Computation_t & | flag = COMPUTE_ALL | ) |
Compute the center of mass and Jacobian of the sub-trees.
|
static |
Create instance and return shared pointer.
Do not forget to call method add to specify the root joint of relevant kinematic tree.
|
inline |
Get Jacobian of center of mass of the sub-tree.
References pinocchio::DataTpl< _Scalar, _Options, JointCollectionTpl >::Jcom.
|
inline |
Get mass of the sub-tree.
References pinocchio::DataTpl< _Scalar, _Options, JointCollectionTpl >::mass.
|
inline |
Get const reference to the vector of sub-tree roots.
References CenterOfMassComputation(), and ~CenterOfMassComputation().