hpp-pinocchio
4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
|
#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_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) |
static const vector3_t & | com (const DeviceData &d) |
Get center of mass of the subtree. More... | |
static const value_type & | mass (const DeviceData &d) |
Get mass of the sub-tree. More... | |
static const ComJacobian_t & | jacobian (const DeviceData &d) |
Get Jacobian of center of mass of the sub-tree. 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<std::size_t> hpp::pinocchio::CenterOfMassComputation::JointRootIndexes_t |
hpp::pinocchio::CenterOfMassComputation::~CenterOfMassComputation | ( | ) |
|
protected |
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.
|
inlinestatic |
Get center of mass of the subtree.
d | the data where results were written (passed to compute(const DeviceData&, const Computation_t&)). |
|
inline |
Compute the center of mass and Jacobian of the sub-trees.
flag | select which values must be computed. |
void hpp::pinocchio::CenterOfMassComputation::compute | ( | DeviceData & | data, |
const Computation_t & | flag | ||
) |
Compute the center of mass and Jacobian of the sub-trees.
flag | select which values must be computed. |
data | where to write results. |
|
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.
|
inlinestatic |
Get Jacobian of center of mass of the sub-tree.
d | the data where results were written (passed to compute(const DeviceData&, const Computation_t&)). |
|
inline |
Get mass of the sub-tree.
|
inlinestatic |
Get mass of the sub-tree.
d | the data where results were written (passed to compute(const DeviceData&, const Computation_t&)). |
|
inline |
Get const reference to the vector of sub-tree roots.