First-order task residual for a generic task and guidance model. More...
#include <task-first-order.hpp>
Public Types | |
| typedef ResidualModelAbstractTpl< Scalar > | Base |
| typedef ResidualDataTaskFirstOrderTpl< Scalar > | Data |
| typedef DataCollectorAbstractTpl< Scalar > | DataCollectorAbstract |
| typedef GuidanceModelAbstractTpl< Scalar > | GuidanceModelAbstract |
| typedef MathBaseTpl< Scalar > | MathBase |
| typedef ResidualDataAbstractTpl< Scalar > | ResidualDataAbstract |
| typedef TaskModelAbstractTpl< Scalar > | TaskModelAbstract |
| typedef MathBase::VectorXs | VectorXs |
| Public Types inherited from ResidualModelAbstractTpl< _Scalar > | |
| typedef ActivationDataAbstractTpl< Scalar > | ActivationDataAbstract |
| typedef CostDataAbstractTpl< Scalar > | CostDataAbstract |
| typedef DataCollectorAbstractTpl< Scalar > | DataCollectorAbstract |
| typedef MathBase::DiagonalMatrixXs | DiagonalMatrixXs |
| typedef MathBaseTpl< Scalar > | MathBase |
| typedef MathBase::MatrixXs | MatrixXs |
| typedef ResidualDataAbstractTpl< Scalar > | ResidualDataAbstract |
| typedef StateAbstractTpl< Scalar > | StateAbstract |
| typedef MathBase::VectorXs | VectorXs |
Public Member Functions | |
| ResidualModelTaskFirstOrderTpl (std::shared_ptr< TaskModelAbstract > task, std::shared_ptr< GuidanceModelAbstract > guidance) | |
| Initialize the first-order task residual. | |
| virtual void | calc (const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override |
| Compute the first-order task residual. | |
| virtual void | calcDiff (const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override |
| Compute the residual Jacobians. | |
| template<typename NewScalar> | |
| ResidualModelTaskFirstOrderTpl< NewScalar > | cast () const |
| Cast the residual model to a different scalar type. | |
| virtual std::shared_ptr< ResidualDataAbstract > | createData (DataCollectorAbstract *const data) override |
| Allocate data for the residual. | |
| const std::shared_ptr< GuidanceModelAbstract > & | get_guidance () const |
| const std::shared_ptr< TaskModelAbstract > & | get_task () const |
| virtual void | print (std::ostream &os) const override |
| Print relevant information of the residual model. | |
| void | set_guidance (std::shared_ptr< GuidanceModelAbstract > guidance) |
| Public Member Functions inherited from ResidualModelAbstractTpl< _Scalar > | |
| ResidualModelAbstractTpl (std::shared_ptr< StateAbstract > state, const std::size_t nr, const bool q_dependent=true, const bool v_dependent=true, const bool u_dependent=true) | |
| Initialize the residual model. | |
| ResidualModelAbstractTpl (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) | |
| Initialize the residual model. | |
| virtual void | calc (const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the residual vector for nodes that depends only on the state. | |
| virtual void | calcCostDiff (const std::shared_ptr< CostDataAbstract > &cdata, const std::shared_ptr< ResidualDataAbstract > &rdata, const std::shared_ptr< ActivationDataAbstract > &adata, const bool update_u=true) |
| Compute the derivative of the cost function. | |
| virtual void | calcDiff (const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the Jacobian of the residual functions with respect to the state only. | |
| std::size_t | get_nr () const |
| Return the dimension of the residual vector. | |
| std::size_t | get_nu () const |
| Return the dimension of the control input. | |
| bool | get_q_dependent () const |
| Return true if the residual function depends on q. | |
| const std::shared_ptr< StateAbstract > & | get_state () const |
| Return the state. | |
| bool | get_u_dependent () const |
| Return true if the residual function depends on u. | |
| bool | get_v_dependent () const |
| Return true if the residual function depends on v. | |
Public Attributes | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
| Public Attributes inherited from ResidualModelAbstractTpl< _Scalar > | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Protected Member Functions | |
| void | checkDimensions () const |
Protected Attributes | |
| std::shared_ptr< GuidanceModelAbstract > | guidance_ |
| std::size_t | nr_ |
| Residual vector dimension. | |
| std::size_t | nu_ |
| Control dimension. | |
| bool | q_dependent_ |
| std::shared_ptr< StateAbstract > | state_ |
| State description. | |
| std::shared_ptr< TaskModelAbstract > | task_ |
| bool | u_dependent_ |
| bool | v_dependent_ |
| Protected Attributes inherited from ResidualModelAbstractTpl< _Scalar > | |
| std::size_t | nr_ |
| Residual vector dimension. | |
| std::size_t | nu_ |
| Control dimension. | |
| bool | q_dependent_ |
| std::shared_ptr< StateAbstract > | state_ |
| State description. | |
| bool | u_dependent_ |
| VectorXs | unone_ |
| No control vector. | |
| bool | v_dependent_ |
First-order task residual for a generic task and guidance model.
The running residual is
![\[ r = v(x, u) - g(y(x, u)),
\]](form_159.png)
where 


This class deliberately keeps the abstraction narrow: the task model owns the task geometry and its derivatives, while the guidance model owns the desired-rate profile.
The residual Jacobians are
![\[ R_x = V_x - G_e Y_x, \qquad R_u = V_u - G_e Y_u,
\]](form_163.png)
where 
Definition at line 40 of file task-first-order.hpp.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 47 of file task-first-order.hpp.
| typedef ResidualModelAbstractTpl<Scalar> Base |
Definition at line 48 of file task-first-order.hpp.
| typedef ResidualDataTaskFirstOrderTpl<Scalar> Data |
Definition at line 49 of file task-first-order.hpp.
| typedef ResidualDataAbstractTpl<Scalar> ResidualDataAbstract |
Definition at line 50 of file task-first-order.hpp.
| typedef DataCollectorAbstractTpl<Scalar> DataCollectorAbstract |
Definition at line 51 of file task-first-order.hpp.
| typedef GuidanceModelAbstractTpl<Scalar> GuidanceModelAbstract |
Definition at line 52 of file task-first-order.hpp.
| typedef TaskModelAbstractTpl<Scalar> TaskModelAbstract |
Definition at line 53 of file task-first-order.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 54 of file task-first-order.hpp.
| ResidualModelTaskFirstOrderTpl | ( | std::shared_ptr< TaskModelAbstract > | task, |
| std::shared_ptr< GuidanceModelAbstract > | guidance ) |
Initialize the first-order task residual.
The residual is
![\[ r = v - g(y),
\]](form_167.png)
where 


The residual Jacobians are
![\[ R_x = V_x - G_e Y_x, \qquad R_u = V_u - G_e Y_u,
\]](form_163.png)
where 
| [in] | task | Task model |
| [in] | guidance | Guidance model |
| overridevirtual |
Compute the first-order task residual.
This evaluates
![\[ r = v - g(y).
\]](form_169.png)
Reimplemented from ResidualModelAbstractTpl< _Scalar >.
| overridevirtual |
Compute the residual Jacobians.
This evaluates
![\[ R_x = V_x - G_e Y_x, \qquad R_u = V_u - G_e Y_u.
\]](form_170.png)
Reimplemented from ResidualModelAbstractTpl< _Scalar >.
| overridevirtual |
Allocate data for the residual.
Reimplemented from ResidualModelAbstractTpl< _Scalar >.
| overridevirtual |
Print relevant information of the residual model.
| [out] | os | Output stream object |
Reimplemented from ResidualModelAbstractTpl< _Scalar >.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 46 of file task-first-order.hpp.
| protected |
Definition at line 132 of file task-first-order.hpp.
| protected |
Definition at line 133 of file task-first-order.hpp.
| protected |
Residual vector dimension.
Definition at line 231 of file residual-base.hpp.
| protected |
Control dimension.
Definition at line 232 of file residual-base.hpp.
| protected |
Label that indicates if the residual function depends on q
Definition at line 234 of file residual-base.hpp.
| protected |
State description.
Definition at line 230 of file residual-base.hpp.
| protected |
Label that indicates if the residual function depends on u
Definition at line 238 of file residual-base.hpp.
| protected |
Label that indicates if the residual function depends on v
Definition at line 236 of file residual-base.hpp.