Convolution.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef CONVOLUTION_H
11 #define CONVOLUTION_H
12 
13 // </rtc-template>
14 
15 #include "../Stabilizer/Integrator.h"
16 
17 class Convolution {
18 public:
19  // if range = 0, integrate from 0 to t. Otherwise, integrate from t - (range - 1) * dt to t.
20  Convolution(double _dt = 0.005, unsigned int _range = 0);
21  ~Convolution(void);
22  void reset(void);
23  void setup(double _dt, unsigned int _range);
24  void update(double _f, double _g);
25  double calculate(void);
26 private:
27  double dt; // control cycle
28  unsigned int range; // integration range (from t_now - range * dt to t_now [sec])
29  std::deque<double> f_buffer; // integration data buffer for f
30  std::deque<double> g_buffer; // integration data buffer for g
31  long long buffer_size; // buffer size of convolution values (f, g)
32  Integrator integrator; // convolution(f, g) = integrate(f(x)*g(t-x), x=0, x=t);
33 };
34 
35 #endif // CONVOLUTION_H
std::deque< double > f_buffer
Definition: Convolution.h:29
void setup(double _dt, unsigned int _range)
Definition: Convolution.cpp:30
double calculate(void)
Definition: Convolution.cpp:50
unsigned int range
Definition: Convolution.h:28
long long buffer_size
Definition: Convolution.h:31
double dt
Definition: Convolution.h:27
Convolution(double _dt=0.005, unsigned int _range=0)
Definition: Convolution.cpp:14
void reset(void)
Definition: Convolution.cpp:22
~Convolution(void)
Definition: Convolution.cpp:19
std::deque< double > g_buffer
Definition: Convolution.h:30
Integrator integrator
Definition: Convolution.h:32
void update(double _f, double _g)
Definition: Convolution.cpp:38


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Sat Dec 17 2022 03:52:20