5 #ifndef __pinocchio_algorithm_center_of_mass_hpp__
6 #define __pinocchio_algorithm_center_of_mass_hpp__
8 #include "pinocchio/multibody/model.hpp"
9 #include "pinocchio/multibody/data.hpp"
21 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
35 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
50 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
76 template<
typename,
int>
class JointCollectionTpl,
77 typename ConfigVectorType>
78 const typename DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &
centerOfMass(
81 const Eigen::MatrixBase<ConfigVectorType> & q,
82 const bool computeSubtreeComs =
true);
108 template<
typename,
int>
class JointCollectionTpl,
109 typename ConfigVectorType,
110 typename TangentVectorType>
111 const typename DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &
centerOfMass(
114 const Eigen::MatrixBase<ConfigVectorType> & q,
115 const Eigen::MatrixBase<TangentVectorType> & v,
116 const bool computeSubtreeComs =
true);
144 template<
typename,
int>
class JointCollectionTpl,
145 typename ConfigVectorType,
146 typename TangentVectorType1,
147 typename TangentVectorType2>
148 const typename DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &
centerOfMass(
151 const Eigen::MatrixBase<ConfigVectorType> & q,
152 const Eigen::MatrixBase<TangentVectorType1> & v,
153 const Eigen::MatrixBase<TangentVectorType2> & a,
154 const bool computeSubtreeComs =
true);
172 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
173 const typename DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &
centerOfMass(
177 const bool computeSubtreeComs =
true);
193 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
194 const typename DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &
centerOfMass(
197 const bool computeSubtreeComs =
true)
225 template<
typename,
int>
class JointCollectionTpl,
226 typename ConfigVectorType>
230 const Eigen::MatrixBase<ConfigVectorType> & q,
231 const bool computeSubtreeComs =
true);
253 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
257 const bool computeSubtreeComs =
true);
279 template<
typename,
int>
class JointCollectionTpl,
280 typename ConfigVectorType,
281 typename Matrix3xLike>
285 const Eigen::MatrixBase<ConfigVectorType> & q,
286 const JointIndex & rootSubtreeId,
287 const Eigen::MatrixBase<Matrix3xLike> & res);
306 template<
typename,
int>
class JointCollectionTpl,
307 typename Matrix3xLike>
311 const JointIndex & rootSubtreeId,
312 const Eigen::MatrixBase<Matrix3xLike> & res);
332 template<
typename,
int>
class JointCollectionTpl,
333 typename Matrix3xLike>
337 const JointIndex & rootSubtreeId,
338 const Eigen::MatrixBase<Matrix3xLike> & res);
358 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
359 const typename DataTpl<Scalar, Options, JointCollectionTpl>::Vector3 &
getComFromCrba(
378 template<
typename Scalar,
int Options,
template<
typename,
int>
class JointCollectionTpl>
388 #include "pinocchio/algorithm/center-of-mass.hxx"
390 #if PINOCCHIO_ENABLE_TEMPLATE_INSTANTIATION
391 #include "pinocchio/algorithm/center-of-mass.txx"
KinematicLevel
List of Kinematics Level supported by Pinocchio.
Main pinocchio namespace.
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...
Scalar computeTotalMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model)
Compute the total mass of the model and return it.
void jacobianSubtreeCenterOfMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const JointIndex &rootSubtreeId, const Eigen::MatrixBase< Matrix3xLike > &res)
Computes the Jacobian of the center of mass of the given subtree according to a particular joint conf...
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=true)
Computes both the jacobian and the the center of mass position of a given model according to a partic...
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....
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...
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 getJacobianSubtreeCenterOfMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const JointIndex &rootSubtreeId, const Eigen::MatrixBase< Matrix3xLike > &res)
Retrieves the Jacobian of the center of mass of the given subtree according to the current value stor...
Eigen::Matrix< Scalar, 3, Eigen::Dynamic, Options > Matrix3x
The 3d jacobian type (temporary)