- 3.0.2 optimal control module.
MultipleShooting.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 
10 
11 namespace ct {
12 namespace optcon {
13 
14 
15 template <size_t STATE_DIM,
16  size_t CONTROL_DIM,
17  size_t P_DIM,
18  size_t V_DIM,
19  typename SCALAR = double,
20  bool CONTINUOUS = true>
21 class MultipleShooting final : public NLOCAlgorithm<STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS>
22 {
23 public:
24  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 
26  static const size_t STATE_D = STATE_DIM;
27  static const size_t CONTROL_D = CONTROL_DIM;
28 
30 
31  typedef typename Base::Policy_t Policy_t;
32  typedef typename Base::Settings_t Settings_t;
33  typedef typename Base::Backend_t Backend_t;
34 
35  typedef SCALAR Scalar_t;
36 
38  MultipleShooting(std::shared_ptr<Backend_t>& backend_, const Settings_t& settings);
39 
41  virtual ~MultipleShooting() = default;
42 
44  virtual void configure(const Settings_t& settings) override;
45 
47  virtual void setInitialGuess(const Policy_t& initialGuess) override;
48 
50 
53  virtual bool runIteration() override;
54 
55 
60  virtual void prepareIteration() override;
61 
62 
64 
69  virtual bool finishIteration() override;
70 
71 
73 
77  virtual void prepareMPCIteration() override;
78 
79 
81  virtual bool finishMPCIteration() override;
82 };
83 
84 } // namespace optcon
85 } // namespace ct
Definition: NLOCAlgorithm.hpp:19
virtual void prepareIteration() override
Definition: MultipleShooting-impl.hpp:39
static const size_t CONTROL_D
Definition: MultipleShooting.hpp:27
MultipleShooting(std::shared_ptr< Backend_t > &backend_, const Settings_t &settings)
constructor
Definition: MultipleShooting-impl.hpp:12
virtual bool finishMPCIteration() override
finish iteration, dedicated to MPC
Definition: MultipleShooting-impl.hpp:217
virtual void configure(const Settings_t &settings) override
configure the solver
Definition: MultipleShooting-impl.hpp:19
Base::Settings_t Settings_t
Definition: MultipleShooting.hpp:32
Base::Policy_t Policy_t
Definition: MultipleShooting.hpp:31
std::shared_ptr< Backend_t > backend_
Definition: NLOCAlgorithm.hpp:47
Settings for the NLOptCon algorithm.
Definition: NLOptConSettings.hpp:198
virtual ~MultipleShooting()=default
destructor
CppAD::AD< CppAD::cg::CG< double > > SCALAR
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const size_t STATE_D
Definition: MultipleShooting.hpp:26
Base::Backend_t Backend_t
Definition: MultipleShooting.hpp:33
virtual void prepareMPCIteration() override
prepare iteration, dedicated to MPC.
Definition: MultipleShooting-impl.hpp:164
SCALAR Scalar_t
Definition: MultipleShooting.hpp:35
NLOCAlgorithm< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS > Base
Definition: MultipleShooting.hpp:29
Definition: MultipleShooting.hpp:21
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 finishIteration() override
finish iteration for unconstrained MultipleShooting
Definition: MultipleShooting-impl.hpp:92
virtual void setInitialGuess(const Policy_t &initialGuess) override
set an initial guess
Definition: MultipleShooting-impl.hpp:25
virtual bool runIteration() override
runIteration combines prepareIteration and finishIteration
Definition: MultipleShooting-impl.hpp:31