11 using BlockXs = Eigen::Block<MatrixXs, -1, -1>;
21template <
typename Scalar>
28 const std::size_t nsteps = problem.
numSteps();
29 xs.resize(nsteps + 1);
35 gains_.resize(nsteps);
37 for (std::size_t i = 0; i < nsteps; i++) {
38 const StageModel &sm = *problem.
stages_[i];
40 const int ndx = sm.ndx1();
41 const int nu = sm.nu();
43 gains_[i].setZero(nu, ndx + 1);
45 this->m_isInitialized =
true;
50#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
51#include "./results.txx"
#define ALIGATOR_RUNTIME_ERROR(...)
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 > xs
States.
std::vector< VectorXs > us
Controls.
std::vector< MatrixXs > gains_
Riccati gains.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
Eigen::Block< MatrixXs, -1, -1 > BlockXs
A stage in the control problem.
Trajectory optimization problem.
bool checkIntegrity() const
std::size_t numSteps() const
std::vector< xyz::polymorphic< StageModel > > stages_
Stages of the control problem.