1 #ifndef ORG_EEROS_CONTROL_D_HPP_
2 #define ORG_EEROS_CONTROL_D_HPP_
9 template <
typename T =
double >
17 prev = this->
in.getSignal();
18 this->
out.getSignal().clear();
19 this->
out.getSignal().setTimestamp(this->
in.getSignal().getTimestamp());
23 double tin = this->
in.getSignal().getTimestamp() / 1000000000.0;
24 double tprev = this->
prev.getTimestamp() / 1000000000.0;
25 T valin = this->
in.getSignal().getValue();
26 T valprev = this->
prev.getValue();
28 this->
out.getSignal().setValue((valin - valprev) / (tin - tprev));
29 this->
out.getSignal().setTimestamp((this->
in.getSignal().getTimestamp() + this->
prev.getTimestamp()) / 2);
31 prev = this->
in.getSignal();
Output< T > out
Definition: Block1i1o.hpp:26
bool first
Definition: D.hpp:37
Input< T > in
Definition: Block1i1o.hpp:25
Definition: Block1i1o.hpp:12
Definition: Signal.hpp:14
virtual void run()
Definition: D.hpp:15
Signal< T > prev
Definition: D.hpp:36