Skip to content

Commit

Permalink
feat(behavior_path_planner): remove SUCCESS module candidate path (au…
Browse files Browse the repository at this point in the history
…towarefoundation#3929)

Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Jun 19, 2023
1 parent f653f72 commit fa87795
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions planning/behavior_path_planner/src/behavior_path_planner_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,9 +1405,16 @@ void BehaviorPathPlannerNode::publishPathCandidate(
}

for (auto & module : manager->getSceneModules()) {
path_candidate_publishers_.at(module->name())
->publish(
convertToPath(module->getPathCandidate(), module->isExecutionReady(), planner_data));
const auto & status = module->getCurrentStatus();
const auto candidate_path = std::invoke([&]() {
if (status == ModuleStatus::SUCCESS || status == ModuleStatus::FAILURE) {
// clear candidate path if the module is finished
return convertToPath(nullptr, false, planner_data);
}
return convertToPath(module->getPathCandidate(), module->isExecutionReady(), planner_data);
});

path_candidate_publishers_.at(module->name())->publish(candidate_path);
}
}
}
Expand Down

0 comments on commit fa87795

Please sign in to comment.