39 #ifndef NAV2_NAVFN_PLANNER__NAVFN_HPP_
40 #define NAV2_NAVFN_PLANNER__NAVFN_HPP_
47 namespace nav2_navfn_planner
51 #define COST_UNKNOWN_ROS 255
53 #define COST_OBS_ROS 253
65 #define COST_NEUTRAL 50
66 #define COST_FACTOR 0.8
72 #define COSTTYPE unsigned char
76 #define POT_HIGH 1.0e10
79 #define PRIORITYBUFSIZE 10000
93 int create_nav_plan_astar(
94 const COSTTYPE * costmap,
int nx,
int ny,
95 int * goal,
int * start,
96 float * plan,
int nplan);
111 NavFn(
int nx,
int ny);
130 void setCostmap(
const COSTTYPE * cmap,
bool isROS =
true,
bool allow_unknown =
true);
258 int calcPath(
int n,
int * st = NULL);
Navigation function class. Holds buffers for costmap, navfn map. Maps are pixel-based....
int getPathLen()
Accessor for the length of a path.
bool propNavFnDijkstra(int cycles, bool atStart=false)
Run propagation for <cycles> iterations, or until start is reached using breadth-first Dijkstra metho...
float * getPathX()
Accessor for the x-coordinates of a path.
float gradCell(int n)
Calculate gradient at a cell.
void updateCell(int n)
Updates the cell at index n.
int calcPath(int n, int *st=NULL)
Calculates the path for at mose <n> cycles.
float getLastPathCost()
Gets the cost of the path found the last time a navigation function was computed.
bool calcNavFnDijkstra(bool atStart=false)
Caclulates the full navigation function using Dijkstra.
void updateCellAstar(int n)
Updates the cell at index n using the A* heuristic.
void initCost(int k, float v)
Initialize cell k with cost v for propagation.
void setNavArr(int nx, int ny)
Sets or resets the size of the map.
NavFn(int nx, int ny)
Constructs the planner.
void setCostmap(const COSTTYPE *cmap, bool isROS=true, bool allow_unknown=true)
Set up the cost array for the planner, usually from ROS.
void setupNavFn(bool keepit=false)
Set up navigation potential arrays for new propagation.
bool propNavFnAstar(int cycles)
Run propagation for <cycles> iterations, or until start is reached using the best-first A* method wit...
bool calcNavFnAstar()
Calculates a plan using the A* heuristic, returns true if one is found.
void setGoal(int *goal)
Sets the goal position for the planner. Note: the navigation cost field computed gives the cost to ge...
float * getPathY()
Accessor for the y-coordinates of a path.
void setStart(int *start)
Sets the start position for the planner. Note: the navigation cost field computed gives the cost to g...