- 3.0.2 optimal control module.
DisturbedSystemController.h
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 namespace ct {
9 namespace optcon {
10 
23 template <size_t STATE_DIM, size_t DIST_DIM, size_t CONTROL_DIM, typename SCALAR = double>
24 class DisturbedSystemController : public ct::core::Controller<STATE_DIM + DIST_DIM, CONTROL_DIM, SCALAR>
25 {
26 public:
27  static const size_t AUGMENTED_DIM = STATE_DIM + DIST_DIM;
28 
31  std::shared_ptr<ct::core::Controller<STATE_DIM, CONTROL_DIM, SCALAR>> controller = nullptr);
32 
35 
37  DisturbedSystemController* clone() const override;
38 
41  const SCALAR& t,
42  ct::core::ControlVector<CONTROL_DIM, SCALAR>& controlAction) override;
43 
47  const SCALAR time) override;
48 
52  const SCALAR time) override;
53 
56 
57 private:
58  std::shared_ptr<ct::core::Controller<STATE_DIM, CONTROL_DIM, SCALAR>> controller_;
59 };
60 
61 } // namespace optcon
62 } // namespace ct
void computeControl(const ct::core::StateVector< AUGMENTED_DIM, SCALAR > &state, const SCALAR &t, ct::core::ControlVector< CONTROL_DIM, SCALAR > &controlAction) override
Implementation of the base computeControl method.
Definition: DisturbedSystemController-impl.h:33
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
ct::core::ControlMatrix< CONTROL_DIM, SCALAR > getDerivativeU0(const ct::core::StateVector< AUGMENTED_DIM, SCALAR > &state, const SCALAR time) override
Implementation of the base getDerivativeU0 method.
Definition: DisturbedSystemController-impl.h:48
CppAD::AD< CppAD::cg::CG< double > > SCALAR
static const size_t AUGMENTED_DIM
Definition: DisturbedSystemController.h:27
void setController(std::shared_ptr< ct::core::Controller< STATE_DIM, CONTROL_DIM, SCALAR >> controller)
Sets the nominal controller.
Definition: DisturbedSystemController-impl.h:69
ct::core::ControlMatrix< CONTROL_DIM, SCALAR > getDerivativeUf(const ct::core::StateVector< AUGMENTED_DIM, SCALAR > &state, const SCALAR time) override
Implementation of the base getDerivativeUf method.
Definition: DisturbedSystemController-impl.h:59
DisturbedSystemController * clone() const override
Clone method.
Definition: DisturbedSystemController-impl.h:27
DisturbedSystemController(std::shared_ptr< ct::core::Controller< STATE_DIM, CONTROL_DIM, SCALAR >> controller=nullptr)
Constructor. Takes in the nominal controller.
Definition: DisturbedSystemController-impl.h:12
Disturbed controller allows us to augment the controller so that all the CT interfaces and dimensions...
Definition: DisturbedSystemController.h:24