- 3.0.2 optimal control module.
NLOCAlgorithm.hpp
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 
9 namespace ct {
10 namespace optcon {
11 
12 
13 template <size_t STATE_DIM,
14  size_t CONTROL_DIM,
15  size_t P_DIM,
16  size_t V_DIM,
17  typename SCALAR = double,
18  bool CONTINUOUS = true>
20 {
21 public:
22  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 
25 
28  typedef SCALAR Scalar_t;
29 
30  NLOCAlgorithm(const std::shared_ptr<Backend_t>& backend) : backend_(backend) {}
31  virtual ~NLOCAlgorithm() {}
32  virtual void configure(const Settings_t& settings) = 0;
33 
34  virtual void prepareIteration() = 0;
35 
36  virtual bool finishIteration() = 0;
37 
38  virtual bool runIteration() = 0;
39 
40  virtual void setInitialGuess(const Policy_t& initialGuess) = 0;
41 
42  virtual void prepareMPCIteration() = 0;
43 
44  virtual bool finishMPCIteration() = 0;
45 
46 protected:
47  std::shared_ptr<Backend_t> backend_;
48 };
49 } // namespace optcon
50 } // namespace ct
virtual void prepareIteration()=0
Definition: NLOCAlgorithm.hpp:19
NLOCAlgorithm(const std::shared_ptr< Backend_t > &backend)
Definition: NLOCAlgorithm.hpp:30
virtual void configure(const Settings_t &settings)=0
NLOCBackendBase< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS > Backend_t
Definition: NLOCAlgorithm.hpp:26
virtual ~NLOCAlgorithm()
Definition: NLOCAlgorithm.hpp:31
std::shared_ptr< Backend_t > backend_
Definition: NLOCAlgorithm.hpp:47
Settings for the NLOptCon algorithm.
Definition: NLOptConSettings.hpp:198
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual bool finishIteration()=0
SCALAR Scalar_t
Definition: NLOCAlgorithm.hpp:28
virtual void setInitialGuess(const Policy_t &initialGuess)=0
virtual bool runIteration()=0
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
virtual bool finishMPCIteration()=0
virtual void prepareMPCIteration()=0
NLOptConSettings Settings_t
Definition: NLOCAlgorithm.hpp:27