Template Function pinocchio::centerOfMass(const ModelTpl<Scalar, Options, JointCollectionTpl>&, DataTpl<Scalar, Options, JointCollectionTpl>&, KinematicLevel, const bool)
Defined in File center-of-mass.hpp
Function Documentation
-
template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
const DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &pinocchio::centerOfMass(const ModelTpl<Scalar, Options, JointCollectionTpl> &model, DataTpl<Scalar, Options, JointCollectionTpl> &data, KinematicLevel kinematic_level, const bool computeSubtreeComs = true) Computes the center of mass position, velocity and acceleration of a given model according to the current kinematic values contained in data and the requested kinematic_level. The result is accessible through data.com[0], data.vcom[0] and data.acom[0] for the full body com position and velocity. And data.com[i] and data.vcom[i] for the subtree supported by joint i (expressed in the joint i frame).
- Template Parameters:
JointCollection – Collection of Joint types.
- Parameters:
model – [in] The model structure of the rigid body system.
data – [in] The data structure of the rigid body system.
kinematic_level – [in] if = POSITION, computes the CoM position, if = VELOCITY, also computes the CoM velocity and if = ACCELERATION, it also computes the CoM acceleration.
computeSubtreeComs – [in] If true, the algorithm computes also the center of mass of the subtrees.