- 3.0.2 core module.
ConstantController.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 #include "Controller.h"
9 
10 namespace ct {
11 namespace core {
12 
14 
19 template <size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
20 class ConstantController : public Controller<STATE_DIM, CONTROL_DIM, SCALAR>,
21  public DiscreteController<STATE_DIM, CONTROL_DIM, SCALAR>
22 {
23 public:
24  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 
27 
31 
33 
38 
41 
43  virtual ~ConstantController();
44 
46 
51 
53 
61  const SCALAR& t,
62  ControlVector<CONTROL_DIM, SCALAR>& controlAction) override;
63 
66  const int n,
67  ControlVector<CONTROL_DIM, SCALAR>& controlAction) override;
68 
70 
75 
77 
82 
84  const SCALAR time) override;
85 
86 private:
88 };
89 } // namespace core
90 } // namespace ct
ct::core::ControlVector< control_dim > u
A constant controller.
Definition: ConstantController.h:20
ConstantController< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
Clone operator.
Definition: ConstantController-impl.h:36
clear all close all load ct GNMSLog0 mat reformat t
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstantController()
Default constructor.
Definition: ConstantController-impl.h:13
Definition: ControlVector.h:12
CppAD::AD< CppAD::cg::CG< double > > SCALAR
constexpr size_t n
Definition: MatrixInversionTest.cpp:14
Definition: StateVector.h:12
Interface class for all controllers.
Definition: DiscreteController.h:22
void setControl(const ControlVector< CONTROL_DIM, SCALAR > &u)
Sets the control signal.
Definition: ConstantController-impl.h:58
virtual ControlMatrix< CONTROL_DIM, SCALAR > getDerivativeU0(const StateVector< STATE_DIM, SCALAR > &state, const SCALAR time) override
Returns the the derivative of the control with respect to the initial control input u0...
Definition: ConstantController-impl.h:70
const ControlVector< CONTROL_DIM, SCALAR > & getControl() const
Get the fixed control signal.
Definition: ConstantController-impl.h:64
void computeControl(const StateVector< STATE_DIM, SCALAR > &state, const SCALAR &t, ControlVector< CONTROL_DIM, SCALAR > &controlAction) override
Computes current control.
Definition: ConstantController-impl.h:42
virtual ~ConstantController()
Destructor.
Definition: ConstantController-impl.h:31
Definition: ControlMatrix.h:12
Interface class for all controllers.
Definition: Controller.h:26