Crocoddyl
Loading...
Searching...
No Matches
TaskModelCentroidalMomentumTpl< _Scalar > Class Template Reference

Centroidal-momentum task model. More...

#include <centroidal-momentum.hpp>

Inheritance diagram for TaskModelCentroidalMomentumTpl< _Scalar >:
TaskModelAbstractTpl< _Scalar >TaskModelBase

Public Types

typedef TaskModelAbstractTpl< Scalar > Base
typedef TaskDataCentroidalMomentumTpl< Scalar > Data
typedef DataCollectorAbstractTpl< Scalar > DataCollectorAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef StateMultibodyTpl< Scalar > StateMultibody
typedef TaskDataAbstractTpl< Scalar > TaskDataAbstract
typedef MathBase::Vector6s Vector6s
typedef MathBase::VectorXs VectorXs
Public Types inherited from TaskModelAbstractTpl< _Scalar >
typedef DataCollectorAbstractTpl< Scalar > DataCollectorAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef StateAbstractTpl< Scalar > StateAbstract
typedef TaskDataAbstractTpl< Scalar > TaskDataAbstract
typedef MathBase::VectorXs VectorXs

Public Member Functions

 TaskModelCentroidalMomentumTpl (std::shared_ptr< StateMultibody > state, const Vector6s &href)
 Initialize with a constant momentum reference.
 TaskModelCentroidalMomentumTpl (std::shared_ptr< StateMultibody > state, const Vector6s &href, const std::size_t nu)
 Initialize with a constant momentum reference.
 TaskModelCentroidalMomentumTpl (std::shared_ptr< StateMultibody > state, const Vector6s &href, const Vector6s &hdot_ref)
 Initialize with momentum and momentum-rate references.
 TaskModelCentroidalMomentumTpl (std::shared_ptr< StateMultibody > state, const Vector6s &href, const Vector6s &hdot_ref, const std::size_t nu)
 Initialize with momentum and momentum-rate references.
virtual void calc (const std::shared_ptr< TaskDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override
 Compute the task quantity, rate, and acceleration.
virtual void calcDiff (const std::shared_ptr< TaskDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override
 Compute task Jacobians using values stored by calc().
template<typename NewScalar>
TaskModelCentroidalMomentumTpl< NewScalar > cast () const
virtual std::shared_ptr< TaskDataAbstract > createData (DataCollectorAbstract *const data) override
 Allocate task data and bind it to the action model's shared data.
const Vector6s & get_rate_reference () const
const Vector6s & get_reference () const
virtual void print (std::ostream &os) const override
 Print relevant information about the task model.
void set_rate_reference (const Vector6s &hdot_ref)
void set_reference (const Vector6s &href)
Public Member Functions inherited from TaskModelAbstractTpl< _Scalar >
 TaskModelAbstractTpl (std::shared_ptr< StateAbstract > state, const std::size_t nr, const std::size_t nu, const bool q_dependent=true, const bool v_dependent=true, const bool u_dependent=true, const bool has_acceleration=true)
 Initialize the task model.
bool get_has_acceleration () const
 Return whether the task defines an acceleration component.
std::size_t get_nr () const
std::size_t get_nu () const
bool get_q_dependent () const
const std::shared_ptr< StateAbstract > & get_state () const
bool get_u_dependent () const
bool get_v_dependent () const

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Public Attributes inherited from TaskModelAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Attributes

std::size_t nr_
std::size_t nu_
std::shared_ptr< StateAbstract > state_
Protected Attributes inherited from TaskModelAbstractTpl< _Scalar >
bool has_acceleration_
std::size_t nr_
std::size_t nu_
bool q_dependent_
std::shared_ptr< StateAbstract > state_
bool u_dependent_
bool v_dependent_

Detailed Description

template<typename _Scalar>
class crocoddyl::TaskModelCentroidalMomentumTpl< _Scalar >

Centroidal-momentum task model.

The task quantity and rate are

\‍[  y = h-h_{\mathrm{ref}}, \qquad
  v = \dot h-\dot h_{\mathrm{ref}},
\‍]

with

\‍[  h=A_g(q)\dot q, \qquad
  \dot h=\dot A_g(q,\dot q)\dot q+A_g(q)\ddot q.
\‍]

The model is first-order only: a centroidal-momentum acceleration would require generalized jerk, which is not supplied by differential action models. Therefore, a, Ax, and Au remain zero.

The momentum and momentum-rate values, as well as their partial derivatives at fixed generalized acceleration, are read from the shared Pinocchio data. When shared joint data is available, its acceleration derivatives are used to apply the chain rule with respect to the action-model variables.

Definition at line 42 of file centroidal-momentum.hpp.

Member Typedef Documentation

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

Definition at line 48 of file centroidal-momentum.hpp.

◆ Base

template<typename _Scalar>
typedef TaskModelAbstractTpl<Scalar> Base

Definition at line 49 of file centroidal-momentum.hpp.

◆ Data

template<typename _Scalar>
typedef TaskDataCentroidalMomentumTpl<Scalar> Data

Definition at line 50 of file centroidal-momentum.hpp.

◆ TaskDataAbstract

template<typename _Scalar>
typedef TaskDataAbstractTpl<Scalar> TaskDataAbstract

Definition at line 51 of file centroidal-momentum.hpp.

◆ DataCollectorAbstract

template<typename _Scalar>
typedef DataCollectorAbstractTpl<Scalar> DataCollectorAbstract

Definition at line 52 of file centroidal-momentum.hpp.

◆ StateMultibody

template<typename _Scalar>
typedef StateMultibodyTpl<Scalar> StateMultibody

Definition at line 53 of file centroidal-momentum.hpp.

◆ Vector6s

template<typename _Scalar>
typedef MathBase::Vector6s Vector6s

Definition at line 54 of file centroidal-momentum.hpp.

◆ VectorXs

template<typename _Scalar>
typedef MathBase::VectorXs VectorXs

Definition at line 55 of file centroidal-momentum.hpp.

Constructor & Destructor Documentation

◆ TaskModelCentroidalMomentumTpl() [1/4]

template<typename _Scalar>
TaskModelCentroidalMomentumTpl(std::shared_ptr< StateMultibody >state,
const Vector6s &href,
const Vector6s &hdot_ref,
const std::size_tnu )

Initialize with momentum and momentum-rate references.

Parameters
[in]stateState of the multibody system
[in]hrefReference centroidal momentum
[in]hdot_refReference centroidal-momentum rate
[in]nuDimension of the control vector

◆ TaskModelCentroidalMomentumTpl() [2/4]

template<typename _Scalar>
TaskModelCentroidalMomentumTpl(std::shared_ptr< StateMultibody >state,
const Vector6s &href,
const Vector6s &hdot_ref )

Initialize with momentum and momentum-rate references.

The default control dimension is state.nv.

Parameters
[in]stateState of the multibody system
[in]hrefReference centroidal momentum
[in]hdot_refReference centroidal-momentum rate

◆ TaskModelCentroidalMomentumTpl() [3/4]

template<typename _Scalar>
TaskModelCentroidalMomentumTpl(std::shared_ptr< StateMultibody >state,
const Vector6s &href,
const std::size_tnu )

Initialize with a constant momentum reference.

The momentum-rate reference is zero.

Parameters
[in]stateState of the multibody system
[in]hrefReference centroidal momentum
[in]nuDimension of the control vector

◆ TaskModelCentroidalMomentumTpl() [4/4]

template<typename _Scalar>
TaskModelCentroidalMomentumTpl(std::shared_ptr< StateMultibody >state,
const Vector6s &href )

Initialize with a constant momentum reference.

The momentum-rate reference is zero and the default control dimension is state.nv.

Parameters
[in]stateState of the multibody system
[in]hrefReference centroidal momentum

Member Function Documentation

◆ calc()

template<typename _Scalar>
virtual void calc(const std::shared_ptr< TaskDataAbstract > &data,
const Eigen::Ref< const VectorXs > &x,
const Eigen::Ref< const VectorXs > &u )
overridevirtual

Compute the task quantity, rate, and acceleration.

Implements TaskModelAbstractTpl< _Scalar >.

◆ calcDiff()

template<typename _Scalar>
virtual void calcDiff(const std::shared_ptr< TaskDataAbstract > &data,
const Eigen::Ref< const VectorXs > &x,
const Eigen::Ref< const VectorXs > &u )
overridevirtual

Compute task Jacobians using values stored by calc().

Implements TaskModelAbstractTpl< _Scalar >.

◆ createData()

template<typename _Scalar>
virtual std::shared_ptr< TaskDataAbstract > createData(DataCollectorAbstract *constdata)
overridevirtual

Allocate task data and bind it to the action model's shared data.

Reimplemented from TaskModelAbstractTpl< _Scalar >.

◆ print()

template<typename _Scalar>
virtual void print(std::ostream &os)const
overridevirtual

Print relevant information about the task model.

Reimplemented from TaskModelAbstractTpl< _Scalar >.

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 47 of file centroidal-momentum.hpp.

◆ nr_

template<typename _Scalar>
std::size_t nr_
protected

Definition at line 114 of file task-base.hpp.

◆ nu_

template<typename _Scalar>
std::size_t nu_
protected

Definition at line 115 of file task-base.hpp.

◆ state_

template<typename _Scalar>
std::shared_ptr<StateAbstract> state_
protected

Definition at line 113 of file task-base.hpp.


The documentation for this class was generated from the following files: