- 3.0.2 optimal control module.
SingleShooting.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 SingleShooting 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 
37 
39  SingleShooting(std::shared_ptr<Backend_t>& backend_, const Settings_t& settings);
40 
42  virtual ~SingleShooting() = default;
43 
45  virtual void configure(const Settings_t& settings) override;
46 
48  virtual void setInitialGuess(const Policy_t& initialGuess) override;
49 
50 
52 
56  virtual bool runIteration() override;
57 
58 
62  virtual void prepareIteration() override;
63 
64 
69  virtual bool finishIteration() override;
70 
71 
75  virtual void prepareMPCIteration() override;
76 
77 
82  virtual bool finishMPCIteration() override;
83 };
84 
85 } // namespace optcon
86 } // namespace ct
Definition: NLOCAlgorithm.hpp:19
virtual ~SingleShooting()=default
destructor
virtual void configure(const Settings_t &settings) override
configure the solver
Definition: SingleShooting-impl.hpp:23
virtual bool runIteration() override
runIteration combines prepareIteration and finishIteration
Definition: SingleShooting-impl.hpp:36
SCALAR Scalar_t
Definition: SingleShooting.hpp:35
SingleShooting(std::shared_ptr< Backend_t > &backend_, const Settings_t &settings)
constructor
Definition: SingleShooting-impl.hpp:15
Base::Settings_t Settings_t
Definition: SingleShooting.hpp:32
NLOCAlgorithm< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR, CONTINUOUS > Base
Definition: SingleShooting.hpp:29
std::shared_ptr< Backend_t > backend_
Definition: NLOCAlgorithm.hpp:47
Definition: SingleShooting.hpp:21
Settings for the NLOptCon algorithm.
Definition: NLOptConSettings.hpp:198
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual bool finishMPCIteration() override
Definition: SingleShooting-impl.hpp:142
virtual void prepareIteration() override
Definition: SingleShooting-impl.hpp:44
virtual void prepareMPCIteration() override
Definition: SingleShooting-impl.hpp:136
static const size_t CONTROL_D
Definition: SingleShooting.hpp:27
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
Definition: SingleShooting-impl.hpp:56
Base::Policy_t Policy_t
Definition: SingleShooting.hpp:31
Base::Backend_t Backend_t
Definition: SingleShooting.hpp:33
virtual void setInitialGuess(const Policy_t &initialGuess) override
set an initial guess
Definition: SingleShooting-impl.hpp:29
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const size_t STATE_D
Definition: SingleShooting.hpp:26