- 3.0.2 core module.
ConstantTrajectoryController.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 ConstantTrajectoryController : public Controller<STATE_DIM, CONTROL_DIM, SCALAR>
21 {
22 public:
23  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 
26 
31 
37  : uff_(u), x_(x)
38  {
39  }
40 
43  : Controller<STATE_DIM, CONTROL_DIM, SCALAR>(other), x_(other.x_), uff_(other.uff_)
44  {
45  }
46 
50 
55  {
57  }
58 
60 
68  const SCALAR& t,
69  ControlVector<CONTROL_DIM, SCALAR>& controlAction) override
70  {
71  throw std::runtime_error("not implemented");
72  }
73 
75 
81 
85 
91 
96 private:
99 };
100 }
101 }
const StateVectorArray< STATE_DIM, SCALAR > & getStateVectorArray() const
Get the fixed state trajectory.
Definition: ConstantTrajectoryController.h:95
An discrete array (vector) of a particular data type.
Definition: DiscreteArray.h:22
void computeControl(const StateVector< STATE_DIM, SCALAR > &state, const SCALAR &t, ControlVector< CONTROL_DIM, SCALAR > &controlAction) override
Computes current control.
Definition: ConstantTrajectoryController.h:67
ConstantTrajectoryController< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
Clone operator.
Definition: ConstantTrajectoryController.h:54
A constant controller.
Definition: ConstantTrajectoryController.h:20
ConstantTrajectoryController(const ConstantTrajectoryController< STATE_DIM, CONTROL_DIM, SCALAR > &other)
Copy constructor.
Definition: ConstantTrajectoryController.h:42
const ControlVectorArray< CONTROL_DIM, SCALAR > & getControlVectorArray() const
Get the fixed control signal.
Definition: ConstantTrajectoryController.h:83
Definition: ControlVector.h:12
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Definition: StateVector.h:12
~ConstantTrajectoryController()
Destructor.
Definition: ConstantTrajectoryController.h:48
void setControlVectorArray(const ControlVectorArray< CONTROL_DIM, SCALAR > &u)
Sets the control signal.
Definition: ConstantTrajectoryController.h:79
void setStateVectorArray(const StateVectorArray< STATE_DIM, SCALAR > &x)
Sets the state trajectory.
Definition: ConstantTrajectoryController.h:89
ConstantTrajectoryController(const ControlVectorArray< CONTROL_DIM, SCALAR > &u, const StateVectorArray< STATE_DIM, SCALAR > &x)
Constructor.
Definition: ConstantTrajectoryController.h:35
Interface class for all controllers.
Definition: Controller.h:26
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstantTrajectoryController()
Default constructor.
Definition: ConstantTrajectoryController.h:29