Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immeidately mark dependencies as deprecated when the target plan was cleared #115

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rmf_traffic/src/rmf_traffic/schedule/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,14 @@ auto Database::watch_dependency(

if (state.latest_plan_id == dep.on_plan)
{
if (state.storage.empty())
{
// This plan has already been cleared from the schedule, so any
// dependencies on it are deprecated.
shared->deprecate();
return subscription;
}

if (dep.on_route < state.progress.reached_checkpoints.size())
{
const auto latest_checkpoint =
Expand Down
8 changes: 8 additions & 0 deletions rmf_traffic/src/rmf_traffic/schedule/Mirror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ auto Mirror::watch_dependency(

if (state.current_plan_id == dep.on_plan)
{
if (state.storage.empty())
{
// This plan has already been cleared from the schedule, so any
// dependencies on it are deprecated.
shared->deprecate();
return subscription;
}

if (dep.on_route < state.progress.reached_checkpoints.size())
{
const auto latest_checkpoint =
Expand Down