Template Function pinocchio::computePotentialEnergy(const ModelTpl<Scalar, Options, JointCollectionTpl>&, DataTpl<Scalar, Options, JointCollectionTpl>&)

Function Documentation

template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
Scalar pinocchio::computePotentialEnergy(const ModelTpl<Scalar, Options, JointCollectionTpl> &model, DataTpl<Scalar, Options, JointCollectionTpl> &data)

Computes the potential energy of the system, i.e. the potential energy linked to the gravity field. The result is accessible through data.potential_energy.

Note

This potential energy are of the for imighi where:

  • mi is the mass of the body i,

  • hi is the height of the body i,

  • g is the gravity value.

Template Parameters:
  • JointCollection – Collection of Joint types.

  • 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.

Returns:

The potential energy of the system expressed in [J].