hpp::pinocchio::CenterOfMassComputation Class Reference

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< JointIndexJointRootIndexes_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_tcom () const
 Get center of mass of the subtree. More...
 
const value_typemass () const
 Get mass of the sub-tree. More...
 
const ComJacobian_tjacobian () const
 Get Jacobian of center of mass of the sub-tree. More...
 
const JointRootIndexes_troots () 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)
 

Detailed Description

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.

Member Typedef Documentation

Constructor & Destructor Documentation

hpp::pinocchio::CenterOfMassComputation::~CenterOfMassComputation ( )

Referenced by roots().

hpp::pinocchio::CenterOfMassComputation::CenterOfMassComputation ( const DevicePtr_t device)
protected

Referenced by roots().

Member Function Documentation

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.

const vector3_t& hpp::pinocchio::CenterOfMassComputation::com ( ) const
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 CenterOfMassComputationPtr_t hpp::pinocchio::CenterOfMassComputation::create ( const DevicePtr_t device)
static

Create instance and return shared pointer.

Do not forget to call method add to specify the root joint of relevant kinematic tree.

const ComJacobian_t& hpp::pinocchio::CenterOfMassComputation::jacobian ( ) const
inline

Get Jacobian of center of mass of the sub-tree.

References pinocchio::DataTpl< _Scalar, _Options, JointCollectionTpl >::Jcom.

const value_type& hpp::pinocchio::CenterOfMassComputation::mass ( ) const
inline
const JointRootIndexes_t& hpp::pinocchio::CenterOfMassComputation::roots ( ) const
inline

Get const reference to the vector of sub-tree roots.

References CenterOfMassComputation(), and ~CenterOfMassComputation().