aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
aligator::StageModelTpl< _Scalar > Struct Template Reference

A stage in the control problem. More...

#include <aligator/core/stage-model.hpp>

Inheritance diagram for aligator::StageModelTpl< _Scalar >:
[legend]
Collaboration diagram for aligator::StageModelTpl< _Scalar >:
[legend]

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 Manifoldxspace () const
 
const Manifolduspace () const
 
const Manifoldxspace_next () const
 
const Costcost () const
 
virtual bool has_dyn_model () const
 
virtual ALIGATOR_DEPRECATED const Dynamicsdyn_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< DatacreateData () const
 Create a StageData object.
 
- Public Member Functions inherited from aligator::Cloneable< StageModelTpl< _Scalar > >
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< Scalarconstraints_
 Constraint manager.
 
CostPtr cost_
 Stage cost function.
 
DynamicsPtr dynamics_
 Dynamics model.
 

Protected Member Functions

 StageModelTpl (ManifoldPtr space, const int nu)
 
virtual StageModelTplclone_impl () const override
 

Friends

std::ostream & operator<< (std::ostream &oss, const StageModelTpl &stage)
 

Detailed Description

template<typename _Scalar>
struct aligator::StageModelTpl< _Scalar >

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.

Member Typedef Documentation

◆ Scalar

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::Scalar = _Scalar

Definition at line 23 of file stage-model.hpp.

◆ Manifold

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::Manifold = ManifoldAbstractTpl<Scalar>

Definition at line 26 of file stage-model.hpp.

◆ ManifoldPtr

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::ManifoldPtr = shared_ptr<Manifold>

Definition at line 27 of file stage-model.hpp.

◆ Dynamics

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::Dynamics = DynamicsModelTpl<Scalar>

Definition at line 28 of file stage-model.hpp.

◆ DynamicsPtr

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::DynamicsPtr = shared_ptr<Dynamics>

Definition at line 29 of file stage-model.hpp.

◆ FunctionPtr

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::FunctionPtr = shared_ptr<StageFunctionTpl<Scalar>>

Definition at line 30 of file stage-model.hpp.

◆ ConstraintSetPtr

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::ConstraintSetPtr = shared_ptr<ConstraintSetBase<Scalar>>

Definition at line 31 of file stage-model.hpp.

◆ Constraint

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::Constraint = StageConstraintTpl<Scalar>

Definition at line 32 of file stage-model.hpp.

◆ Cost

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::Cost = CostAbstractTpl<Scalar>

Definition at line 33 of file stage-model.hpp.

◆ CostPtr

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::CostPtr = shared_ptr<Cost>

Definition at line 34 of file stage-model.hpp.

◆ Data

template<typename _Scalar >
using aligator::StageModelTpl< _Scalar >::Data = StageDataTpl<Scalar>

Definition at line 35 of file stage-model.hpp.

Constructor & Destructor Documentation

◆ StageModelTpl() [1/2]

template<typename _Scalar >
aligator::StageModelTpl< _Scalar >::StageModelTpl ( CostPtr cost,
DynamicsPtr dynamics )

Constructor assumes the control space is a Euclidean space of dimension nu.

◆ ~StageModelTpl()

template<typename _Scalar >
virtual aligator::StageModelTpl< _Scalar >::~StageModelTpl ( )
virtualdefault

◆ StageModelTpl() [2/2]

template<typename _Scalar >
aligator::StageModelTpl< _Scalar >::StageModelTpl ( ManifoldPtr space,
const int nu )
protected

Member Function Documentation

◆ ALIGATOR_DYNAMIC_TYPEDEFS()

template<typename _Scalar >
aligator::StageModelTpl< _Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS ( Scalar )

◆ xspace()

template<typename _Scalar >
const Manifold & aligator::StageModelTpl< _Scalar >::xspace ( ) const
inline

Definition at line 55 of file stage-model.hpp.

◆ uspace()

template<typename _Scalar >
const Manifold & aligator::StageModelTpl< _Scalar >::uspace ( ) const
inline

Definition at line 56 of file stage-model.hpp.

◆ xspace_next()

template<typename _Scalar >
const Manifold & aligator::StageModelTpl< _Scalar >::xspace_next ( ) const
inline

Definition at line 57 of file stage-model.hpp.

◆ cost()

template<typename _Scalar >
const Cost & aligator::StageModelTpl< _Scalar >::cost ( ) const
inline

Definition at line 59 of file stage-model.hpp.

◆ has_dyn_model()

template<typename _Scalar >
virtual bool aligator::StageModelTpl< _Scalar >::has_dyn_model ( ) const
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.

◆ dyn_model()

template<typename _Scalar >
virtual ALIGATOR_DEPRECATED const Dynamics & aligator::StageModelTpl< _Scalar >::dyn_model ( ) const
inlinevirtual

Definition at line 64 of file stage-model.hpp.

◆ nx1()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::nx1 ( ) const
inline

Definition at line 68 of file stage-model.hpp.

◆ ndx1()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::ndx1 ( ) const
inline

Definition at line 69 of file stage-model.hpp.

◆ nu()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::nu ( ) const
inline

Definition at line 70 of file stage-model.hpp.

◆ nx2()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::nx2 ( ) const
inline

Definition at line 71 of file stage-model.hpp.

◆ ndx2()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::ndx2 ( ) const
inline

Definition at line 72 of file stage-model.hpp.

◆ nc()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::nc ( ) const
inline

Total number of constraints.

Definition at line 74 of file stage-model.hpp.

◆ numConstraints()

template<typename _Scalar >
std::size_t aligator::StageModelTpl< _Scalar >::numConstraints ( ) const
inline

Number of constraint objects.

Definition at line 77 of file stage-model.hpp.

◆ numPrimal()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::numPrimal ( ) const
inline

Number of primal optimization variables.

Definition at line 80 of file stage-model.hpp.

◆ numDual()

template<typename _Scalar >
int aligator::StageModelTpl< _Scalar >::numDual ( ) const
inline

Number of dual variables, i.e. Lagrange multipliers.

Definition at line 82 of file stage-model.hpp.

◆ addConstraint() [1/2]

template<typename _Scalar >
template<typename T >
void aligator::StageModelTpl< _Scalar >::addConstraint ( T && cstr)

Add a constraint to the stage.

◆ addConstraint() [2/2]

template<typename _Scalar >
void aligator::StageModelTpl< _Scalar >::addConstraint ( FunctionPtr func,
ConstraintSetPtr cstr_set )

Add a constraint to the stage.

Adds a constraint by allocating a new StageConstraintTpl.

◆ evaluate()

template<typename _Scalar >
virtual void aligator::StageModelTpl< _Scalar >::evaluate ( const ConstVectorRef & x,
const ConstVectorRef & u,
const ConstVectorRef & y,
Data & data ) const
virtual

Evaluate all the functions (cost, dynamics, constraints) at this node.

Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.

◆ computeFirstOrderDerivatives()

template<typename _Scalar >
virtual void aligator::StageModelTpl< _Scalar >::computeFirstOrderDerivatives ( const ConstVectorRef & x,
const ConstVectorRef & u,
const ConstVectorRef & y,
Data & data ) const
virtual

Compute the first-order derivatives of the StageModelTpl.

Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.

◆ computeSecondOrderDerivatives()

template<typename _Scalar >
virtual void aligator::StageModelTpl< _Scalar >::computeSecondOrderDerivatives ( const ConstVectorRef & x,
const ConstVectorRef & u,
Data & data ) const
virtual

Compute the second-order derivatives of the StageModelTpl.

Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.

◆ createData()

template<typename _Scalar >
virtual shared_ptr< Data > aligator::StageModelTpl< _Scalar >::createData ( ) const
virtual

Create a StageData object.

Reimplemented in aligator::compat::croc::ActionModelWrapperTpl< Scalar >.

◆ clone_impl()

template<typename _Scalar >
virtual StageModelTpl * aligator::StageModelTpl< _Scalar >::clone_impl ( ) const
inlineoverrideprotectedvirtual

Implements aligator::Cloneable< StageModelTpl< _Scalar > >.

Definition at line 135 of file stage-model.hpp.

Friends And Related Symbol Documentation

◆ operator<<

template<typename _Scalar >
std::ostream & operator<< ( std::ostream & oss,
const StageModelTpl< _Scalar > & stage )
friend

Definition at line 112 of file stage-model.hpp.

Member Data Documentation

◆ xspace_

template<typename _Scalar >
ManifoldPtr aligator::StageModelTpl< _Scalar >::xspace_

State space for the current state \(x_k\).

Definition at line 38 of file stage-model.hpp.

◆ xspace_next_

template<typename _Scalar >
ManifoldPtr aligator::StageModelTpl< _Scalar >::xspace_next_

State space for the next state \(x_{k+1}\).

Definition at line 40 of file stage-model.hpp.

◆ uspace_

template<typename _Scalar >
ManifoldPtr aligator::StageModelTpl< _Scalar >::uspace_

Control vector space – by default, a simple Euclidean space.

Definition at line 42 of file stage-model.hpp.

◆ constraints_

template<typename _Scalar >
ConstraintStackTpl<Scalar> aligator::StageModelTpl< _Scalar >::constraints_

Constraint manager.

Definition at line 44 of file stage-model.hpp.

◆ cost_

template<typename _Scalar >
CostPtr aligator::StageModelTpl< _Scalar >::cost_

Stage cost function.

Definition at line 46 of file stage-model.hpp.

◆ dynamics_

template<typename _Scalar >
DynamicsPtr aligator::StageModelTpl< _Scalar >::dynamics_

Dynamics model.

Definition at line 48 of file stage-model.hpp.


The documentation for this struct was generated from the following file: