39 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR =
double>
43 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 typedef typename std::shared_ptr<DiscreteControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR>>
Ptr;
75 controller_ = std::shared_ptr<DiscreteController<STATE_DIM, CONTROL_DIM, SCALAR>>(arg.
controller_->clone());
115 virtual void propagateDynamics(
const state_vector_t& state,
const time_t
n, state_vector_t& stateNext)
override 117 control_vector_t controlAction;
119 controller_->computeControl(state, n, controlAction);
121 controlAction.setZero();
137 const control_vector_t& control,
138 state_vector_t& stateNext) = 0;
142 std::shared_ptr<DiscreteController<STATE_DIM, CONTROL_DIM, SCALAR>>
controller_;
void setController(const std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &controller)
set a new controller
Definition: DiscreteControlledSystem.h:88
virtual void propagateControlledDynamics(const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext)=0
propagates the controlled system dynamics forward by one step
DiscreteControlledSystem(const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
default constructor
Definition: DiscreteControlledSystem.h:57
virtual ~DiscreteControlledSystem()=default
destructor
DiscreteControlledSystem(const ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > &arg)
copy constructor
Definition: DiscreteControlledSystem.h:71
DiscreteControlledSystem(std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
constructor
Definition: DiscreteControlledSystem.h:66
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > > getController()
get the controller instace
Definition: DiscreteControlledSystem.h:107
Base::state_vector_t state_vector_t
Definition: DiscreteControlledSystem.h:49
Base::control_vector_t control_vector_t
Definition: DiscreteControlledSystem.h:50
A general, non-linear discrete dynamic system with a control input.
Definition: DiscreteControlledSystem.h:40
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > > controller_
the controller instance
Definition: DiscreteControlledSystem.h:142
CppAD::AD< CppAD::cg::CG< double > > SCALAR
constexpr size_t n
Definition: MatrixInversionTest.cpp:14
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > Ptr
Definition: DiscreteControlledSystem.h:45
DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR > Base
Definition: DiscreteControlledSystem.h:47
Interface class for all controllers.
Definition: DiscreteController.h:22
std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, SCALAR > > controller_
the controller instance
Definition: ControlledSystem.h:145
SYSTEM_TYPE
type of system
Definition: System.h:15
any non-specific system
Definition: System.h:17
Base::time_t time_t
Definition: DiscreteControlledSystem.h:51
void getController(std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &controller) const
get the controller instance
Definition: DiscreteControlledSystem.h:98
Definition: DiscreteSystem.h:12
int time_t
the type of the time variable
Definition: DiscreteSystem.h:15
virtual DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override=0
deep copy
A general, non-linear dynamic system with a control input.
Definition: ControlledSystem.h:46
virtual void propagateDynamics(const state_vector_t &state, const time_t n, state_vector_t &stateNext) override
propagates the system dynamics forward by one step
Definition: DiscreteControlledSystem.h:115