Template Function pinocchio::computeMechanicalEnergy(const ModelTpl<Scalar, Options, JointCollectionTpl>&, DataTpl<Scalar, Options, JointCollectionTpl>&, const Eigen::MatrixBase<ConfigVectorType>&, const Eigen::MatrixBase<TangentVectorType>&)
Defined in File energy.hxx
Function Documentation
-
template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl, typename ConfigVectorType, typename TangentVectorType>
Scalar pinocchio::computeMechanicalEnergy(const ModelTpl<Scalar, Options, JointCollectionTpl> &model, DataTpl<Scalar, Options, JointCollectionTpl> &data, const Eigen::MatrixBase<ConfigVectorType> &q, const Eigen::MatrixBase<TangentVectorType> &v) Computes the mechanical energy of the system stored in data.mechanical_energy. The result is accessible through data.kinetic_energy.
- Template Parameters:
JointCollection – Collection of Joint types.
ConfigVectorType – Type of the joint configuration vector.
TangentVectorType – Type of the joint velocity vector.
- Parameters:
model – [in] The model structure of the rigid body system.
data – [in] The data structure of the rigid body system.
q – [in] The joint configuration vector (dim model.nq).
v – [in] The joint velocity vector (dim model.nv).
- Returns:
The total mechanal energy of the system in [J]. The fonctions also computes the data.kinetic_energy and data.potential_energy.