Crocoddyl
Loading...
Searching...
No Matches
TaskModelAbstractTpl< _Scalar > Class Template Referenceabstract

Abstract task model for convergence residuals. More...

#include <task-base.hpp>

Inheritance diagram for TaskModelAbstractTpl< _Scalar >:
TaskModelBaseTaskModelCentroidalMomentumTpl< _Scalar >TaskModelCoMPositionTpl< _Scalar >TaskModelFramePlacementTpl< _Scalar >TaskModelFrameRotationTpl< _Scalar >TaskModelFrameTranslationTpl< _Scalar >TaskModelJointPositionTpl< _Scalar >

Public Types

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

 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.
virtual void calc (const std::shared_ptr< TaskDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0
 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)=0
 Compute task Jacobians using values stored by calc().
virtual std::shared_ptr< TaskDataAbstract > createData (DataCollectorAbstract *const data)
 Allocate task data and bind it to the action model's shared data.
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
virtual void print (std::ostream &os) const
 Print relevant information about the task model.

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Attributes

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::TaskModelAbstractTpl< _Scalar >

Abstract task model for convergence residuals.

A task model supplies a same-dimensional quantity, rate, and acceleration:

\‍[  y(x,u), \qquad v(x,u)=\dot y, \qquad a(x,u)=\ddot y,
\‍]

together with their Jacobians with respect to Crocoddyl's state tangent and control coordinates.

Concrete implementations own the task geometry and obtain cached robot quantities from the shared DataCollectorAbstract passed to createData(). They must not launch a second dynamics pipeline inside calc() or calcDiff(). The task data includes a per-evaluation flag that can disable acceleration computations when only first-order convergence is requested.

A first-order model needs to populate y, v, Yx, Yu, Vx, and Vu. A second-order model additionally populates a, Ax, and Au. Unused quantities should remain zero.

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

Member Typedef Documentation

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

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

◆ StateAbstract

template<typename _Scalar>
typedef StateAbstractTpl<Scalar> StateAbstract

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

◆ DataCollectorAbstract

template<typename _Scalar>
typedef DataCollectorAbstractTpl<Scalar> DataCollectorAbstract

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

◆ TaskDataAbstract

template<typename _Scalar>
typedef TaskDataAbstractTpl<Scalar> TaskDataAbstract

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

◆ VectorXs

template<typename _Scalar>
typedef MathBase::VectorXs VectorXs

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

◆ MatrixXs

template<typename _Scalar>
typedef MathBase::MatrixXs MatrixXs

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

Constructor & Destructor Documentation

◆ TaskModelAbstractTpl()

template<typename _Scalar>
TaskModelAbstractTpl(std::shared_ptr< StateAbstract >state,
const std::size_tnr,
const std::size_tnu,
const boolq_dependent = true,
const boolv_dependent = true,
const boolu_dependent = true,
const boolhas_acceleration = true )

Initialize the task model.

Parameters
[in]stateState of the dynamical system
[in]nrDimension of the task vectors
[in]nuDimension of the control vector
[in]q_dependentWhether the task depends on configuration
[in]v_dependentWhether the task depends on velocity
[in]u_dependentWhether the task depends on control
[in]has_accelerationWhether the task defines $a, A_x, A_u$

Member Function Documentation

◆ calc()

◆ calcDiff()

◆ createData()

◆ print()

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

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

◆ state_

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

Definition at line 113 of file task-base.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.

◆ q_dependent_

template<typename _Scalar>
bool q_dependent_
protected

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

◆ v_dependent_

template<typename _Scalar>
bool v_dependent_
protected

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

◆ u_dependent_

template<typename _Scalar>
bool u_dependent_
protected

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

◆ has_acceleration_

template<typename _Scalar>
bool has_acceleration_
protected

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


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