File tree Expand file tree Collapse file tree
include/frontier_exploration_ros2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,8 +218,8 @@ class FrontierExplorerCore
218218 const FrontierLike & target_frontier,
219219 const geometry_msgs::msg::Pose & current_pose) const ;
220220
221- std::optional< geometry_msgs::msg::PoseStamped> build_dispatch_goal_pose (
222- const FrontierLike & target_frontier,
221+ geometry_msgs::msg::PoseStamped build_dispatch_goal_pose (
222+ const FrontierLike & target_frontier,
223223 const geometry_msgs::msg::Pose & current_pose,
224224 bool bypass_min_distance_dispatch = false ) const ;
225225
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ void FrontierExplorerCore::try_send_next_goal()
174174 frontier_sequence,
175175 *current_pose,
176176 " Sending frontier goal (" + selection.mode + " ): " + describe_frontier (frontier_sequence.front ()),
177- false );
177+ escape_mode_active );
178178}
179179
180180void FrontierExplorerCore::reset_exploration_runtime_state (bool clear_maps)
@@ -910,24 +910,19 @@ bool FrontierExplorerCore::send_frontier_goal(
910910 dispatch_sequence.push_back (frontier_sequence[index]);
911911 }
912912
913- const auto dispatch_goal_pose = build_dispatch_goal_pose (
914- dispatch_sequence.front (),
913+ const auto goal_pose = build_dispatch_goal_pose (
914+ dispatch_sequence.front (),
915915 current_pose,
916916 bypass_min_distance_dispatch);
917- if (!dispatch_goal_pose.has_value ()) {
918- callbacks.log_info (
919- " No dispatchable frontier goal satisfies the minimum-distance constraint; waiting for updated map data" );
920- return false ;
921- }
922917 if (debug_outputs_enabled ()) {
923- callbacks.publish_selected_frontier_pose (dispatch_goal_pose. value () );
918+ callbacks.publish_selected_frontier_pose (goal_pose );
924919 }
925920 const std::string dispatch_description = dispatch_index == 0U ?
926921 description :
927922 " Sending frontier goal after blocked-goal skip: " + describe_frontier (dispatch_sequence.front ());
928923 // Frontier mode dispatches only the first element from the selected sequence.
929924 return send_pose_goal (
930- dispatch_goal_pose. value () ,
925+ goal_pose ,
931926 " frontier" ,
932927 dispatch_sequence.front (),
933928 dispatch_sequence,
Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ geometry_msgs::msg::PoseStamped FrontierExplorerCore::build_goal_pose(
492492 return goal_pose;
493493}
494494
495- std::optional< geometry_msgs::msg::PoseStamped> FrontierExplorerCore::build_dispatch_goal_pose (
495+ geometry_msgs::msg::PoseStamped FrontierExplorerCore::build_dispatch_goal_pose (
496496 const FrontierLike & target_frontier,
497497 const geometry_msgs::msg::Pose & current_pose,
498498 bool bypass_min_distance_dispatch) const
@@ -606,7 +606,7 @@ std::optional<geometry_msgs::msg::PoseStamped> FrontierExplorerCore::build_dispa
606606 }
607607 }
608608
609- return std:: nullopt ;
609+ return fallback_goal_pose ;
610610}
611611
612612std::vector<geometry_msgs::msg::PoseStamped> FrontierExplorerCore::build_goal_pose_sequence (
You can’t perform that action at this time.
0 commit comments