Permalink
Browse files

Fixed path planning deadlock

  • Loading branch information...
crawford committed May 23, 2012
1 parent bbef2ec commit 3683cbb5d607999e51129bf85cc4be6cc0b45a6d
Showing with 5 additions and 1 deletion.
  1. +5 −1 PathPlanner.cpp
View
@@ -90,7 +90,6 @@ void PathPlanner::evaluatePathCost(double cost, PathPoint *point) {
}
}
-// NOTE: If there is no path to the destination, this will lock up
list<PathPoint *> PathPlanner::findRoute(double origX, double origY) {
list<PathPoint *> path;
@@ -111,6 +110,11 @@ list<PathPoint *> PathPlanner::findRoute(double origX, double origY) {
return path;
}
+ if (cur->getCost() == DBL_MAX) {
+ printf("No route to host^H^H^H^Hdestination\n");
+ return path;
+ }
+
path.push_back(cur);
// Find the shortest path to the destination

0 comments on commit 3683cbb

Please sign in to comment.