Abstract task model for convergence residuals. More...
#include <task-base.hpp>
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_ |
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,
\]](form_324.png)
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.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 52 of file task-base.hpp.
| typedef StateAbstractTpl<Scalar> StateAbstract |
Definition at line 53 of file task-base.hpp.
| typedef DataCollectorAbstractTpl<Scalar> DataCollectorAbstract |
Definition at line 54 of file task-base.hpp.
| typedef TaskDataAbstractTpl<Scalar> TaskDataAbstract |
Definition at line 55 of file task-base.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 56 of file task-base.hpp.
| typedef MathBase::MatrixXs MatrixXs |
Definition at line 57 of file task-base.hpp.
| 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.
| [in] | state | State of the dynamical system |
| [in] | nr | Dimension of the task vectors |
| [in] | nu | Dimension of the control vector |
| [in] | q_dependent | Whether the task depends on configuration |
| [in] | v_dependent | Whether the task depends on velocity |
| [in] | u_dependent | Whether the task depends on control |
| [in] | has_acceleration | Whether the task defines |
| pure virtual |
Compute the task quantity, rate, and acceleration.
Implemented in TaskModelCentroidalMomentumTpl< _Scalar >, TaskModelCentroidalMomentumTpl< double >, TaskModelCoMPositionTpl< _Scalar >, TaskModelCoMPositionTpl< double >, TaskModelFramePlacementTpl< _Scalar >, TaskModelFramePlacementTpl< double >, TaskModelFrameRotationTpl< _Scalar >, TaskModelFrameRotationTpl< double >, TaskModelFrameTranslationTpl< _Scalar >, TaskModelFrameTranslationTpl< double >, TaskModelJointPositionTpl< _Scalar >, and TaskModelJointPositionTpl< double >.
| pure virtual |
Compute task Jacobians using values stored by calc().
Implemented in TaskModelCentroidalMomentumTpl< _Scalar >, TaskModelCentroidalMomentumTpl< double >, TaskModelCoMPositionTpl< _Scalar >, TaskModelCoMPositionTpl< double >, TaskModelFramePlacementTpl< _Scalar >, TaskModelFramePlacementTpl< double >, TaskModelFrameRotationTpl< _Scalar >, TaskModelFrameRotationTpl< double >, TaskModelFrameTranslationTpl< _Scalar >, TaskModelFrameTranslationTpl< double >, TaskModelJointPositionTpl< _Scalar >, and TaskModelJointPositionTpl< double >.
| virtual |
Allocate task data and bind it to the action model's shared data.
Reimplemented in TaskModelCentroidalMomentumTpl< _Scalar >, TaskModelCentroidalMomentumTpl< double >, TaskModelCoMPositionTpl< _Scalar >, TaskModelCoMPositionTpl< double >, TaskModelFramePlacementTpl< _Scalar >, TaskModelFramePlacementTpl< double >, TaskModelFrameRotationTpl< _Scalar >, TaskModelFrameRotationTpl< double >, TaskModelFrameTranslationTpl< _Scalar >, TaskModelFrameTranslationTpl< double >, TaskModelJointPositionTpl< _Scalar >, and TaskModelJointPositionTpl< double >.
| virtual |
Print relevant information about the task model.
Reimplemented in TaskModelCentroidalMomentumTpl< _Scalar >, TaskModelCentroidalMomentumTpl< double >, TaskModelCoMPositionTpl< _Scalar >, TaskModelCoMPositionTpl< double >, TaskModelFramePlacementTpl< _Scalar >, TaskModelFramePlacementTpl< double >, TaskModelFrameRotationTpl< _Scalar >, TaskModelFrameRotationTpl< double >, TaskModelFrameTranslationTpl< _Scalar >, TaskModelFrameTranslationTpl< double >, TaskModelJointPositionTpl< _Scalar >, and TaskModelJointPositionTpl< double >.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 51 of file task-base.hpp.
| protected |
Definition at line 113 of file task-base.hpp.
| protected |
Definition at line 114 of file task-base.hpp.
| protected |
Definition at line 115 of file task-base.hpp.
| protected |
Definition at line 116 of file task-base.hpp.
| protected |
Definition at line 117 of file task-base.hpp.
| protected |
Definition at line 118 of file task-base.hpp.
| protected |
Definition at line 119 of file task-base.hpp.