00001 #include <math.h>
00002
00004
00006 class EstimatorBase
00007 {
00008 protected:
00009 double xpos, ypos, angle;
00010
00011 public:
00012
00013 EstimatorBase(double x=0, double y=0, double ang=0) :
00014 xpos(x), ypos(y), angle(ang) { }
00015
00016
00017 inline double getXPos(void) {return xpos;}
00018 inline double getYPos(void) {return ypos;}
00019 inline double getAngle(void) {return angle;}
00020
00021 };
00022
00023
00025
00026
00028 class EncEstimator : public EstimatorBase
00029 {
00030 protected:
00031 double cosValue, sinValue;
00032
00033 public:
00034
00035 EncEstimator(double x=0.0, double y=0.0, double ang=0.0)
00036 : EstimatorBase(x,y,ang)
00037 {
00038 cosValue = cos(ang);
00039 sinValue = sin(ang);
00040 }
00041
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00054
00056 void update(double fr, double fl, double br, double bl);
00057
00058 };