mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-14 22:57:55 -05:00
add error handling code
This commit is contained in:
@@ -311,7 +311,11 @@ class BITStar(object):
|
||||
currId = self.goalId
|
||||
while (currId != self.startId):
|
||||
plan.append(self.tree.nodeIdToRealWorldCoord(currId))
|
||||
currId = self.nodes[currId]
|
||||
try:
|
||||
currId = self.nodes[currId]
|
||||
except(KeyError):
|
||||
print("Path key error")
|
||||
return []
|
||||
|
||||
plan.append(self.start)
|
||||
plan = plan[::-1] # reverse the plan
|
||||
|
||||
Reference in New Issue
Block a user