ObsAvoiAlgoPFMKinect.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 
00030 
00031 
00032 #ifndef __OBS_AVOI_ALGO_PFM_H
00033 #define __OBS_AVOI_ALGO_PFM_H
00034 
00035 #include <ObsAvoiAlgo.h>
00036 
00037 namespace MipAlgorithms{
00038  
00040 /* @{ */
00041 
00042 
00043 
00047 class ObsAvoiAlgoParPFMKinect : public ObsAvoiAlgoPar {
00048  
00049  public:
00050   
00052   Decimal ro;
00054   Decimal range;
00056   Decimal ka; 
00058   Decimal kb; 
00060   Decimal kr;
00062   Decimal gamma;
00063   
00065   ObsAvoiAlgoParPFMKinect(){
00066    ro = 0.4;
00067    range = 1;
00068    ka = 0.3;
00069    kb = ro*ka;
00070    kr = 0.002;
00071    gamma = 2;
00072   }
00073   
00080   ObsAvoiAlgoParPFMKinect(Decimal _ro, Decimal _range, Decimal _ka, Decimal _kr, Decimal _gamma){
00081    ro = _ro;
00082    range = _range;
00083    ka = _ka;
00084    kb = ro*ka;
00085    kr = _kr;
00086    gamma = _gamma;
00087   }
00088 
00090   ObsAvoiAlgoParPFMKinect(const ObsAvoiAlgoParPFMKinect &A){
00091    ro = A.ro;
00092    range = A.range;
00093    ka = A.ka;
00094    kb = A.kb;
00095    kr = A.kr;
00096    gamma = A.gamma;
00097   }
00098   
00100   ObsAvoiAlgoParPFMKinect operator= (ObsAvoiAlgoParPFMKinect A){
00101    ro = A.ro;
00102    range = A.range;
00103    ka = A.ka;
00104    kb = A.kb;
00105    kr = A.kr;
00106    gamma = A.gamma;
00107   }
00108  
00109 };
00110 
00111 
00115 class ObsAvoiAlgoPFMKinect {
00116   
00117  protected:
00118   
00120   ObsAvoiAlgoParPFMKinect par;
00121  
00122  private:
00124   Decimal Vr; 
00126   Decimal Wr; 
00128   Decimal Va; 
00130   Decimal Wa;
00132   float Fa_x;
00134   float Fa_y;
00136   float Fr_x;
00138   float Fr_y;
00139 
00143   void repulsiveControl(Pose nearestObstacle, Pose robot);
00144   
00148   void attractiveControl(Pose goal, Pose robot);
00149 
00153   void extractFromPose(Decimal&, Decimal&, Decimal&, const Pose*);
00154  
00155  public:
00156   
00158   ObsAvoiAlgoPFMKinect(){
00159    par = ObsAvoiAlgoParPFMKinect();
00160   }
00161   
00164   ObsAvoiAlgoPFMKinect(ObsAvoiAlgoParPFMKinect OAP){
00165    par = OAP;
00166   }
00167 
00169   void getForces(float& F_x, float& F_y);
00170 
00174   void getControl(Pose* obstacle, Pose goal, Pose robot, ObsAvoiAlgoOut *out);
00175   
00177   string getObjectName() const {
00178    return "ObsAvoiAlgoPFMKinect";
00179   }
00180 };
00181 
00182 
00183 /* @} */
00184 
00185 }; // end namespace MipAlgorithms
00186 
00187 #endif
00188 
00189 
00190 
00191 

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