Skip to content

Commit 859975a

Browse files
authored
feat(behavior_path_planner): add error handling for null output (#4352)
* feat: add curvature consideration in shift start Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com> * fix Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com> --------- Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
1 parent 68a702c commit 859975a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

planning/behavior_path_planner/include/behavior_path_planner/planner_manager.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ class PlannerManager
449449
const std::vector<SceneModulePtr> & request_modules, const std::shared_ptr<PlannerData> & data,
450450
const BehaviorModuleOutput & previous_module_output);
451451

452+
std::string getNames(const std::vector<SceneModulePtr> & modules) const;
453+
452454
boost::optional<lanelet::ConstLanelet> root_lanelet_{boost::none};
453455

454456
std::vector<SceneModuleManagerPtr> manager_ptrs_;

planning/behavior_path_planner/src/planner_manager.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ void PlannerManager::generateCombinedDrivableArea(
178178
std::vector<SceneModulePtr> PlannerManager::getRequestModules(
179179
const BehaviorModuleOutput & previous_module_output) const
180180
{
181+
if (!previous_module_output.path) {
182+
RCLCPP_ERROR_STREAM(
183+
logger_, "Current module output is null. Skip candidate module check."
184+
<< "\n - Approved module list: " << getNames(approved_module_ptrs_)
185+
<< "\n - Candidate module list: " << getNames(candidate_module_ptrs_));
186+
return {};
187+
}
188+
181189
std::vector<SceneModulePtr> request_modules{};
182190

183191
/**
@@ -742,4 +750,13 @@ std::shared_ptr<SceneModuleVisitor> PlannerManager::getDebugMsg()
742750
return debug_msg_ptr_;
743751
}
744752

753+
std::string PlannerManager::getNames(const std::vector<SceneModulePtr> & modules) const
754+
{
755+
std::stringstream ss;
756+
for (const auto & m : modules) {
757+
ss << "[" << m->name() << "], ";
758+
}
759+
return ss.str();
760+
}
761+
745762
} // namespace behavior_path_planner

0 commit comments

Comments
 (0)