aligator
0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
|
A stage in the control problem. More...
#include <aligator/core/stage-model.hpp>
Public Types | |
using | Scalar = _Scalar |
using | Manifold = ManifoldAbstractTpl<Scalar> |
using | ManifoldPtr = shared_ptr<Manifold> |
using | Dynamics = DynamicsModelTpl<Scalar> |
using | DynamicsPtr = shared_ptr<Dynamics> |
using | FunctionPtr = shared_ptr<StageFunctionTpl<Scalar>> |
using | ConstraintSetPtr = shared_ptr<ConstraintSetBase<Scalar>> |
using | Constraint = StageConstraintTpl<Scalar> |
using | Cost = CostAbstractTpl<Scalar> |
using | CostPtr = shared_ptr<Cost> |
using | Data = StageDataTpl<Scalar> |
Public Member Functions | |
ALIGATOR_DYNAMIC_TYPEDEFS (Scalar) | |
StageModelTpl (CostPtr cost, DynamicsPtr dynamics) | |
virtual | ~StageModelTpl ()=default |
const Manifold & | xspace () const |
const Manifold & | uspace () const |
const Manifold & | xspace_next () const |
const Cost & | cost () const |
virtual bool | has_dyn_model () const |
virtual ALIGATOR_DEPRECATED const Dynamics & | dyn_model () const |
int | nx1 () const |
int | ndx1 () const |
int | nu () const |
int | nx2 () const |
int | ndx2 () const |
int | nc () const |
Total number of constraints. | |
std::size_t | numConstraints () const |
Number of constraint objects. | |
int | numPrimal () const |
Number of primal optimization variables. | |
int | numDual () const |
Number of dual variables, i.e. Lagrange multipliers. | |
template<typename T > | |
void | addConstraint (T &&cstr) |
Add a constraint to the stage. | |
void | addConstraint (FunctionPtr func, ConstraintSetPtr cstr_set) |
Add a constraint to the stage. | |
virtual void | evaluate (const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const |
Evaluate all the functions (cost, dynamics, constraints) at this node. | |
virtual void | computeFirstOrderDerivatives (const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const |
Compute the first-order derivatives of the StageModelTpl. | |
virtual void | computeSecondOrderDerivatives (const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const |
Compute the second-order derivatives of the StageModelTpl. | |
virtual shared_ptr< Data > | createData () const |
Create a StageData object. | |
![]() | |
shared_ptr< StageModelTpl< _Scalar > > | clone () const |
Public Attributes | |
ManifoldPtr | xspace_ |
State space for the current state \(x_k\). | |
ManifoldPtr | xspace_next_ |
State space for the next state \(x_{k+1}\). | |
ManifoldPtr | uspace_ |
Control vector space – by default, a simple Euclidean space. | |
ConstraintStackTpl< Scalar > | constraints_ |
Constraint manager. | |
CostPtr | cost_ |
Stage cost function. | |
DynamicsPtr | dynamics_ |
Dynamics model. | |
Protected Member Functions | |
StageModelTpl (ManifoldPtr space, const int nu) | |
virtual StageModelTpl * | clone_impl () const override |
Friends | |
std::ostream & | operator<< (std::ostream &oss, const StageModelTpl &stage) |
A stage in the control problem.
Each stage containts cost functions, dynamical and constraint models. These objects are hold through smart pointers to leverage dynamic polymorphism.
Definition at line 21 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::Scalar = _Scalar |
Definition at line 23 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::Manifold = ManifoldAbstractTpl<Scalar> |
Definition at line 26 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::ManifoldPtr = shared_ptr<Manifold> |
Definition at line 27 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::Dynamics = DynamicsModelTpl<Scalar> |
Definition at line 28 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::DynamicsPtr = shared_ptr<Dynamics> |
Definition at line 29 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::FunctionPtr = shared_ptr<StageFunctionTpl<Scalar>> |
Definition at line 30 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::ConstraintSetPtr = shared_ptr<ConstraintSetBase<Scalar>> |
Definition at line 31 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::Constraint = StageConstraintTpl<Scalar> |
Definition at line 32 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::Cost = CostAbstractTpl<Scalar> |
Definition at line 33 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::CostPtr = shared_ptr<Cost> |
Definition at line 34 of file stage-model.hpp.
using aligator::StageModelTpl< _Scalar >::Data = StageDataTpl<Scalar> |
Definition at line 35 of file stage-model.hpp.
aligator::StageModelTpl< _Scalar >::StageModelTpl | ( | CostPtr | cost, |
DynamicsPtr | dynamics ) |
Constructor assumes the control space is a Euclidean space of dimension nu
.
|
virtualdefault |
|
protected |
aligator::StageModelTpl< _Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS | ( | Scalar | ) |
|
inline |
Definition at line 55 of file stage-model.hpp.
|
inline |
Definition at line 56 of file stage-model.hpp.
|
inline |
Definition at line 57 of file stage-model.hpp.
|
inline |
Definition at line 59 of file stage-model.hpp.
|
inlinevirtual |
Whether the stage's dynamics model can be accessed. This boolean allows flexibility in solvers when dealing with different frontends e.g. Crocoddyl's API.
Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.
Definition at line 63 of file stage-model.hpp.
|
inlinevirtual |
Definition at line 64 of file stage-model.hpp.
|
inline |
Definition at line 68 of file stage-model.hpp.
|
inline |
Definition at line 69 of file stage-model.hpp.
|
inline |
Definition at line 70 of file stage-model.hpp.
|
inline |
Definition at line 71 of file stage-model.hpp.
|
inline |
Definition at line 72 of file stage-model.hpp.
|
inline |
Total number of constraints.
Definition at line 74 of file stage-model.hpp.
|
inline |
Number of constraint objects.
Definition at line 77 of file stage-model.hpp.
|
inline |
Number of primal optimization variables.
Definition at line 80 of file stage-model.hpp.
|
inline |
Number of dual variables, i.e. Lagrange multipliers.
Definition at line 82 of file stage-model.hpp.
void aligator::StageModelTpl< _Scalar >::addConstraint | ( | T && | cstr | ) |
Add a constraint to the stage.
void aligator::StageModelTpl< _Scalar >::addConstraint | ( | FunctionPtr | func, |
ConstraintSetPtr | cstr_set ) |
Add a constraint to the stage.
Adds a constraint by allocating a new StageConstraintTpl.
|
virtual |
Evaluate all the functions (cost, dynamics, constraints) at this node.
Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.
|
virtual |
Compute the first-order derivatives of the StageModelTpl.
Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.
|
virtual |
Compute the second-order derivatives of the StageModelTpl.
Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.
|
virtual |
Create a StageData object.
Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.
|
inlineoverrideprotectedvirtual |
Implements aligator::Cloneable< StageModelTpl< _Scalar > >.
Definition at line 135 of file stage-model.hpp.
|
friend |
Definition at line 112 of file stage-model.hpp.
ManifoldPtr aligator::StageModelTpl< _Scalar >::xspace_ |
State space for the current state \(x_k\).
Definition at line 38 of file stage-model.hpp.
ManifoldPtr aligator::StageModelTpl< _Scalar >::xspace_next_ |
State space for the next state \(x_{k+1}\).
Definition at line 40 of file stage-model.hpp.
ManifoldPtr aligator::StageModelTpl< _Scalar >::uspace_ |
Control vector space – by default, a simple Euclidean space.
Definition at line 42 of file stage-model.hpp.
ConstraintStackTpl<Scalar> aligator::StageModelTpl< _Scalar >::constraints_ |
Constraint manager.
Definition at line 44 of file stage-model.hpp.
CostPtr aligator::StageModelTpl< _Scalar >::cost_ |
Stage cost function.
Definition at line 46 of file stage-model.hpp.
DynamicsPtr aligator::StageModelTpl< _Scalar >::dynamics_ |
Dynamics model.
Definition at line 48 of file stage-model.hpp.