23 template <
size_t STATE_DIM,
25 size_t P_DIM = STATE_DIM / 2,
26 size_t V_DIM = STATE_DIM / 2,
28 bool CONTINUOUS =
true>
30 :
public OptConSolver<NLOptConSolver<STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS>,
31 typename NLOCAlgorithm<STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS>::Policy_t,
39 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
67 NLOptConSolver(
const OptConProblem_t& optConProblem,
const Settings_t& settings);
71 const std::string& settingsFile,
73 const std::string& ns =
"alg");
81 void initialize(
const OptConProblem_t& optConProblem,
const Settings_t& settings);
86 void configure(
const Settings_t& settings)
override;
126 virtual bool solve()
override;
180 virtual void changeCostFunction(
const typename OptConProblem_t::CostFunctionPtr_t& cf)
override;
196 virtual void changeLinearSystem(
const typename OptConProblem_t::LinearPtr_t& lin)
override;
198 virtual SCALAR
getCost()
const override;
204 const std::shared_ptr<Backend_t>&
getBackend();
254 void setAlgorithm(
const Settings_t& settings);
virtual const core::StateTrajectory< STATE_DIM, SCALAR > getStateTrajectory() const override
Definition: NLOptConSolver-impl.hpp:152
Definition: NLOCAlgorithm.hpp:19
void initialize(const OptConProblem_t &optConProblem, const Settings_t &settings)
Definition: NLOptConSolver-impl.hpp:46
std::vector< typename OptConProblem_t::LinearPtr_t > & getLinearSystemsInstances() override
get reference to the linearized system
Definition: NLOptConSolver-impl.hpp:264
Definition: OptConSolver.h:39
virtual SCALAR getTimeHorizon() const override
Get the time horizon the solver currently operates on.
Definition: NLOptConSolver-impl.hpp:175
static const size_t CONTROL_D
Definition: NLOptConSolver.hpp:42
void logSummaryToMatlab(const std::string &fileName)
logging a short summary to matlab
Definition: NLOptConSolver-impl.hpp:351
virtual const core::ControlTrajectory< CONTROL_DIM, SCALAR > getControlTrajectory() const override
Definition: NLOptConSolver-impl.hpp:160
const std::shared_ptr< Backend_t > & getBackend()
get a reference to the backend (
Definition: NLOptConSolver-impl.hpp:237
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const size_t STATE_D
Definition: NLOptConSolver.hpp:41
virtual void changeLinearSystem(const typename OptConProblem_t::LinearPtr_t &lin) override
Change the linear system.
Definition: NLOptConSolver-impl.hpp:213
std::vector< typename OptConProblem_t::ConstraintPtr_t > & getGeneralConstraintsInstances() override
get reference to the general constraints
Definition: NLOptConSolver-impl.hpp:335
NLOptConSolver(const OptConProblem_t &optConProblem, const Settings_t &settings)
constructor
Definition: NLOptConSolver-impl.hpp:12
NLOCAlgorithm_t::Backend_t Backend_t
Definition: NLOptConSolver.hpp:63
std::vector< typename OptConProblem_t::DynamicsPtr_t > & getNonlinearSystemsInstances() override
get reference to the nonlinear system
Definition: NLOptConSolver-impl.hpp:246
NLOptConSettings Settings_t
Definition: NLOptConSolver.hpp:56
NLOCAlgorithm_t::Policy_t Policy_t
Definition: NLOptConSolver.hpp:62
std::vector< typename OptConProblem_t::CostFunctionPtr_t > & getCostFunctionInstances() override
get reference to the cost function
Definition: NLOptConSolver-impl.hpp:282
virtual void changeNonlinearSystem(const typename OptConProblem_t::DynamicsPtr_t &dyn) override
Change the nonlinear system.
Definition: NLOptConSolver-impl.hpp:205
void configure(const Settings_t &settings) override
Definition: NLOptConSolver-impl.hpp:62
NLOCAlgorithm< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS > NLOCAlgorithm_t
Definition: NLOptConSolver.hpp:61
virtual void prepareIteration()
Definition: NLOptConSolver-impl.hpp:74
virtual ~NLOptConSolver()=default
destructor
virtual void changeInitialState(const core::StateVector< STATE_DIM, SCALAR > &x0) override
Change the initial state for the optimal control problem.
Definition: NLOptConSolver-impl.hpp:189
void setInitialGuess(const Policy_t &initialGuess) override
Definition: NLOptConSolver-impl.hpp:118
OptConSolver< NLOptConSolver< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >, typename NLOCAlgorithm< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS >::Policy_t, NLOptConSettings, STATE_DIM, CONTROL_DIM, SCALAR, CONTINUOUS > Base
Definition: NLOptConSolver.hpp:53
Settings for the NLOptCon algorithm.
Definition: NLOptConSettings.hpp:198
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual bool solve() override
Definition: NLOptConSolver-impl.hpp:126
virtual const core::tpl::TimeArray< SCALAR > & getTimeArray() const override
Definition: NLOptConSolver-impl.hpp:168
static const size_t VEL_DIM
Definition: NLOptConSolver.hpp:44
std::vector< typename OptConProblem_t::ConstraintPtr_t > & getStateBoxConstraintsInstances() override
get reference to the box constraints
Definition: NLOptConSolver-impl.hpp:317
std::vector< typename OptConProblem_t::ConstraintPtr_t > & getInputBoxConstraintsInstances() override
get reference to the box constraints
Definition: NLOptConSolver-impl.hpp:300
std::shared_ptr< Backend_t > nlocBackend_
the backend holding all the math operations
Definition: NLOptConSolver.hpp:247
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::conditional< CONTINUOUS, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR > >::type OptConProblem_t
Definition: OptConSolver.h:46
virtual bool finishMPCIteration()
Definition: NLOptConSolver-impl.hpp:95
virtual bool runIteration() override
Definition: NLOptConSolver-impl.hpp:102
virtual SCALAR getCost() const override
Definition: NLOptConSolver-impl.hpp:221
virtual const Policy_t & getSolution() override
Definition: NLOptConSolver-impl.hpp:144
const Settings_t & getSettings()
get a reference to the current settings
Definition: NLOptConSolver-impl.hpp:229
static const size_t POS_DIM
Definition: NLOptConSolver.hpp:43
virtual void changeCostFunction(const typename OptConProblem_t::CostFunctionPtr_t &cf) override
Change the cost function.
Definition: NLOptConSolver-impl.hpp:197
virtual bool finishIteration()
Definition: NLOptConSolver-impl.hpp:81
Base::OptConProblem_t OptConProblem_t
Definition: NLOptConSolver.hpp:59
virtual void changeTimeHorizon(const SCALAR &tf) override
Change the time horizon the solver operates on.
Definition: NLOptConSolver-impl.hpp:182
C++ implementation of GNMS.
Definition: NLOCBackendBase.hpp:48
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ct::core::StateFeedbackController< STATE_DIM, CONTROL_DIM, SCALAR > Policy_t
Definition: NLOCAlgorithm.hpp:24
StateVector< state_dim > x0
Definition: ConstrainedNLOCTest.cpp:14
std::shared_ptr< NLOCAlgorithm_t > nlocAlgorithm_
the algorithm for sequencing the math operations in correct manner
Definition: NLOptConSolver.hpp:250
const bool verbose
Definition: ConstraintComparison.h:18
Definition: NLOptConSolver.hpp:29
virtual void prepareMPCIteration()
Definition: NLOptConSolver-impl.hpp:88
SCALAR Scalar_t
Definition: NLOptConSolver.hpp:57