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

fix(planner_manager): remove succeeded candidate module #3346

Merged
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
9 changes: 7 additions & 2 deletions planning/behavior_path_planner/src/planner_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,22 @@ std::pair<SceneModulePtr, BehaviorModuleOutput> PlannerManager::runCandidateModu
processing_time_.at(name) += stop_watch_.toc(name, true);
}

const auto remove_failure_modules = [this](auto & m) {
const auto remove_expired_modules = [this](auto & m) {
if (m->getCurrentStatus() == ModuleStatus::FAILURE) {
deleteExpiredModules(m);
return true;
}

if (m->getCurrentStatus() == ModuleStatus::SUCCESS) {
deleteExpiredModules(m);
return true;
}

return false;
};

executable_modules.erase(
std::remove_if(executable_modules.begin(), executable_modules.end(), remove_failure_modules),
std::remove_if(executable_modules.begin(), executable_modules.end(), remove_expired_modules),
executable_modules.end());

if (executable_modules.empty()) {
Expand Down