Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 committed Jan 19, 2025
1 parent 8f6456c commit c033ba8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST(PlanningModuleInterfaceTest, NodeTestWithExceptionRoute)

auto test_manager = generateTestManager();
auto test_target_node = generateNode(
{"avoidance_by_lane_change"},
{"lane_change", "static_obstacle_avoidance", "avoidance_by_lane_change"},
{"autoware::behavior_path_planner::AvoidanceByLaneChangeModuleManager"});
publishMandatoryTopics(test_manager, test_target_node);

Expand All @@ -50,7 +50,7 @@ TEST(PlanningModuleInterfaceTest, NodeTestWithOffTrackEgoPose)

auto test_manager = generateTestManager();
auto test_target_node = generateNode(
{"avoidance_by_lane_change"},
{"lane_change", "static_obstacle_avoidance", "avoidance_by_lane_change"},
{"autoware::behavior_path_planner::AvoidanceByLaneChangeModuleManager"});
publishMandatoryTopics(test_manager, test_target_node);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ using autoware::planning_test_manager::PlanningInterfaceTestManager;
std::shared_ptr<PlanningInterfaceTestManager> generateTestManager();

std::shared_ptr<BehaviorPathPlannerNode> generateNode(
const std::vector<std::string> module_name_vec, std::vector<std::string> plugin_name_vec);
const std::vector<std::string> & module_name_vec,
const std::vector<std::string> & plugin_name_vec);

void publishMandatoryTopics(
std::shared_ptr<PlanningInterfaceTestManager> test_manager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,15 @@ std::shared_ptr<PlanningInterfaceTestManager> generateTestManager()
}

std::shared_ptr<BehaviorPathPlannerNode> generateNode(
const std::vector<std::string> module_name_vec, std::vector<std::string> plugin_name_vec)
const std::vector<std::string> & module_name_vec,
const std::vector<std::string> & plugin_name_vec)
{
auto node_options = rclcpp::NodeOptions{};
const auto autoware_test_utils_dir =
ament_index_cpp::get_package_share_directory("autoware_test_utils");
const auto behavior_path_planner_dir =
ament_index_cpp::get_package_share_directory("autoware_behavior_path_planner");

const auto get_behavior_path_module_config = [](const std::string & module) {
const auto package_name = "autoware_behavior_path_" + module + "_module";
const auto package_path = ament_index_cpp::get_package_share_directory(package_name);
return package_path + "/config/" + module + ".param.yaml";
};

std::vector<std::string> plugin_names;
for (const auto & plugin_name : plugin_name_vec) {
plugin_names.emplace_back(plugin_name);
Expand All @@ -63,6 +58,12 @@ std::shared_ptr<BehaviorPathPlannerNode> generateNode(
params.emplace_back("launch_modules", plugin_names);
node_options.parameter_overrides(params);

const auto get_behavior_path_module_config = [](const std::string & module) {
const auto package_name = "autoware_behavior_path_" + module + "_module";
const auto package_path = ament_index_cpp::get_package_share_directory(package_name);
return package_path + "/config/" + module + ".param.yaml";
};

auto yaml_files = std::vector<std::string>{
autoware_test_utils_dir + "/config/test_common.param.yaml",
autoware_test_utils_dir + "/config/test_nearest_search.param.yaml",
Expand Down

0 comments on commit c033ba8

Please sign in to comment.