Skip to content

Commit a359532

Browse files
Fix zero waypoints crash (#1978)
* return if the number of waypoints is zero. * terminate the action. * Succeed action instead of terminating.
1 parent 26b975b commit a359532

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎nav2_waypoint_follower/src/waypoint_follower.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ WaypointFollower::followWaypoints()
127127
get_logger(), "Received follow waypoint request with %i waypoints.",
128128
static_cast<int>(goal->poses.size()));
129129

130+
if (goal->poses.size() == 0) {
131+
action_server_->succeeded_current(result);
132+
return;
133+
}
134+
130135
rclcpp::Rate r(loop_rate_);
131136
uint32_t goal_index = 0;
132137
bool new_goal = true;

0 commit comments

Comments
 (0)