hpp-pinocchio  4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
hpp::pinocchio::CenterOfMassComputation Class Reference

#include <hpp/pinocchio/center-of-mass-computation.hh>

Public Types

typedef std::vector< std::size_t > JointRootIndexes_t
 

Public Member Functions

void add (const JointPtr_t &rootOfSubtree)
 
void compute (const Computation_t &flag=COMPUTE_ALL)
 
void compute (DeviceData &data, const Computation_t &flag)
 
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)
 
static const vector3_tcom (const DeviceData &d)
 Get center of mass of the subtree. More...
 
static const value_typemass (const DeviceData &d)
 Get mass of the sub-tree. More...
 
static const ComJacobian_tjacobian (const DeviceData &d)
 Get Jacobian of center of mass of the sub-tree. 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

◆ JointRootIndexes_t

Constructor & Destructor Documentation

◆ ~CenterOfMassComputation()

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

◆ CenterOfMassComputation()

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

Member Function Documentation

◆ add()

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.

◆ com() [1/2]

const vector3_t& hpp::pinocchio::CenterOfMassComputation::com ( ) const
inline

Get center of mass of the subtree.

◆ com() [2/2]

static const vector3_t& hpp::pinocchio::CenterOfMassComputation::com ( const DeviceData d)
inlinestatic

Get center of mass of the subtree.

Parameters
dthe data where results were written (passed to compute(const DeviceData&, const Computation_t&)).

◆ compute() [1/2]

void hpp::pinocchio::CenterOfMassComputation::compute ( const Computation_t flag = COMPUTE_ALL)
inline

Compute the center of mass and Jacobian of the sub-trees.

Parameters
flagselect which values must be computed.

◆ compute() [2/2]

void hpp::pinocchio::CenterOfMassComputation::compute ( DeviceData data,
const Computation_t flag 
)

Compute the center of mass and Jacobian of the sub-trees.

Parameters
flagselect which values must be computed.
datawhere to write results.

◆ create()

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.

◆ jacobian() [1/2]

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

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

◆ jacobian() [2/2]

static const ComJacobian_t& hpp::pinocchio::CenterOfMassComputation::jacobian ( const DeviceData d)
inlinestatic

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

Parameters
dthe data where results were written (passed to compute(const DeviceData&, const Computation_t&)).

◆ mass() [1/2]

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

Get mass of the sub-tree.

◆ mass() [2/2]

static const value_type& hpp::pinocchio::CenterOfMassComputation::mass ( const DeviceData d)
inlinestatic

Get mass of the sub-tree.

Parameters
dthe data where results were written (passed to compute(const DeviceData&, const Computation_t&)).

◆ roots()

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

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


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