11 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
14 : controller_(controller)
18 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
21 : controller_(other.controller_->
clone())
25 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
32 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
39 throw std::runtime_error(
"DisturbedSystemController: nominal controller not set!");
41 controller_->computeControl(state.template head<STATE_DIM>(), t, controlAction);
43 std::cout <<
"DisturbedSystemController computed control: " << controlAction.transpose() << std::endl;
46 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
53 throw std::runtime_error(
"Controller not set!");
54 return controller_->getDerivativeU0(state.head(STATE_DIM), time);
57 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
64 throw std::runtime_error(
"Controller not set!");
65 return controller_->getDerivativeUf(state.head(STATE_DIM), time);
68 template <
size_t STATE_DIM,
size_t DIST_DIM,
size_t CONTROL_DIM,
typename SCALAR>
72 controller_ = controller;
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
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