Skip to content

Commit

Permalink
Add reached API to read-only fleet adapter (#387)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiyu Oh <[email protected]>
  • Loading branch information
xiyuoh authored Nov 27, 2024
1 parent dd91566 commit 5404865
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rmf_fleet_adapter/src/read_only/FleetAdapterNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,16 @@ bool FleetAdapterNode::handle_delay(

entry.schedule->push_delay(time_difference);

const auto route_size = entry.route->trajectory().size();
const auto remaining_path_size = state.path.size();
if (route_size > remaining_path_size)
{
entry.schedule->participant().reached(
entry.schedule->participant().current_plan_id(),
0,
route_size - remaining_path_size - 1);
}

// Return true to indicate that the delay has been handled.
return true;
}
Expand Down

0 comments on commit 5404865

Please sign in to comment.