MIRA
EstarPlanner.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Redistribution and modification of this code is strictly prohibited.
9  *
10  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
11  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
12  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
13  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  *
15  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
16  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
19  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
20  */
21 
30 #ifndef _MIRA_PILOT_ESTARPLANNER_H_
31 #define _MIRA_PILOT_ESTARPLANNER_H_
32 
34 
35 namespace estar {
36 
38 class Facade;
39 class Grid;
40 class Algorithm;
41 class Kernel;
42 
43 }
44 
45 namespace mira { namespace pilot {
46 
48 
50 {
52 public:
53  EstarPlanner(bool useDoubleBuffer = false,
54  bool persistentDoubleBuffer = false);
55  virtual ~EstarPlanner() {}
56 
57  template <typename Reflector>
58  void reflect(Reflector& r)
59  {
61  }
62 
63 public:
64 
65  // Implementation of AbstractMetricPlanner::infinity()
66  virtual double infinity() const;
67 
69  virtual bool hasValidGoal() const;
70 
72  virtual bool haveWork() const;
73 
75  virtual void planStep();
76 
77 public:
78 
80  virtual double getCurrentValueMap(const Point2i& mapPos) const;
81 
83  virtual Carrot getCurrentCarrot(const Point2f& pos, int maxCount,
84  float maxDistance = 1e10f) const;
85 
87  virtual maps::CostMap getCurrentNavFunction() const;
88 
89 protected:
90 
95  virtual Status getStatusMap(const Point2i& p) const;
96 
101  virtual Img8U1 getStatusField() const;
102 
103 protected:
104 
105  virtual bool isValid() const;
106  virtual void reset();
107  virtual void copyDoubleBuffer();
108  virtual void removeGoals();
109  virtual void addGoal(const Point2i& p, float cost);
110  virtual void freeCell(const Point2i& p);
111  virtual void dirtyCell(const Point2i& p, double value);
112 
113 protected:
114 
115  boost::shared_ptr<estar::Facade> mFacade;
116  boost::shared_ptr<estar::Grid> mGrid;
117  boost::shared_ptr<estar::Algorithm> mAlgorithm;
118  boost::shared_ptr<estar::Kernel> mKernel;
119 };
120 
122 
123 }}
124 
125 #endif
virtual bool hasValidGoal() const
Implementation of AbstractMetricPlanner::hasValidGoal()
virtual void planStep()
Implementation of AbstractMetricPlanner::planStep()
virtual Carrot getCurrentCarrot(const Point2f &pos, int maxCount, float maxDistance=1e10f) const
Implementation of MetricPlannerBase::getCurrentCarrot()
EstarPlanner(bool useDoubleBuffer=false, bool persistentDoubleBuffer=false)
Definition: EstarPlanner.h:35
virtual double getCurrentValueMap(const Point2i &mapPos) const
Implementation of MetricPlannerBase::getCurrentValueMap()
Base class for implementations of metric planners like Dijkstra and E*.
Definition: MetricPlannerBase.h:55
virtual double infinity() const
Implementation of AbstractMetricPlanner::infinity().
virtual bool haveWork() const
Implementation of AbstractMetricPlanner::haveWork()
virtual void dirtyCell(const Point2i &p, double value)
Update a cell&#39;s cost map value in the planner&#39;s internal cost function representation.
#define MIRA_REFLECT_BASE(reflector, BaseClass)
virtual void removeGoals()
Remove all set goals.
boost::shared_ptr< estar::Algorithm > mAlgorithm
Definition: EstarPlanner.h:117
StatusMap getStatusMap() const
virtual void freeCell(const Point2i &p)
Mark a cell as free in the planner&#39;s internal cost function representation.
std::vector< Point2f > Carrot
Definition: AbstractMetricPlanner.h:53
boost::shared_ptr< estar::Grid > mGrid
Definition: EstarPlanner.h:116
virtual void reset()
Re-initialize internal structures.
void reflect(Reflector &r)
Definition: EstarPlanner.h:58
virtual bool isValid() const
Return whether planner is properly initialized and able to calculate a path (when a goal is set) ...
virtual Img8U1 getStatusField() const
Implementation of MetricPlannerBase::getStatusField().
virtual maps::CostMap getCurrentNavFunction() const
Implementation of MetricPlannerBase::getCurrentNavFunction()
#define MIRA_OBJECT(classIdentifier)
boost::shared_ptr< estar::Kernel > mKernel
Definition: EstarPlanner.h:118
virtual void addGoal(const Point2i &p, float cost)
Add a goal cell with a certain cost (e.g.
virtual void copyDoubleBuffer()
Copy entire field of internally calculated cost values to mDoubleBuffer.
virtual ~EstarPlanner()
Definition: EstarPlanner.h:55
boost::shared_ptr< estar::Facade > mFacade
Definition: EstarPlanner.h:115
Definition: EstarPlanner.h:49
Base class for implementations of metric planners like Dijkstra and E*.