Skip to content

Commit

Permalink
fix(planner_manager): remove succeeded candidate module (#3346)
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored Apr 11, 2023
1 parent 334e066 commit 86b773a
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 86b773a

Please sign in to comment.