FSG / PosVelFilter

Fork of PosVelFilter_7_14 by Troy Holley

Committer:
tzyoung
Date:
Thu Apr 27 13:15:55 2017 +0000
Revision:
0:82f27e7e99f0
Child:
2:992e774dc62a
initial release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tzyoung 0:82f27e7e99f0 1 #ifndef MBED_DEPTHFILTER_H
tzyoung 0:82f27e7e99f0 2 #define MBED_DEPTHFILTER_H
tzyoung 0:82f27e7e99f0 3
tzyoung 0:82f27e7e99f0 4 #include "mbed.h"
tzyoung 0:82f27e7e99f0 5
tzyoung 0:82f27e7e99f0 6 class PosVelFilter
tzyoung 0:82f27e7e99f0 7 {
tzyoung 0:82f27e7e99f0 8 public:
tzyoung 0:82f27e7e99f0 9 PosVelFilter();
tzyoung 0:82f27e7e99f0 10
tzyoung 0:82f27e7e99f0 11 void update();
tzyoung 0:82f27e7e99f0 12
tzyoung 0:82f27e7e99f0 13 void init();
tzyoung 0:82f27e7e99f0 14
tzyoung 0:82f27e7e99f0 15 float getPosition();
tzyoung 0:82f27e7e99f0 16 float getVelocity();
tzyoung 0:82f27e7e99f0 17 float getDt();
tzyoung 0:82f27e7e99f0 18
tzyoung 0:82f27e7e99f0 19 // void setConfigFlag();
tzyoung 0:82f27e7e99f0 20 void writeWn(float wn);
tzyoung 0:82f27e7e99f0 21
tzyoung 0:82f27e7e99f0 22 protected:
tzyoung 0:82f27e7e99f0 23 float x1;
tzyoung 0:82f27e7e99f0 24 float x2;
tzyoung 0:82f27e7e99f0 25 float x2_dot;
tzyoung 0:82f27e7e99f0 26 float x1_dot;
tzyoung 0:82f27e7e99f0 27 float w_n;
tzyoung 0:82f27e7e99f0 28
tzyoung 0:82f27e7e99f0 29 float last_time;
tzyoung 0:82f27e7e99f0 30 float curr_time;
tzyoung 0:82f27e7e99f0 31 float dt;
tzyoung 0:82f27e7e99f0 32
tzyoung 0:82f27e7e99f0 33 float conv_distance;
tzyoung 0:82f27e7e99f0 34 float position;
tzyoung 0:82f27e7e99f0 35 float velocity;
tzyoung 0:82f27e7e99f0 36
tzyoung 0:82f27e7e99f0 37 // bool readConfiguration();
tzyoung 0:82f27e7e99f0 38 // bool configFlag;
tzyoung 0:82f27e7e99f0 39 // int count;
tzyoung 0:82f27e7e99f0 40 };
tzyoung 0:82f27e7e99f0 41
tzyoung 0:82f27e7e99f0 42 #endif