11 template <
size_t STATE_DIM,
14 typename LINEAR_SYSTEM_T,
15 typename LINEARIZER_T,
23 controlledSystem_(nonlinDynamics),
24 costFunction_(costFunction),
25 linearizedSystem_(linearSystem),
26 inputBoxConstraints_(nullptr),
27 stateBoxConstraints_(nullptr),
28 generalConstraints_(nullptr)
30 if (linearSystem ==
nullptr)
32 linearizedSystem_ = std::shared_ptr<LINEARIZER_T>(
new LINEARIZER_T(controlledSystem_));
37 template <
size_t STATE_DIM,
40 typename LINEAR_SYSTEM_T,
41 typename LINEARIZER_T,
56 template <
size_t STATE_DIM,
59 typename LINEAR_SYSTEM_T,
60 typename LINEARIZER_T,
71 inputBoxConstraints_ = inputBoxConstraints;
72 stateBoxConstraints_ = stateBoxConstraints;
73 generalConstraints_ = generalConstraints;
77 template <
size_t STATE_DIM,
80 typename LINEAR_SYSTEM_T,
81 typename LINEARIZER_T,
104 template <
size_t STATE_DIM,
107 typename LINEAR_SYSTEM_T,
108 typename LINEARIZER_T,
112 if (!controlledSystem_)
114 throw std::runtime_error(
"Dynamic system not set");
116 if (!linearizedSystem_)
118 throw std::runtime_error(
"Linearized system not set");
122 throw std::runtime_error(
"Cost function not set");
126 throw std::runtime_error(
"Time horizon should not be negative");
131 template <
size_t STATE_DIM,
134 typename LINEAR_SYSTEM_T,
135 typename LINEARIZER_T,
140 return controlledSystem_;
144 template <
size_t STATE_DIM,
147 typename LINEAR_SYSTEM_T,
148 typename LINEARIZER_T,
153 return linearizedSystem_;
156 template <
size_t STATE_DIM,
159 typename LINEAR_SYSTEM_T,
160 typename LINEARIZER_T,
166 return costFunction_;
169 template <
size_t STATE_DIM,
172 typename LINEAR_SYSTEM_T,
173 typename LINEARIZER_T,
178 controlledSystem_ = dyn;
181 template <
size_t STATE_DIM,
184 typename LINEAR_SYSTEM_T,
185 typename LINEARIZER_T,
190 linearizedSystem_ = lin;
193 template <
size_t STATE_DIM,
196 typename LINEAR_SYSTEM_T,
197 typename LINEARIZER_T,
202 costFunction_ = cost;
205 template <
size_t STATE_DIM,
208 typename LINEAR_SYSTEM_T,
209 typename LINEARIZER_T,
214 inputBoxConstraints_ = constraint;
215 if (!inputBoxConstraints_->isInitialized())
216 inputBoxConstraints_->initialize();
219 template <
size_t STATE_DIM,
222 typename LINEAR_SYSTEM_T,
223 typename LINEARIZER_T,
228 stateBoxConstraints_ = constraint;
229 if (!stateBoxConstraints_->isInitialized())
230 stateBoxConstraints_->initialize();
233 template <
size_t STATE_DIM,
236 typename LINEAR_SYSTEM_T,
237 typename LINEARIZER_T,
242 generalConstraints_ = constraint;
243 if (!generalConstraints_->isInitialized())
244 generalConstraints_->initialize();
247 template <
size_t STATE_DIM,
250 typename LINEAR_SYSTEM_T,
251 typename LINEARIZER_T,
258 return inputBoxConstraints_;
261 template <
size_t STATE_DIM,
264 typename LINEAR_SYSTEM_T,
265 typename LINEARIZER_T,
272 return stateBoxConstraints_;
275 template <
size_t STATE_DIM,
278 typename LINEAR_SYSTEM_T,
279 typename LINEARIZER_T,
286 return generalConstraints_;
289 template <
size_t STATE_DIM,
292 typename LINEAR_SYSTEM_T,
293 typename LINEARIZER_T,
302 template <
size_t STATE_DIM,
305 typename LINEAR_SYSTEM_T,
306 typename LINEARIZER_T,
314 template <
size_t STATE_DIM,
317 typename LINEAR_SYSTEM_T,
318 typename LINEARIZER_T,
326 template <
size_t STATE_DIM,
329 typename LINEAR_SYSTEM_T,
330 typename LINEARIZER_T,
std::shared_ptr< optcon::CostFunctionQuadratic< STATE_DIM, CONTROL_DIM, double > > CostFunctionPtr_t
Definition: OptConProblemBase.h:52
std::shared_ptr< optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, double > > ConstraintPtr_t
Definition: OptConProblemBase.h:53
CppAD::AD< CppAD::cg::CG< double > > SCALAR
OptConProblemBase()=default
SCALAR ::time_t time_t
Definition: OptConProblemBase.h:54
std::shared_ptr< LINEAR_SYSTEM_T > LinearPtr_t
Definition: OptConProblemBase.h:51
StateVector< state_dim > x0
Definition: ConstrainedNLOCTest.cpp:14
Definition: OptConProblemBase.h:40
std::shared_ptr< SCALAR > DynamicsPtr_t
Definition: OptConProblemBase.h:50