13template <
typename Scalar>
struct WorkspaceBaseTpl {
59template <
typename Scalar>
62 : m_isInitialized(true), nsteps(problem.numSteps()), problem_data(problem) {
80#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
81#include "./workspace-base.txx"
Utils for model-predictive control.
void rotate_vec_left(std::vector< T, Alloc > &v, long n_head=0, long n_tail=0)
Simply rotate an entire std::vector to the left.
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.
Common utilities for all solvers.
Data struct for stage models StageModelTpl.
std::vector< shared_ptr< StageData > > stage_data
Data structs for each stage of the problem.
Trajectory optimization problem.
std::size_t nsteps
Number of steps in the problem.
bool isInitialized() const
std::vector< VectorXs > trial_us
~WorkspaceBaseTpl()=default
TrajOptDataTpl< Scalar > problem_data
Problem data.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
void cycleLeft()
Cycle the workspace data to the left.
std::vector< VectorXs > dyn_slacks
Dynamical infeasibility gaps.
void cycleAppend(shared_ptr< StageDataTpl< Scalar > > data)
Same as cycleLeft(), but add a StageDataTpl to problem_data.
std::vector< VectorXs > trial_xs