sot-core  4.11.2
Hierarchical task solver plug-in for dynamic-graph.
exp-moving-avg.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018,
3  * Julian Viereck
4  *
5  * CNRS/AIST
6  *
7  */
8 
9 #ifndef __SOT_EXPMOVINGAVG_H__
10 #define __SOT_EXPMOVINGAVG_H__
11 
12 /* --------------------------------------------------------------------- */
13 /* --- INCLUDE --------------------------------------------------------- */
14 /* --------------------------------------------------------------------- */
15 
16 #include <dynamic-graph/entity.h>
17 #include <dynamic-graph/signal-ptr.h>
18 #include <dynamic-graph/signal-time-dependent.h>
19 #include <sot/core/config.hh>
20 
21 namespace dynamicgraph {
22 namespace sot {
23 
24 /* --------------------------------------------------------------------- */
25 /* --- TRACER ---------------------------------------------------------- */
26 /* --------------------------------------------------------------------- */
27 
28 using dynamicgraph::Entity;
29 using dynamicgraph::SignalPtr;
30 using dynamicgraph::SignalTimeDependent;
31 
32 class SOT_CORE_DLLAPI ExpMovingAvg : public Entity {
33  DYNAMIC_GRAPH_ENTITY_DECL();
34 
35 public:
36  SignalPtr<dynamicgraph::Vector, int> updateSIN;
37  SignalTimeDependent<int, int> refresherSINTERN;
38  SignalTimeDependent<dynamicgraph::Vector, int> averageSOUT;
39 
40 public:
41  ExpMovingAvg(const std::string &n);
42  virtual ~ExpMovingAvg(void);
43 
44  void setAlpha(const double &alpha_);
45 
46 protected:
47  dynamicgraph::Vector &update(dynamicgraph::Vector &res, const int &inTime);
48 
49  dynamicgraph::Vector average;
50 
51  double alpha;
52  bool init;
53 };
54 
55 } /* namespace sot */
56 } /* namespace dynamicgraph */
57 
58 #endif /* #ifndef __SOT_TRACER_H__ */
double alpha
Definition: exp-moving-avg.hh:51
Definition: exp-moving-avg.hh:32
bool init
Definition: exp-moving-avg.hh:52
dynamicgraph::Vector average
Definition: exp-moving-avg.hh:49
SignalTimeDependent< int, int > refresherSINTERN
Definition: exp-moving-avg.hh:37
SignalTimeDependent< dynamicgraph::Vector, int > averageSOUT
Definition: exp-moving-avg.hh:38
SignalPtr< dynamicgraph::Vector, int > updateSIN
Definition: exp-moving-avg.hh:36
Definition: abstract-sot-external-interface.hh:17