mobRob2DPIDController.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __MOB_ROB_2D_CTRL
00027 #define __MOB_ROB_2D_CTRL
00028
00029 #include <Spaces.h>
00030 #include <MobileRob.h>
00031 #include <math.h>
00032
00033 namespace MipAlgorithms{
00034
00035
00036
00037 class mobRob2DPIDControllerPars {
00038 public:
00039 Decimal b;
00040 unsigned int k1;
00041 unsigned int k2;
00042 unsigned int k3;
00043 Pose* objPose;
00044 Decimal objLv;
00045 Decimal objAv;
00046 mobRob2DPIDControllerPars();
00047 mobRob2DPIDControllerPars(const mobRob2DPIDControllerPars&);
00048 ~mobRob2DPIDControllerPars();
00049 string print();
00050 };
00051
00052
00053
00054
00055 class mobRob2DPIDController {
00056 private:
00057 mobRob2DPIDControllerPars* _pars;
00058 Decimal _integral_x;
00059 Decimal _integral_y;
00060 Decimal _previousTimeStamp;
00061
00062 bool firstStep;
00064 void extractFromState(Decimal&, Pose&, Decimal&, Decimal&, MotionModuleTState*);
00066 void extractFromPose(Decimal&, Decimal&, Decimal&, const Pose*);
00068 void computeCTRLPointCoords(Decimal&, Decimal&, const Pose*);
00070 void computeCTRLPointVel(Decimal&, Decimal&, const Decimal, const Decimal, const Decimal);
00072 void computeRobotVelocities(Decimal&, Decimal&, const Decimal, const Decimal, const Decimal);
00073 public:
00076 mobRob2DPIDController(const mobRob2DPIDControllerPars*);
00078 ~mobRob2DPIDController();
00085 bool step(Decimal&, Decimal&, MotionModuleTState*);
00086
00087 };
00088 }
00089
00090 #endif
00091
00092