50 #define COST_UNKNOWN_ROS 255 // 255 is unknown cost 51 #define COST_OBS 254 // 254 for forbidden regions 52 #define COST_OBS_ROS 253 // ROS values of 253 are obstacles 64 #define COST_NEUTRAL 50 // Set this to "open space" value 65 #define COST_FACTOR 0.8 // Used for translating costs in NavFn::setCostmap() 71 #define COSTTYPE unsigned char // Whatever is used... 75 #define POT_HIGH 1.0e10 // unassigned cell potential 78 #define PRIORITYBUFSIZE 10000 98 float *plan,
int nplan);
114 NavFn(
int nx,
int ny);
250 int calcPath(
int n,
int *st = NULL);
261 void savemap(
const char *fname);
void updateCell(int n)
Updates the cell at index n.
void setupNavFn(bool keepit=false)
NavFn(int nx, int ny)
Constructs the planner.
float * getPathY()
Accessor for the y-coordinates of a path.
int create_nav_plan_astar(const COSTTYPE *costmap, int nx, int ny, int *goal, int *start, float *plan, int nplan)
void(* displayFn)(NavFn *nav)
void updateCellAstar(int n)
Updates the cell at index n using the A* heuristic.
void setStart(int *start)
Sets the start position for the planner. Note: the navigation cost field computed gives the cost to g...
void setCostmap(const COSTTYPE *cmap, bool isROS=true, bool allow_unknown=true)
Set up the cost array for the planner, usually from ROS.
bool calcNavFnDijkstra(bool atStart=false)
Caclulates the full navigation function using Dijkstra.
float getLastPathCost()
Gets the cost of the path found the last time a navigation function was computed. ...
void setGoal(int *goal)
Sets the goal position for the planner. Note: the navigation cost field computed gives the cost to ge...
Navigation function class. Holds buffers for costmap, navfn map. Maps are pixel-based. Origin is upper left, x is right, y is down.
int calcPath(int n, int *st=NULL)
Calculates the path for at mose <n> cycles.
void initCost(int k, float v)
Initialize cell k with cost v for propagation.
void savemap(const char *fname)
bool propNavFnDijkstra(int cycles, bool atStart=false)
Run propagation for <cycles> iterations, or until start is reached using breadth-first Dijkstra metho...
void display(void fn(NavFn *nav), int n=100)
int getPathLen()
Accessor for the length of a path.
void setNavArr(int nx, int ny)
Sets or resets the size of the map.
float * getPathX()
Accessor for the x-coordinates of a path.
bool calcNavFnAstar()
Calculates a plan using the A* heuristic, returns true if one is found.
bool propNavFnAstar(int cycles)
Run propagation for <cycles> iterations, or until start is reached using the best-first A* method wit...