- 3.0.2 core module.
StepInputController.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
core {
10
12
30
class
StepInputController
:
public
Controller
<1, 1, double>
31
{
32
public
:
34
37
struct
Parameters
38
{
39
Parameters
(
double
gain_ = 1.0,
double
t_step_ = 1.0) :
gain
(gain_),
t_step
(t_step_) {}
40
double
gain
;
41
Time
t_step
;
42
};
43
45
StepInputController
(
const
Parameters
& parameters =
Parameters
()) : parameters_(parameters) {}
47
StepInputController
(
const
StepInputController
& arg) : parameters_(arg.parameters_) {}
49
StepInputController
*
clone
()
const override
{
return
new
StepInputController
(*
this
); }
51
57
void
computeControl
(
const
StateVector<1, double>
& state,
58
const
double
& t,
59
ControlVector<1, double>
& controlAction)
override
60
{
61
controlAction(0) = parameters_.gain * (t >= parameters_.t_step);
62
}
63
64
private
:
65
Parameters
parameters_;
66
};
67
}
// namespace core
68
}
// namespace ct
ct::core::StepInputController::computeControl
void computeControl(const StateVector< 1, double > &state, const double &t, ControlVector< 1, double > &controlAction) override
computes control input
Definition:
StepInputController.h:57
ct::core::StepInputController
A simple step input.
Definition:
StepInputController.h:30
ct::core::StepInputController::StepInputController
StepInputController(const StepInputController &arg)
copy constructor
Definition:
StepInputController.h:47
ct::core::StepInputController::clone
StepInputController * clone() const override
deep cloning
Definition:
StepInputController.h:49
ct::core::StepInputController::StepInputController
StepInputController(const Parameters ¶meters=Parameters())
default constructor
Definition:
StepInputController.h:45
ct::core::ControlVector
Definition:
ControlVector.h:12
ct::core::StepInputController::Parameters::Parameters
Parameters(double gain_=1.0, double t_step_=1.0)
Definition:
StepInputController.h:39
ct::core::StateVector
Definition:
StateVector.h:12
ct::core::StepInputController::Parameters::gain
double gain
Definition:
StepInputController.h:40
ct::core::StepInputController::Parameters::t_step
Time t_step
gain
Definition:
StepInputController.h:41
ct
ct::core::StepInputController::Parameters
Parameters of the step input function.
Definition:
StepInputController.h:37
ct::core::Time
double Time
Definition:
Time.h:11
ct::core::Controller
Interface class for all controllers.
Definition:
Controller.h:26
include
ct
core
control
continuous_time
siso
StepInputController.h
Generated on Wed Feb 19 2020 15:14:18 by
1.8.13