$search
00001 // SVN $HeadURL: http://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/humanoid_navigation/footstep_planner/include/footstep_planner/Heuristic.h $ 00002 // SVN $Id: Heuristic.h 3298 2012-09-28 11:37:38Z hornunga@informatik.uni-freiburg.de $ 00003 00004 /* 00005 * A footstep planner for humanoid robots 00006 * 00007 * Copyright 2010-2011 Johannes Garimort, Armin Hornung, University of Freiburg 00008 * http://www.ros.org/wiki/footstep_planner 00009 * 00010 * 00011 * This program is free software: you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation, version 3. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 00024 #ifndef FOOTSTEP_PLANNER_HEURISTIC_H_ 00025 #define FOOTSTEP_PLANNER_HEURISTIC_H_ 00026 00027 #include <footstep_planner/helper.h> 00028 #include <footstep_planner/PlanningState.h> 00029 00030 00031 namespace footstep_planner 00032 { 00037 class Heuristic 00038 { 00039 public: 00040 enum HeuristicType { EUCLIDEAN=0, EUCLIDEAN_STEPCOST=1, PATH_COST=2 }; 00041 00042 Heuristic(double cell_size, int num_angle_bins, HeuristicType type); 00043 virtual ~Heuristic(); 00044 00050 virtual double getHValue(const PlanningState& from, 00051 const PlanningState& to) const = 0; 00052 00053 HeuristicType getHeuristicType() const { return ivHeuristicType; }; 00054 00055 protected: 00056 double ivCellSize; 00057 int ivNumAngleBins; 00058 00059 const HeuristicType ivHeuristicType; 00060 }; 00061 00062 00067 class EuclideanHeuristic : public Heuristic 00068 { 00069 public: 00070 EuclideanHeuristic(double cell_size, int num_angle_bins); 00071 virtual ~EuclideanHeuristic(); 00072 00073 virtual double getHValue(const PlanningState& from, 00074 const PlanningState& to) const; 00075 }; 00076 00077 00085 class EuclStepCostHeuristic : public Heuristic 00086 { 00087 00088 public: 00089 EuclStepCostHeuristic(double cell_size, int num_angle_bins, 00090 double step_cost, double diff_angle_cost, 00091 double max_step_width); 00092 virtual ~EuclStepCostHeuristic(); 00093 00094 virtual double getHValue(const PlanningState& from, 00095 const PlanningState& to) const; 00096 00097 private: 00098 const double ivStepCost; 00099 const double ivDiffAngleCost; 00100 00102 const double ivMaxStepWidth; 00103 }; 00104 } 00105 #endif // FOOTSTEP_PLANNER_HEURISTIC_H_