aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
results.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace aligator {
6
7template <typename Scalar> struct ResultsFDDPTpl : ResultsBaseTpl<Scalar> {
8
10 using Base = ResultsBaseTpl<Scalar>;
11 using BlockXs = Eigen::Block<MatrixXs, -1, -1>;
12
13 using Base::gains_;
14 using Base::us;
15 using Base::xs;
16
18 explicit ResultsFDDPTpl(const TrajOptProblemTpl<Scalar> &problem);
19};
20
21template <typename Scalar>
23 const TrajOptProblemTpl<Scalar> &problem) {
24 problem.checkIntegrity();
25 using StageModel = StageModelTpl<Scalar>;
26
27 const std::size_t nsteps = problem.numSteps();
28 xs.resize(nsteps + 1);
29 us.resize(nsteps);
30
31 xs_default_init(problem, xs);
32 us_default_init(problem, us);
33
34 gains_.resize(nsteps);
35
36 for (std::size_t i = 0; i < nsteps; i++) {
37 const StageModel &sm = *problem.stages_[i];
38
39 const int ndx = sm.ndx1();
40 const int nu = sm.nu();
41
42 gains_[i].setZero(nu, ndx + 1);
43 }
44 this->m_isInitialized = true;
45}
46
47} // namespace aligator
48
49#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
50#include "./results.txx"
51#endif
Main package namespace.
void us_default_init(const TrajOptProblemTpl< Scalar > &problem, std::vector< typename math_types< Scalar >::VectorXs > &us)
Default-initialize a controls trajectory from the neutral element of each control space.
void xs_default_init(const TrajOptProblemTpl< Scalar > &problem, std::vector< typename math_types< Scalar >::VectorXs > &xs)
Default-intialize a trajectory to the neutral states for each state space at each stage.
std::vector< VectorXs > us
Controls.
std::vector< VectorXs > xs
States.
std::vector< MatrixXs > gains_
Riccati gains.
Eigen::Block< MatrixXs, -1, -1 > BlockXs
Definition results.hpp:11