5 #ifndef __pinocchio_center_of_mass_hpp__ 6 #define __pinocchio_center_of_mass_hpp__ 8 #include "pinocchio/multibody/model.hpp" 9 #include "pinocchio/multibody/data.hpp" 19 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
20 inline Scalar
computeTotalMass(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model);
31 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
32 inline Scalar
computeTotalMass(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
33 DataTpl<Scalar,Options,JointCollectionTpl> & data);
41 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
43 DataTpl<Scalar,Options,JointCollectionTpl> & data);
59 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType>
60 inline const typename DataTpl<Scalar,Options,JointCollectionTpl>::Vector3 &
61 centerOfMass(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
62 DataTpl<Scalar,Options,JointCollectionTpl> & data,
63 const Eigen::MatrixBase<ConfigVectorType> & q,
64 const bool computeSubtreeComs =
true);
83 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType>
84 inline const typename DataTpl<Scalar,Options,JointCollectionTpl>::Vector3 &
85 centerOfMass(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
86 DataTpl<Scalar,Options,JointCollectionTpl> & data,
87 const Eigen::MatrixBase<ConfigVectorType> & q,
88 const Eigen::MatrixBase<TangentVectorType> & v,
89 const bool computeSubtreeComs =
true);
110 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType1,
typename TangentVectorType2>
111 inline const typename DataTpl<Scalar,Options,JointCollectionTpl>::Vector3 &
112 centerOfMass(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
113 DataTpl<Scalar,Options,JointCollectionTpl> & data,
114 const Eigen::MatrixBase<ConfigVectorType> & q,
115 const Eigen::MatrixBase<TangentVectorType1> & v,
116 const Eigen::MatrixBase<TangentVectorType2> & a,
117 const bool computeSubtreeComs =
true);
131 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
132 inline void centerOfMass(
const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
133 DataTpl<Scalar,Options,JointCollectionTpl> & data,
135 const bool computeSubtreeComs =
true);
148 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
151 const bool computeSubtreeComs =
true)
172 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType>
177 const Eigen::MatrixBase<ConfigVectorType> & q,
178 const bool computeSubtreeComs,
179 const bool updateKinematics);
196 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl,
typename ConfigVectorType>
200 const Eigen::MatrixBase<ConfigVectorType> & q,
201 const bool computeSubtreeComs =
true);
218 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
222 const bool computeSubtreeComs =
true);
238 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
239 inline const typename DataTpl<Scalar,Options,JointCollectionTpl>::Vector3 &
256 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
266 #include "pinocchio/algorithm/center-of-mass.hxx" 268 #endif // ifndef __pinocchio_center_of_mass_hpp__ const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix3x & getJacobianComFromCrba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Extracts both the jacobian of the center of mass (CoM), the total mass of the system and the CoM posi...
PINOCCHIO_DEPRECATED const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix3x & jacobianCenterOfMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const bool computeSubtreeComs, const bool updateKinematics)
Computes both the jacobian and the the center of mass position of a given model according to a partic...
Scalar computeTotalMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model)
Compute the total mass of the model and return it.
const DataTpl< Scalar, Options, JointCollectionTpl >::Vector3 & getComFromCrba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Extracts the center of mass position from the joint space inertia matrix (also called the mass matrix...
void computeSubtreeMasses(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Compute the mass of each kinematic subtree and store it in data.mass. The element mass[0] corresponds...
Eigen::Matrix< Scalar, 3, Eigen::Dynamic, Options > Matrix3x
The 3d jacobian type (temporary)
Main pinocchio namespace.
const DataTpl< Scalar, Options, JointCollectionTpl >::Vector3 & centerOfMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const bool computeSubtreeComs=true)
Computes the center of mass position of a given model according to a particular joint configuration...