23template <
typename _Scalar>
struct TrajOptProblemTpl {
33#pragma GCC diagnostic push
34#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
36#pragma GCC diagnostic pop
97 std::vector<xyz::polymorphic<StageModel>>
stages_;
109 const std::vector<xyz::polymorphic<StageModel>> &stages,
110 xyz::polymorphic<CostAbstract> term_cost);
115 const std::vector<xyz::polymorphic<StageModel>> &stages,
116 xyz::polymorphic<CostAbstract> term_cost);
122 xyz::polymorphic<CostAbstract> term_cost);
127 xyz::polymorphic<Manifold> space,
128 xyz::polymorphic<CostAbstract> term_cost);
133 void addStage(
const xyz::polymorphic<StageModel> &stage);
139 "Initial condition is not a StateErrorResidual.\n");
148 "Initial condition is not a StateErrorResidual.\n");
156 const xyz::polymorphic<ConstraintSet> &set) {
157 this->term_cstrs_.
pushBack(func, set);
166 const std::vector<VectorXs> &us,
Data &prob_data,
167 std::size_t num_threads = 1)
const;
179 const std::vector<VectorXs> &us,
Data &prob_data,
180 std::size_t num_threads = 1,
181 bool compute_second_order =
true)
const;
195template <
typename Scalar>
197 return problem.term_cost_->space;
201template <
typename Scalar>
202int problem_last_ndx_helper(
const TrajOptProblemTpl<Scalar> &problem) {
203 return problem_last_state_space_helper(problem)->ndx();
209#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
210#include "aligator/core/traj-opt-problem.txx"
#define ALIGATOR_RUNTIME_ERROR(...)
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.
proxsuite::nlp::ConstraintSetBase< T > ConstraintSetTpl
TYPEDEFS FROM PROXNLP.
Convenience class to manage a stack of constraints.
ALIGATOR_DEPRECATED void pushBack(Cstr &&el)
Stage costs for control problems.
Simple struct holding together a function and set, to describe a constraint.
Class representing ternary functions .
A stage in the control problem.
Trajectory optimization problem.
bool checkIntegrity() const
xyz::polymorphic< CostAbstract > term_cost_
Terminal cost.
xyz::polymorphic< UnaryFunction > init_constraint_
Initial condition.
ConstraintStackTpl< Scalar > term_cstrs_
Terminal constraints.
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 setInitState(const ConstVectorRef &x0)
Set initial state constraint.
ManifoldAbstractTpl< Scalar > Manifold
bool initCondIsStateError() const
void addStage(const xyz::polymorphic< StageModel > &stage)
Add a stage to the control problem.
void replaceStageCircular(const xyz::polymorphic< StageModel > &model)
Pop out the first StageModel and replace by the supplied one; updates the supplied problem data (Traj...
void addTerminalConstraint(const xyz::polymorphic< StageFunction > &func, const xyz::polymorphic< ConstraintSet > &set)
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
std::size_t numSteps() const
std::vector< xyz::polymorphic< StageModel > > stages_
Stages of the control problem.
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 removeTerminalConstraints()
Remove all terminal constraints.
StateErrorResidual * init_state_error_
Pointer to underlying state error residual.
ConstraintSetTpl< Scalar > ConstraintSet
ALIGATOR_DEPRECATED void addTerminalConstraint(const StageConstraint &cstr)
Add a terminal constraint for the model.
ConstVectorRef getInitState() const
Get initial state constraint.
VectorXs unone_
Dummy, "neutral" control value.
Represents unary functions of the form , with no control (or next-state) arguments.