30 #ifndef _MIRA_PILOT_ABSTRACTMETRICPLANNER_H_ 31 #define _MIRA_PILOT_ABSTRACTMETRICPLANNER_H_ 39 #include <boost/shared_ptr.hpp> 41 namespace mira {
namespace pilot {
101 virtual double getValue(
const Point2f& worldPos,
bool ignoreDoubleBuffer =
false)
const = 0;
172 bool clearDoubleBuffer =
true,
bool prepareNew =
true) = 0;
181 bool clearDoubleBuffer =
true,
bool prepareNew =
true) = 0;
187 bool clearDoubleBuffer =
true,
bool prepareNew =
true) = 0;
198 typedef std::function<float(int x, int y, float r)>
CostFn;
206 bool clearDoubleBuffer =
true,
bool prepareNew =
true) = 0;
212 bool clearDoubleBuffer =
true,
bool prepareNew =
true) = 0;
300 bool costsInGoalRegion =
true) = 0;
virtual double getValue(const Point2f &worldPos, bool ignoreDoubleBuffer=false) const =0
Returns the cost value at position (in world coordinates) in the planner map.
virtual maps::CostMap getNavFunction(bool ignoreDoubleBuffer=false) const =0
Creates a deep copy of the navigation function that contains the accumulated costs from each cell to ...
virtual maps::GridMap< uint8, 3 > showNavFunctionNearGoal()=0
Create high-res image of navigation function in goal area (for user presentation, debugging)...
std::function< float(int x, int y, float r)> CostFn
Type declaration for a cost function to be used with setGoal(const Polygon2i, ...) or setGoal(const P...
Definition: AbstractMetricPlanner.h:198
virtual Pose2 getCurrentGoal(const Point2f &pos) const =0
Return the current goal point.
virtual Duration getAccumulatedPlanningTime() const =0
Get accumulated planning time since goal was set.
virtual void planTime(Duration plantime)=0
Low level planning interface.
Definition: AbstractMetricPlanner.h:311
Definition: AbstractMetricPlanner.h:315
virtual void plan(const Point2f &pos, Duration plantime)=0
High level planning interface.
virtual void initialize()
Called in initialize(parent).
Definition: AbstractMetricPlanner.h:70
virtual Point2f getGradient(const Point2f &worldPos) const =0
Returns the gradient for a position in world coordinates.
virtual void planStep()=0
Low level planning interface.
Interface for metric planners like Dijkstra and E*.
Definition: AbstractMetricPlanner.h:48
virtual Rect2i getMapRegion() const =0
Get planner map area (map coordinates)
Definition: AbstractMetricPlanner.h:314
std::vector< Point2f > Carrot
Definition: AbstractMetricPlanner.h:53
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
virtual void setGoal(const Point2f &goal, float radius, bool clearDoubleBuffer=true, bool prepareNew=true)=0
virtual double infinity() const =0
Returns the value that is returned by getValue() when cost values are not yet computed or are infinit...
virtual void setRobotPosition(const Point2f &robotPos)
Set the current robot position in planner (world position) Base implementation is empty...
Definition: AbstractMetricPlanner.h:158
virtual void resetPlanningTimeout()=0
Reset initial last plan time that is used for timeout.
boost::geometry::model::ring< Point2i > Polygon2i
virtual void setOnewayMap(const maps::OccupancyGrid &onewayMap)=0
Set a map describing oneway road restrictions.
Definition: AbstractMetricPlanner.h:312
virtual bool haveWork() const =0
Low level planning interface.
virtual void planSteps(int steps)=0
Low level planning interface.
virtual bool havePlanSinceUpdate() const =0
Returns if we have or have had a valid path to the set goal, after the cost map was updated...
virtual Point2f map2world(const Point2i &p) const =0
Convert a given point to world coordinates.
std::list< Rect2i > DirtyRegions
virtual bool havePlan() const =0
Returns if we have or have had a valid path to the set goal.
virtual double getValueFiltered(const Point2f &worldPos, bool ignoreDoubleBuffer=false) const =0
Returns the interpolated cost value at position (in world coordinates) in the planner map...
Definition: AbstractMetricPlanner.h:316
void update(const maps::CostMap &map)
Update the planning context with the current costmap (entire area).
virtual ~AbstractMetricPlanner()
Definition: AbstractMetricPlanner.h:58
virtual float getCellSize() const =0
Get planner map cell size.
virtual bool hasValidGoal() const =0
Check if the internal planner has a goal.
boost::geometry::model::ring< Point2f > Polygon2f
virtual Rect2f getRegion() const =0
Get planner map area (world coordinates)
Status
Planner status of a fixed position (planner map cell)
Definition: AbstractMetricPlanner.h:308
boost::shared_ptr< AbstractMetricPlanner > AbstractMetricPlannerPtr
Definition: AbstractMetricPlanner.h:325
virtual Time lastValidPlan() const =0
Return last time a valid plan existed.
Definition: AbstractMetricPlanner.h:310
Status::StatusMode getStatus() const
virtual Carrot getCarrot(const Point2f &pos, int maxCount, float maxDistance=1e10f) const =0
Return the optimal path to the goal, starting at pos.
Definition: AbstractMetricPlanner.h:313
virtual Point2i world2map(const Point2f &p) const =0
Convert a given point to integer map coordinates.
virtual maps::GridMap< uint8, 3 > dumpNavStatus(bool useDoubleBuffer=false, bool costsInGoalRegion=true)=0
Create a color image of the navigation function (for user presentation, debugging).