Skip to content

Commit

Permalink
fix NavigateToPose onLoop current_path blackboard existance logic (#4341
Browse files Browse the repository at this point in the history
)

Make it consistent with NavigateThroughPoses.
This was introduced when changing logic to remove
internal exception.

Signed-off-by: Mike Wake <[email protected]>
  • Loading branch information
aosmw committed Aug 28, 2024
1 parent cbca721 commit cd74555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nav2_bt_navigator/src/navigators/navigate_to_pose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
[&current_pose, &current_path]() {
Expand Down

0 comments on commit cd74555

Please sign in to comment.