From cd74555cfb307eb437808f0ba27bc8b449415287 Mon Sep 17 00:00:00 2001 From: Mike Wake Date: Wed, 28 Aug 2024 18:02:46 +1000 Subject: [PATCH] fix NavigateToPose onLoop current_path blackboard existance logic (#4341) Make it consistent with NavigateThroughPoses. This was introduced when changing logic to remove internal exception. Signed-off-by: Mike Wake --- nav2_bt_navigator/src/navigators/navigate_to_pose.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nav2_bt_navigator/src/navigators/navigate_to_pose.cpp b/nav2_bt_navigator/src/navigators/navigate_to_pose.cpp index a7e58ab24b3..cf566893026 100644 --- a/nav2_bt_navigator/src/navigators/navigate_to_pose.cpp +++ b/nav2_bt_navigator/src/navigators/navigate_to_pose.cpp @@ -143,8 +143,8 @@ NavigateToPoseNavigator::onLoop() // Get current path points nav_msgs::msg::Path current_path; - [[maybe_unused]] auto res = blackboard->get(path_blackboard_id_, current_path); - if (current_path.poses.size() > 0u) { + auto res = blackboard->get(path_blackboard_id_, current_path); + if (res && current_path.poses.size() > 0u) { // Find the closest pose to current pose on global path auto find_closest_pose_idx = [¤t_pose, ¤t_path]() {