Skip to content

Commit

Permalink
add option 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cfather authored and jcarpent committed Sep 22, 2024
1 parent 010d6c8 commit 252effb
Show file tree
Hide file tree
Showing 3 changed files with 230 additions and 218 deletions.
74 changes: 37 additions & 37 deletions include/pinocchio/algorithm/rnea.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,43 +80,6 @@ namespace pinocchio
const Eigen::MatrixBase<TangentVectorType2> & a,
const container::aligned_vector<ForceDerived> & fext);

///
/// \brief The passivity-based Recursive Newton-Euler algorithm. It computes a modified inverse dynamics, aka the joint
/// torques according to the current state of the system and the auxiliary joint velocities and accelerations.
/// To be more specific, it computes H(q) * a_r + C(q, v) * v_r + g(q)
///
/// \tparam JointCollection Collection of Joint types.
/// \tparam ConfigVectorType Type of the joint configuration vector.
/// \tparam TangentVectorType1 Type of the joint velocity vector.
/// \tparam TangentVectorType2 Type of the auxiliary joint velocity vector.
/// \tparam TangentVectorType3 Type of the auxiliary joint acceleration vector.
///
/// \param[in] model The model structure of the rigid body system.
/// \param[in] data The data structure of the rigid body system.
/// \param[in] q The joint configuration vector (dim model.nq).
/// \param[in] v The joint velocity vector (dim model.nv).
/// \param[in] v_r The auxiliary joint velocity vector (dim model.nv).
/// \param[in] a_r The auxiliary joint acceleration vector (dim model.nv).
///
/// \return The desired joint torques stored in data.tau.
///
template<
typename Scalar,
int Options,
template<typename, int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType1,
typename TangentVectorType2,
typename TangentVectorType3>
const typename DataTpl<Scalar, Options, JointCollectionTpl>::TangentVectorType & passivityRNEA(
const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
DataTpl<Scalar, Options, JointCollectionTpl> & data,
const Eigen::MatrixBase<ConfigVectorType> & q,
const Eigen::MatrixBase<TangentVectorType1> & v,
const Eigen::MatrixBase<TangentVectorType2> & v_r,
const Eigen::MatrixBase<TangentVectorType3> & a_r);

///
/// \brief Computes the non-linear effects (Corriolis, centrifual and gravitationnal effects),
/// also called the bias terms \f$ b(q,\dot{q}) \f$ of the Lagrangian dynamics: <CENTER> \f$
Expand Down Expand Up @@ -258,6 +221,43 @@ namespace pinocchio
const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
DataTpl<Scalar, Options, JointCollectionTpl> & data);

///
/// \brief The passivity-based Recursive Newton-Euler algorithm. It computes a modified inverse dynamics, aka the joint
/// torques according to the current state of the system and the auxiliary joint velocities and accelerations.
/// To be more specific, it computes H(q) * a_r + C(q, v) * v_r + g(q)
///
/// \tparam JointCollection Collection of Joint types.
/// \tparam ConfigVectorType Type of the joint configuration vector.
/// \tparam TangentVectorType1 Type of the joint velocity vector.
/// \tparam TangentVectorType2 Type of the auxiliary joint velocity vector.
/// \tparam TangentVectorType3 Type of the auxiliary joint acceleration vector.
///
/// \param[in] model The model structure of the rigid body system.
/// \param[in] data The data structure of the rigid body system.
/// \param[in] q The joint configuration vector (dim model.nq).
/// \param[in] v The joint velocity vector (dim model.nv).
/// \param[in] v_r The auxiliary joint velocity vector (dim model.nv).
/// \param[in] a_r The auxiliary joint acceleration vector (dim model.nv).
///
/// \return The desired joint torques stored in data.tau.
///
template<
typename Scalar,
int Options,
template<typename, int>
class JointCollectionTpl,
typename ConfigVectorType,
typename TangentVectorType1,
typename TangentVectorType2,
typename TangentVectorType3>
const typename DataTpl<Scalar, Options, JointCollectionTpl>::TangentVectorType & passivityRNEA(
const ModelTpl<Scalar, Options, JointCollectionTpl> & model,
DataTpl<Scalar, Options, JointCollectionTpl> & data,
const Eigen::MatrixBase<ConfigVectorType> & q,
const Eigen::MatrixBase<TangentVectorType1> & v,
const Eigen::MatrixBase<TangentVectorType2> & v_r,
const Eigen::MatrixBase<TangentVectorType3> & a_r);

} // namespace pinocchio

/* --- Details -------------------------------------------------------------------- */
Expand Down
Loading

0 comments on commit 252effb

Please sign in to comment.