Skip to content

Commit ba2247c

Browse files
committed
add error handling code
1 parent a7eec63 commit ba2247c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,11 @@ def find_final_path(self):
311311
currId = self.goalId
312312
while (currId != self.startId):
313313
plan.append(self.tree.nodeIdToRealWorldCoord(currId))
314-
currId = self.nodes[currId]
314+
try:
315+
currId = self.nodes[currId]
316+
except(KeyError):
317+
print("Path key error")
318+
return []
315319

316320
plan.append(self.start)
317321
plan = plan[::-1] # reverse the plan

0 commit comments

Comments
 (0)