From 0099f4da1181d22ecf6c25260a42e5c766faecba Mon Sep 17 00:00:00 2001 From: Joshua Wallace Date: Mon, 7 Feb 2022 17:13:39 -0500 Subject: [PATCH] added planner_id --- .../nav2_simple_commander/robot_navigator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nav2_simple_commander/nav2_simple_commander/robot_navigator.py b/nav2_simple_commander/nav2_simple_commander/robot_navigator.py index 80c21cfb58..16cc46204f 100644 --- a/nav2_simple_commander/nav2_simple_commander/robot_navigator.py +++ b/nav2_simple_commander/nav2_simple_commander/robot_navigator.py @@ -204,7 +204,7 @@ def waitUntilNav2Active(self): self.info('Nav2 is ready for use!') return - def getPath(self, start, goal): + def getPath(self, start, goal, planner_id=None): """Send a `ComputePathToPose` action request.""" self.debug("Waiting for 'ComputePathToPose' action server") while not self.compute_path_to_pose_client.wait_for_server(timeout_sec=1.0): @@ -213,6 +213,8 @@ def getPath(self, start, goal): goal_msg = ComputePathToPose.Goal() goal_msg.goal = goal goal_msg.start = start + if planner_id is not None: + goal_msg.planner_id = planner_id self.info('Getting path...') send_goal_future = self.compute_path_to_pose_client.send_goal_async(goal_msg)