From f931a616ce2f65ae2e22e4c0dd3abeb735a78df8 Mon Sep 17 00:00:00 2001 From: Edoardo Fusa <81247624+Scheggetta@users.noreply.github.com> Date: Wed, 10 May 2023 16:49:31 +0200 Subject: [PATCH] Fix IndexError problem It could happen that `idx` variable calculated in line 86 is out of range for `other_nodes` list when `self.goal_tree_turn` is set to False. --- sbp_env/planners/birrtPlanner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbp_env/planners/birrtPlanner.py b/sbp_env/planners/birrtPlanner.py index b036dbd..51956e6 100644 --- a/sbp_env/planners/birrtPlanner.py +++ b/sbp_env/planners/birrtPlanner.py @@ -80,7 +80,7 @@ def run_once(self): other_poses = self.poses other_nodes = self.nodes distances = np.linalg.norm( - other_poses[: len(self.nodes)] - newpos, axis=1 + other_poses[: len(other_nodes)] - newpos, axis=1 ) if min(distances) < self.args.epsilon: idx = np.argmin(distances)