From ba2247c1b0bc2c31cd6bad4293e88eb4764324e2 Mon Sep 17 00:00:00 2001 From: Atsushi Sakai Date: Sat, 16 Jun 2018 22:14:09 +0900 Subject: [PATCH] add error handling code --- PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py b/PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py index 4db22928..05bd254b 100644 --- a/PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py +++ b/PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py @@ -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