From 514c0d6c4ec07e85ebf2b4da7e6775bfbd5bf4a7 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Wed, 29 May 2024 10:55:00 +0200 Subject: [PATCH] fix: fix issue loading packages that have been prefixed Signed-off-by: Esteve Fernandez --- .../test/src/test_node_interface.cpp | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp b/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp index 77bf68f9964c9..26ac1b152f84d 100644 --- a/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp +++ b/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp @@ -54,12 +54,19 @@ std::shared_ptr generateNode() const auto motion_velocity_smoother_dir = ament_index_cpp::get_package_share_directory("motion_velocity_smoother"); - const auto get_behavior_velocity_module_config = [](const std::string & module) { + // TODO(esteve): delete when all the modules are migrated to autoware_behavior_velocity_* + const auto get_behavior_velocity_module_config_no_prefix = [](const std::string & module) { const auto package_name = "behavior_velocity_" + module + "_module"; const auto package_path = ament_index_cpp::get_package_share_directory(package_name); return package_path + "/config/" + module + ".param.yaml"; }; + const auto get_behavior_velocity_module_config = [](const std::string & module) { + const auto package_name = "autoware_behavior_velocity_" + module + "_module"; + const auto package_path = ament_index_cpp::get_package_share_directory(package_name); + return package_path + "/config/" + module + ".param.yaml"; + }; + std::vector module_names; module_names.emplace_back("behavior_velocity_planner::CrosswalkModulePlugin"); module_names.emplace_back("behavior_velocity_planner::WalkwayModulePlugin"); @@ -90,20 +97,20 @@ std::shared_ptr generateNode() motion_velocity_smoother_dir + "/config/default_motion_velocity_smoother.param.yaml", motion_velocity_smoother_dir + "/config/Analytical.param.yaml", behavior_velocity_planner_dir + "/config/behavior_velocity_planner.param.yaml", - get_behavior_velocity_module_config("blind_spot"), - get_behavior_velocity_module_config("crosswalk"), - get_behavior_velocity_module_config("walkway"), - get_behavior_velocity_module_config("detection_area"), - get_behavior_velocity_module_config("intersection"), - get_behavior_velocity_module_config("no_stopping_area"), - get_behavior_velocity_module_config("occlusion_spot"), + get_behavior_velocity_module_config_no_prefix("blind_spot"), + get_behavior_velocity_module_config_no_prefix("crosswalk"), + get_behavior_velocity_module_config_no_prefix("walkway"), + get_behavior_velocity_module_config_no_prefix("detection_area"), + get_behavior_velocity_module_config_no_prefix("intersection"), + get_behavior_velocity_module_config_no_prefix("no_stopping_area"), + get_behavior_velocity_module_config_no_prefix("occlusion_spot"), get_behavior_velocity_module_config("run_out"), - get_behavior_velocity_module_config("speed_bump"), - get_behavior_velocity_module_config("stop_line"), - get_behavior_velocity_module_config("traffic_light"), - get_behavior_velocity_module_config("virtual_traffic_light"), - get_behavior_velocity_module_config("out_of_lane"), - get_behavior_velocity_module_config("no_drivable_lane")}); + get_behavior_velocity_module_config_no_prefix("speed_bump"), + get_behavior_velocity_module_config_no_prefix("stop_line"), + get_behavior_velocity_module_config_no_prefix("traffic_light"), + get_behavior_velocity_module_config_no_prefix("virtual_traffic_light"), + get_behavior_velocity_module_config_no_prefix("out_of_lane"), + get_behavior_velocity_module_config_no_prefix("no_drivable_lane")}); // TODO(Takagi, Isamu): set launch_modules // TODO(Kyoichi Sugahara) set to true launch_virtual_traffic_light