mobRob2DPIDController.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // $Id$
00004 //
00005 // Copyright 2008, 2009, 2010, 2011, 2012  Antonio Franchi and Paolo Stegagno    
00006 //
00007 // This file is part of MIP.
00008 //
00009 // MIP is free software: you can redistribute it and/or modify
00010 // it under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation, either version 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // MIP is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>.
00021 //
00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it
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 // ///\class mobRob2DPIDControllerPars
00035 // ///\brief Contains the parameters for the Controller.
00036 // ///\author Roberto Capobianco, Chiara Picardi, Lorenzo Saccares
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 // ///\class mobRob2DPIDController
00053 // ///\brief Contains the parameters and the methods needed to compute a I/O Linearization Controller for a MobileRob Khepera.
00054 // ///\author Roberto Capobianco, Chiara Picardi, Lorenzo Saccares
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 

Generated on Mon Feb 20 07:01:06 2017 for MIP by  doxygen 1.5.6