Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

estimator/estimator.h

Go to the documentation of this file.
00001 #include <math.h>
00002 
00004 // Base class for estimator functionality
00006 class EstimatorBase
00007 {
00008   protected:
00009         double xpos, ypos, angle;       
00010         
00011   public:
00012         // Constructor
00013         EstimatorBase(double x=0, double y=0, double ang=0) :
00014                 xpos(x), ypos(y), angle(ang) { }
00015 
00016                 // Inline functions for getting estimator data
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 // This class uses only encoder data from back wheels to determine
00026 // the truck position
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         // update() :
00044         //  Updates estimated position of truck using encoder data from
00045         //  rear wheels
00046         // Inputs
00047         //  FR - CHANGE in encoder for front right wheel
00048         //  FL - CHANGE in encoder for front left wheel
00049         //  BR - CHANGE in encoder for back right wheel
00050         //  BL - CHANGE in encoder for back left wheel
00051         // Outputs
00052         //  xpos,ypos,angle - updates position and angle values for class
00054         //  Formula - see estimator.cpp for Formula
00056         void update(double fr, double fl, double br, double bl);
00057                 
00058 };

Generated on Fri Sep 1 14:25:44 2006 for Raptor by  doxygen 1.4.4