James Kiwic
/
RT2_P3_students
Fertig
Fork of RT2_P3_students by
Diff: DiffCounter.h
- Revision:
- 0:78ca29b4c49e
- Child:
- 1:a30512c3ac73
diff -r 000000000000 -r 78ca29b4c49e DiffCounter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DiffCounter.h Tue Apr 03 08:47:41 2018 +0000 @@ -0,0 +1,28 @@ +/* DiffCounter Class, differentiate encoder counts for cuboid based on LP filter + and unwrapping + + 1/tau*(z-1) +G(z) = ------------ + z - a0 +*/ + +class DiffCounter{ + public: + DiffCounter(float a,float b); + float operator()(short inc){ + return doStep(inc); + } + virtual ~DiffCounter(); + void reset(float,short); + float doStep(short inc); + float Ts; + + private: + + float alpha; + float a0; + short inc_old; + float v_old; + long del; + float inc2rad; +}; \ No newline at end of file