Heuristic.h
Go to the documentation of this file.
00001 /*
00002  * A footstep planner for humanoid robots
00003  *
00004  * Copyright 2010-2011 Johannes Garimort, Armin Hornung, University of Freiburg
00005  * http://www.ros.org/wiki/footstep_planner
00006  *
00007  *
00008  * This program is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, version 3.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 #ifndef FOOTSTEP_PLANNER_HEURISTIC_H_
00022 #define FOOTSTEP_PLANNER_HEURISTIC_H_
00023 
00024 #include <footstep_planner/helper.h>
00025 #include <footstep_planner/PlanningState.h>
00026 
00027 
00028 namespace footstep_planner
00029 {
00034 class Heuristic
00035 {
00036 public:
00037   enum HeuristicType { EUCLIDEAN=0, EUCLIDEAN_STEPCOST=1, PATH_COST=2 };
00038 
00039   Heuristic(double cell_size, int num_angle_bins, HeuristicType type);
00040   virtual ~Heuristic();
00041 
00047   virtual double getHValue(const PlanningState& from,
00048                            const PlanningState& to) const = 0;
00049 
00050   HeuristicType getHeuristicType() const { return ivHeuristicType; }
00051 
00052 protected:
00053   double ivCellSize;
00054   int    ivNumAngleBins;
00055 
00056   const HeuristicType ivHeuristicType;
00057 };
00058 
00059 
00064 class EuclideanHeuristic : public Heuristic
00065 {
00066 public:
00067   EuclideanHeuristic(double cell_size, int num_angle_bins);
00068   virtual ~EuclideanHeuristic();
00069 
00070   virtual double getHValue(const PlanningState& from,
00071                            const PlanningState& to) const;
00072 };
00073 
00074 
00082 class EuclStepCostHeuristic : public Heuristic
00083 {
00084 
00085 public:
00086   EuclStepCostHeuristic(double cell_size, int num_angle_bins,
00087                         double step_cost, double diff_angle_cost,
00088                         double max_step_width);
00089   virtual ~EuclStepCostHeuristic();
00090 
00091   virtual double getHValue(const PlanningState& from,
00092                            const PlanningState& to) const;
00093 
00094 private:
00095   const double ivStepCost;
00096   const double ivDiffAngleCost;
00097 
00099   const double ivMaxStepWidth;
00100 };
00101 }
00102 #endif  // FOOTSTEP_PLANNER_HEURISTIC_H_


footstep_planner
Author(s): Johannes Garimort, Armin Hornung
autogenerated on Sat Jun 8 2019 20:21:05