- 3.0.2 optimal control module.
DisturbedSystem-impl.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 
11 template <size_t STATE_DIM, size_t DIST_DIM, size_t CONTROL_DIM, typename SCALAR>
13  : ct::core::ControlledSystem<AUGMENTED_DIM, CONTROL_DIM, SCALAR>(ct::core::SYSTEM_TYPE::GENERAL)
14 {
15 }
16 
17 template <size_t STATE_DIM, size_t DIST_DIM, size_t CONTROL_DIM, typename SCALAR>
19  std::shared_ptr<ct::core::Controller<STATE_DIM, CONTROL_DIM, SCALAR>> controller)
20  : ct::core::ControlledSystem<AUGMENTED_DIM, CONTROL_DIM, SCALAR>(
21  std::shared_ptr<DisturbedSystemController<STATE_DIM, DIST_DIM, CONTROL_DIM, SCALAR>>(
22  new DisturbedSystemController<STATE_DIM, DIST_DIM, CONTROL_DIM, SCALAR>(controller)),
23  ct::core::SYSTEM_TYPE::GENERAL)
24 {
25  this->controlAction_.setZero();
26 }
27 
28 template <size_t STATE_DIM, size_t DIST_DIM, size_t CONTROL_DIM, typename SCALAR>
30  const std::shared_ptr<ct::core::Controller<STATE_DIM, CONTROL_DIM, SCALAR>> controller)
31 {
32  std::dynamic_pointer_cast<DisturbedSystemController<STATE_DIM, DIST_DIM, CONTROL_DIM, SCALAR>>(this->controller_)
33  ->setController(controller);
34 }
35 
36 } // namespace optcon
37 } // namespace ct
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Disturbed system augments the nominal system so that all the CT interfaces and dimensions are satisfi...
Definition: DisturbedSystem.h:22
SYSTEM_TYPE
GENERAL
DisturbedSystem()
Constructor.
Definition: DisturbedSystem-impl.h:12
Disturbed controller allows us to augment the controller so that all the CT interfaces and dimensions...
Definition: DisturbedSystemController.h:24