From 4a442ff77a56c2d911e045facb3686b0e6b6cca3 Mon Sep 17 00:00:00 2001 From: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Date: Sat, 27 May 2023 00:06:09 +0900 Subject: [PATCH] fix(behavior_path_planner): return default value if no registered module exists (#3843) Signed-off-by: satoshi-ota --- .../scene_module/scene_module_manager_interface.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/planning/behavior_path_planner/include/behavior_path_planner/scene_module/scene_module_manager_interface.hpp b/planning/behavior_path_planner/include/behavior_path_planner/scene_module/scene_module_manager_interface.hpp index 6ea84a701191f..601150bed52d5 100644 --- a/planning/behavior_path_planner/include/behavior_path_planner/scene_module/scene_module_manager_interface.hpp +++ b/planning/behavior_path_planner/include/behavior_path_planner/scene_module/scene_module_manager_interface.hpp @@ -205,6 +205,10 @@ class SceneModuleManagerInterface bool isSimultaneousExecutableAsApprovedModule() const { + if (registered_modules_.empty()) { + return enable_simultaneous_execution_as_approved_module_; + } + return std::all_of( registered_modules_.begin(), registered_modules_.end(), [](const SceneModulePtr & module) { return module->isSimultaneousExecutableAsApprovedModule(); @@ -213,6 +217,10 @@ class SceneModuleManagerInterface bool isSimultaneousExecutableAsCandidateModule() const { + if (registered_modules_.empty()) { + return enable_simultaneous_execution_as_candidate_module_; + } + return std::all_of( registered_modules_.begin(), registered_modules_.end(), [](const SceneModulePtr & module) { return module->isSimultaneousExecutableAsCandidateModule();