aligator
0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
|
Trajectory optimization problem. More...
#include <aligator/core/traj-opt-problem.hpp>
Public Types | |
using | Scalar = _Scalar |
using | StageModel = StageModelTpl<Scalar> |
using | StageFunction = StageFunctionTpl<Scalar> |
using | UnaryFunction = UnaryFunctionTpl<Scalar> |
using | Data = TrajOptDataTpl<Scalar> |
using | Manifold = ManifoldAbstractTpl<Scalar> |
using | CostAbstract = CostAbstractTpl<Scalar> |
using | ConstraintSet = ConstraintSetTpl<Scalar> |
using | StateErrorResidual = StateErrorResidualTpl<Scalar> |
using | StageConstraint = StageConstraintTpl<Scalar> |
Public Member Functions | |
ALIGATOR_DYNAMIC_TYPEDEFS (Scalar) | |
TrajOptProblemTpl (xyz::polymorphic< UnaryFunction > init_constraint, const std::vector< xyz::polymorphic< StageModel > > &stages, xyz::polymorphic< CostAbstract > term_cost) | |
TrajOptProblemTpl (const ConstVectorRef &x0, const std::vector< xyz::polymorphic< StageModel > > &stages, xyz::polymorphic< CostAbstract > term_cost) | |
Constructor for an initial value problem. | |
TrajOptProblemTpl (xyz::polymorphic< UnaryFunction > init_constraint, xyz::polymorphic< CostAbstract > term_cost) | |
TrajOptProblemTpl (const ConstVectorRef &x0, const int nu, xyz::polymorphic< Manifold > space, xyz::polymorphic< CostAbstract > term_cost) | |
Constructor for an initial value problem. | |
bool | initCondIsStateError () const |
void | addStage (const xyz::polymorphic< StageModel > &stage) |
Add a stage to the control problem. | |
ConstVectorRef | getInitState () const |
Get initial state constraint. | |
void | setInitState (const ConstVectorRef &x0) |
Set initial state constraint. | |
ALIGATOR_DEPRECATED void | addTerminalConstraint (const StageConstraint &cstr) |
Add a terminal constraint for the model. | |
void | addTerminalConstraint (const xyz::polymorphic< StageFunction > &func, const xyz::polymorphic< ConstraintSet > &set) |
void | removeTerminalConstraints () |
Remove all terminal constraints. | |
std::size_t | numSteps () const |
Scalar | evaluate (const std::vector< VectorXs > &xs, const std::vector< VectorXs > &us, Data &prob_data, std::size_t num_threads=1) const |
Rollout the problem costs, constraints, dynamics, stage per stage. | |
void | computeDerivatives (const std::vector< VectorXs > &xs, const std::vector< VectorXs > &us, Data &prob_data, std::size_t num_threads=1, bool compute_second_order=true) const |
Rollout the problem derivatives, stage per stage. | |
void | replaceStageCircular (const xyz::polymorphic< StageModel > &model) |
Pop out the first StageModel and replace by the supplied one; updates the supplied problem data (TrajOptDataTpl) object. | |
bool | checkIntegrity () const |
Public Attributes | |
xyz::polymorphic< UnaryFunction > | init_constraint_ |
Initial condition. | |
std::vector< xyz::polymorphic< StageModel > > | stages_ |
Stages of the control problem. | |
xyz::polymorphic< CostAbstract > | term_cost_ |
Terminal cost. | |
ConstraintStackTpl< Scalar > | term_cstrs_ |
Terminal constraints. | |
VectorXs | unone_ |
Dummy, "neutral" control value. | |
Protected Attributes | |
StateErrorResidual * | init_state_error_ |
Pointer to underlying state error residual. | |
Trajectory optimization problem.
Scalar | the scalar type. |
The problem can be written as a nonlinear program:
\[ \begin{aligned} \min_{\bmx,\bmu}~& \sum_{i=0}^{N-1} \ell_i(x_i, u_i) + \ell_N(x_N) \\ \subjectto & \varphi(x_i, u_i, x_{i+1}) = 0, \ 0 \leq i < N \\ & g(x_i, u_i) \in \calC_i \end{aligned} \]
using aligator::TrajOptProblemTpl< Scalar >::Scalar = _Scalar |
Definition at line 24 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::StageModel = StageModelTpl<Scalar> |
Definition at line 25 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::StageFunction = StageFunctionTpl<Scalar> |
Definition at line 26 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::UnaryFunction = UnaryFunctionTpl<Scalar> |
Definition at line 27 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::Data = TrajOptDataTpl<Scalar> |
Definition at line 28 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::Manifold = ManifoldAbstractTpl<Scalar> |
Definition at line 29 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::CostAbstract = CostAbstractTpl<Scalar> |
Definition at line 30 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::ConstraintSet = ConstraintSetTpl<Scalar> |
Definition at line 31 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::StateErrorResidual = StateErrorResidualTpl<Scalar> |
Definition at line 32 of file traj-opt-problem.hpp.
using aligator::TrajOptProblemTpl< Scalar >::StageConstraint = StageConstraintTpl<Scalar> |
Definition at line 35 of file traj-opt-problem.hpp.
aligator::TrajOptProblemTpl< Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS | ( | Scalar | ) |
|
inline |
Definition at line 130 of file traj-opt-problem.hpp.
void aligator::TrajOptProblemTpl< Scalar >::addStage | ( | const xyz::polymorphic< StageModel > & | stage | ) |
Add a stage to the control problem.
|
inline |
Get initial state constraint.
Definition at line 136 of file traj-opt-problem.hpp.
|
inline |
Set initial state constraint.
Definition at line 145 of file traj-opt-problem.hpp.
ALIGATOR_DEPRECATED void aligator::TrajOptProblemTpl< Scalar >::addTerminalConstraint | ( | const StageConstraint & | cstr | ) |
Add a terminal constraint for the model.
|
inline |
Definition at line 155 of file traj-opt-problem.hpp.
|
inline |
Remove all terminal constraints.
Definition at line 160 of file traj-opt-problem.hpp.
std::size_t aligator::TrajOptProblemTpl< Scalar >::numSteps | ( | ) | const |
Scalar aligator::TrajOptProblemTpl< Scalar >::evaluate | ( | const std::vector< VectorXs > & | xs, |
const std::vector< VectorXs > & | us, | ||
Data & | prob_data, | ||
std::size_t | num_threads = 1 ) const |
Rollout the problem costs, constraints, dynamics, stage per stage.
void aligator::TrajOptProblemTpl< Scalar >::computeDerivatives | ( | const std::vector< VectorXs > & | xs, |
const std::vector< VectorXs > & | us, | ||
Data & | prob_data, | ||
std::size_t | num_threads = 1, | ||
bool | compute_second_order = true ) const |
Rollout the problem derivatives, stage per stage.
xs | State sequence |
us | Control sequence |
prob_data | Problem data |
num_threads | Number of threads to use |
compute_second_order | Whether to compute second-order derivatives |
void aligator::TrajOptProblemTpl< Scalar >::replaceStageCircular | ( | const xyz::polymorphic< StageModel > & | model | ) |
Pop out the first StageModel and replace by the supplied one; updates the supplied problem data (TrajOptDataTpl) object.
bool aligator::TrajOptProblemTpl< Scalar >::checkIntegrity | ( | ) | const |
xyz::polymorphic<UnaryFunction> aligator::TrajOptProblemTpl< Scalar >::init_constraint_ |
Initial condition.
Definition at line 95 of file traj-opt-problem.hpp.
std::vector<xyz::polymorphic<StageModel> > aligator::TrajOptProblemTpl< Scalar >::stages_ |
Stages of the control problem.
Definition at line 97 of file traj-opt-problem.hpp.
xyz::polymorphic<CostAbstract> aligator::TrajOptProblemTpl< Scalar >::term_cost_ |
Terminal cost.
Definition at line 99 of file traj-opt-problem.hpp.
ConstraintStackTpl<Scalar> aligator::TrajOptProblemTpl< Scalar >::term_cstrs_ |
Terminal constraints.
Definition at line 101 of file traj-opt-problem.hpp.
VectorXs aligator::TrajOptProblemTpl< Scalar >::unone_ |
Dummy, "neutral" control value.
Definition at line 103 of file traj-opt-problem.hpp.
|
protected |
Pointer to underlying state error residual.
Definition at line 191 of file traj-opt-problem.hpp.