ObsAvoiAlgoVFH.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_VFH_H
00033 #define __OBS_AVOI_ALGO_VFH_H
00034 
00035 #include <ObsAvoiAlgo.h>
00036 #include "AlgoVFH.h"
00037 
00038 namespace MipAlgorithms{
00039  
00041 /* @{ */
00042 
00043 
00044 
00048 class ObsAvoiAlgoParVFH : public ObsAvoiAlgoPar {
00049  
00050  public:  
00052   Decimal cellSize;           
00054   int windowDiameter;        
00056   int sectorAngle;         
00058   Decimal safetyDist0ms;         
00060   Decimal safetyDist1ms;         
00062   int maxSpeed;         
00064   int maxSpeedNarrowOpening;        
00066   int maxSpeedWideOpening;       
00068   int maxAcceleration;       
00070   int minTurnrate;         
00072   int maxTurnrate0ms;         
00074   int maxTurnrate1ms;         
00076   Decimal minTurnRadiusSafetyFactor;      
00078   Decimal freeSpaceCutoff0ms;      
00080   Decimal obsCutoff0ms;         
00082   Decimal freeSpaceCutoff1ms;      
00084   Decimal obsCutoff1ms;         
00086   Decimal weightDesiredDir;         
00088   Decimal weightCurrentDir;         
00090   Decimal goalDistTolerance;      
00092   Decimal robotRadius;         
00093   
00094   
00097   ObsAvoiAlgoParVFH();
00098   
00101   ObsAvoiAlgoParVFH(Decimal cellSizeP,
00102            int windowDiameterP, 
00103            int sectorAngleP, 
00104            Decimal safetyDist0msP,
00105            Decimal safetyDist1msP,
00106            int maxSpeedP, 
00107            int maxSpeedNarrowOpeningP,
00108            int maxSpeedWideOpeningP, 
00109            int maxAccelerationP, 
00110            int minTurnrateP, 
00111            int maxTurnrate0msP, 
00112            int maxTurnrate1msP,
00113            Decimal minTurnRadiusSafetyFactorP, 
00114            Decimal freeSpaceCutoff0msP,
00115            Decimal obsCutoff0msP,
00116            Decimal freeSpaceCutoff1msP,
00117            Decimal obsCutoff1msP,
00118            Decimal weightDesiredDirP, 
00119            Decimal weightCurrentDirP, 
00120            Decimal goalDistToleranceP, 
00121            Decimal robotRadiusP);
00122   
00124   ObsAvoiAlgoParVFH(const ObsAvoiAlgoParVFH &A);
00125   
00127   ObsAvoiAlgoParVFH operator= (ObsAvoiAlgoParVFH A);
00128 };
00129 
00130 
00134 class ObsAvoiAlgoVFH : public ObsAvoiAlgo {
00135   
00136  protected:
00137   
00138   ObsAvoiAlgoParVFH par;
00139  
00140  private:
00141   
00143   VFH_Algorithm *vfhAlgorithm;
00146   void init();
00147   
00153   void getLaserRanges(Scan& scan, Decimal laserRanges[361][2], int laserCount);
00154   
00161   void subSampleScan(Scan& scan, Angle angStart, Angle angRes, int samples);
00162   
00163  public:
00164   
00166   ObsAvoiAlgoVFH(){
00167    par = ObsAvoiAlgoParVFH();
00168    init();
00169   }
00170   
00173   ObsAvoiAlgoVFH(ObsAvoiAlgoParVFH OAP){
00174    par = OAP;
00175    init();
00176   }
00177 
00181   void getControl(ObsAvoiAlgoIn &in, ObsAvoiAlgoOut *out);
00182   
00183   
00185   string getObjectName() const {
00186    return "ObsAvoiAlgoVFH";
00187   }
00188 };
00189 
00190 /* @} */
00191 
00192 
00193 }; // end namespace MipAlgorithms
00194 
00195 
00196 #endif
00197 
00198 
00199 
00200 

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