diff --git a/planning/autoware_planning_test_manager/CHANGELOG.rst b/planning/autoware_planning_test_manager/CHANGELOG.rst deleted file mode 100644 index 2ac0d456364e7..0000000000000 --- a/planning/autoware_planning_test_manager/CHANGELOG.rst +++ /dev/null @@ -1,145 +0,0 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package autoware_planning_test_manager -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -0.41.0 (2025-01-29) -------------------- -* Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base -* feat(autoware_component_interface_specs_universe!): rename package (`#9753 `_) -* feat(autoware_planning_test_manager): remove dependency of tier4_planning_msgs::msg::LateralOffset (`#9967 `_) - * feat(autoware_planning_test_manager): remove dependency of tier4_planning_msgs::msg::LateralOffset - * fix - --------- -* feat(autoware_planning_test_manager): remove dependency of VirtualTrafficLightState and ExpandStopRange (`#9953 `_) - * feat(autoware_planning_test_manager): remove dependency of virtual traffic light - * modify obstacle_stop test code - --------- -* test(autoware_behavior_path_start_planner_module): add unit tests for shift shift pull out planner (`#9776 `_) - feat(behavior_path_planner): add unit tests for ShiftPullOut path planning -* refactor(autoware_test_utils): enhance makeMapBinMsg to accept package name and map filename parameters (`#9617 `_) - * feat: enhance makeMapBinMsg to accept package name and map filename parameters - * feat: set default package name to 'autoware_test_utils' in makeMapBinMsg and related functions - --------- -* Contributors: Fumiya Watanabe, Kyoichi Sugahara, Ryohsuke Mitsudome, Takayuki Murooka - -0.40.0 (2024-12-12) -------------------- -* Merge branch 'main' into release-0.40.0 -* Revert "chore(package.xml): bump version to 0.39.0 (`#9587 `_)" - This reverts commit c9f0f2688c57b0f657f5c1f28f036a970682e7f5. -* chore(planning_test_manager): update owner (`#9620 `_) -* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) -* chore(package.xml): bump version to 0.39.0 (`#9587 `_) - * chore(package.xml): bump version to 0.39.0 - * fix: fix ticket links in CHANGELOG.rst - * fix: remove unnecessary diff - --------- - Co-authored-by: Yutaka Kondo -* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) -* fix(cpplint): include what you use - planning (`#9570 `_) -* refactor(test_utils): return parser as optional (`#9391 `_) - Co-authored-by: Mamoru Sobue -* 0.39.0 -* update changelog -* Merge commit '6a1ddbd08bd' into release-0.39.0 -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) - * unify package.xml version to 0.37.0 - * remove system_monitor/CHANGELOG.rst - * add changelog - * 0.38.0 - --------- -* refactor(component_interface_utils): prefix package and namespace with autoware (`#9092 `_) -* Contributors: Esteve Fernandez, Fumiya Watanabe, M. Fatih Cırıt, Mamoru Sobue, Ryohsuke Mitsudome, Yutaka Kondo, Zulfaqar Azmi - -0.39.0 (2024-11-25) -------------------- -* Merge commit '6a1ddbd08bd' into release-0.39.0 -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) - * unify package.xml version to 0.37.0 - * remove system_monitor/CHANGELOG.rst - * add changelog - * 0.38.0 - --------- -* refactor(component_interface_utils): prefix package and namespace with autoware (`#9092 `_) -* Contributors: Esteve Fernandez, Yutaka Kondo - -0.38.0 (2024-11-08) -------------------- -* unify package.xml version to 0.37.0 -* refactor(autoware_test_utils): sanitizer header (`#9174 `_) -* refactor(component_interface_specs): prefix package and namespace with autoware (`#9094 `_) -* feat: add `autoware\_` prefix to `lanelet2_extension` (`#7640 `_) -* refactor(universe_utils/motion_utils)!: add autoware namespace (`#7594 `_) -* refactor(motion_utils)!: add autoware prefix and include dir (`#7539 `_) - refactor(motion_utils): add autoware prefix and include dir -* feat(autoware_universe_utils)!: rename from tier4_autoware_utils (`#7538 `_) - Co-authored-by: kosuke55 -* refactor(route_handler)!: rename to include/autoware/{package_name} (`#7530 `_) - refactor(route_handler)!: rename to include/autoware/{package_name} -* refactor(test_utils): move to common folder (`#7158 `_) - * Move autoware planning test manager to autoware namespace - * fix package share directory for behavior path planner - * renaming files and directory - * rename variables that has planning_test_utils in its name. - * use autoware namespace for test utils - * move folder to common - * update .pages file - * fix test error - * removed obstacle velocity limiter test artifact - * remove namespace from planning validator, it has using keyword - --------- -* refactor(route_handler): route handler add autoware prefix (`#7341 `_) - * rename route handler package - * update packages dependencies - * update include guards - * update includes - * put in autoware namespace - * fix formats - * keep header and source file name as before - --------- -* refactor(planning_validator)!: prefix package and namespace with autoware (`#7320 `_) - * add autoware\_ prefix to planning_validator - * add prefix to package name in .pages - * fix link of the image - --------- -* feat!: replace autoware_auto_msgs with autoware_msgs for planning modules (`#7246 `_) - Co-authored-by: Cynthia Liu - Co-authored-by: NorahXiong - Co-authored-by: beginningfan -* chore(autoware_velocity_smoother, autoware_path_optimizer): rename packages (`#7202 `_) - * chore(autoware_path_optimizer): rename package and namespace - * chore(autoware_static_centerline_generator): rename package and namespace - * chore: update module name - * chore(autoware_velocity_smoother): rename package and namespace - * chore(tier4_planning_launch): update module name - * chore: update module name - * fix: test - * fix: test - * fix: test - --------- -* docs(planning_test_utils): update purpose of the package and add lanelet map images (`#7077 `_) - * docs(planning_test_utils): Add explanation - * remove autoware prefix from autoware planning test manager - * fix document - * remove implemented test part - --------- -* refactor(planning_test_utils): remove route_handler dependencies (`#7005 `_) - * refactor(planning_test_utils): remove route_handler dependencies - * style(pre-commit): autofix - * Fix precommit - --------- - Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> -* refactor(autoware_planning_test_manager): rename package (`#6995 `_) - * refactor(autoware_planning_test_manager): rename package - * rename file - * Add maintainer for planning test utils - * Add route handler back into package.xml - --------- -* Contributors: Esteve Fernandez, Kosuke Takeuchi, Kyoichi Sugahara, Mamoru Sobue, Ryohsuke Mitsudome, Satoshi OTA, Takayuki Murooka, Yutaka Kondo, Zulfaqar Azmi, mkquda - -0.26.0 (2024-04-03) -------------------- diff --git a/planning/autoware_planning_test_manager/CMakeLists.txt b/planning/autoware_planning_test_manager/CMakeLists.txt deleted file mode 100644 index 1f0a62aae0026..0000000000000 --- a/planning/autoware_planning_test_manager/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(autoware_planning_test_manager) - -find_package(autoware_cmake REQUIRED) -autoware_package() - -ament_auto_add_library(autoware_planning_test_manager SHARED - src/autoware_planning_test_manager.cpp -) - -ament_auto_package() diff --git a/planning/autoware_planning_test_manager/README.md b/planning/autoware_planning_test_manager/README.md deleted file mode 100644 index f4289d0d291a5..0000000000000 --- a/planning/autoware_planning_test_manager/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Autoware Planning Test Manager - -## Background - -In each node of the planning module, when exceptional input, such as unusual routes or significantly deviated ego-position, is given, the node may not be prepared for such input and could crash. As a result, debugging node crashes can be time-consuming. For example, if an empty trajectory is given as input and it was not anticipated during implementation, the node might crash due to the unaddressed exceptional input when changes are merged, during scenario testing or while the system is running on an actual vehicle. - -## Purpose - -The purpose is to provide a utility for implementing tests to ensure that node operates correctly when receiving exceptional input. By utilizing this utility and implementing tests for exceptional input, the purpose is to reduce bugs that are only discovered when actually running the system, by requiring measures for exceptional input before merging PRs. - -## Features - -### Confirmation of normal operation - -For the test target node, confirm that the node operates correctly and publishes the required messages for subsequent nodes. To do this, test_node publish the necessary messages and confirm that the node's output is being published. - -### Robustness confirmation for special inputs - -After confirming normal operation, ensure that the test target node does not crash when given exceptional input. To do this, provide exceptional input from the test_node and confirm that the node does not crash. - -(WIP) - -## Usage - -```cpp - -TEST(PlanningModuleInterfaceTest, NodeTestWithExceptionTrajectory) -{ - rclcpp::init(0, nullptr); - - // instantiate test_manager with PlanningInterfaceTestManager type - auto test_manager = std::make_shared(); - - // get package directories for necessary configuration files - const auto autoware_test_utils_dir = - ament_index_cpp::get_package_share_directory("autoware_test_utils"); - const auto target_node_dir = - ament_index_cpp::get_package_share_directory("target_node"); - - // set arguments to get the config file - node_options.arguments( - {"--ros-args", "--params-file", - autoware_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", - autoware_planning_validator_dir + "/config/planning_validator.param.yaml"}); - - // instantiate the TargetNode with node_options - auto test_target_node = std::make_shared(node_options); - - // publish the necessary topics from test_manager second argument is topic name - test_manager->publishOdometry(test_target_node, "/localization/kinematic_state"); - test_manager->publishMaxVelocity( - test_target_node, "velocity_smoother/input/external_velocity_limit_mps"); - - // set scenario_selector's input topic name(this topic is changed to test node) - test_manager->setTrajectoryInputTopicName("input/parking/trajectory"); - - // test with normal trajectory - ASSERT_NO_THROW(test_manager->testWithNominalTrajectory(test_target_node)); - - // make sure target_node is running - EXPECT_GE(test_manager->getReceivedTopicNum(), 1); - - // test with trajectory input with empty/one point/overlapping point - ASSERT_NO_THROW(test_manager->testWithAbnormalTrajectory(test_target_node)); - - // shutdown ROS context - rclcpp::shutdown(); -} -``` - -## Implemented tests - -| Node | Test name | exceptional input | output | Exceptional input pattern | -| --------------------------- | ----------------------------------------------------------------------------------------- | ----------------- | -------------- | ------------------------------------------------------------------------------------- | -| autoware_planning_validator | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | -| velocity_smoother | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | -| obstacle_cruise_planner | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | -| obstacle_stop_planner | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | -| obstacle_velocity_limiter | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | -| path_optimizer | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | -| scenario_selector | NodeTestWithExceptionTrajectoryLaneDrivingMode NodeTestWithExceptionTrajectoryParkingMode | trajectory | scenario | Empty, single point, path with duplicate points for scenarios:LANEDRIVING and PARKING | -| freespace_planner | NodeTestWithExceptionRoute | route | trajectory | Empty route | -| behavior_path_planner | NodeTestWithExceptionRoute NodeTestWithOffTrackEgoPose | route | route odometry | Empty route Off-lane ego-position | -| behavior_velocity_planner | NodeTestWithExceptionPathWithLaneID | path_with_lane_id | path | Empty path | - -## Important Notes - -During test execution, when launching a node, parameters are loaded from the parameter file within each package. Therefore, when adding parameters, it is necessary to add the required parameters to the parameter file in the target node package. This is to prevent the node from being unable to launch if there are missing parameters when retrieving them from the parameter file during node launch. - -## Future extensions / Unimplemented parts - -(WIP) diff --git a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp b/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp deleted file mode 100644 index 127cb11d8e101..0000000000000 --- a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2023 TIER IV, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_HPP_ -#define AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_HPP_ - -// since ASSERT_NO_THROW in gtest masks the exception message, redefine it. -#define ASSERT_NO_THROW_WITH_ERROR_MSG(statement) \ - try { \ - statement; \ - SUCCEED(); \ - } catch (const std::exception & e) { \ - FAIL() << "Expected: " << #statement \ - << " doesn't throw an exception.\nActual: it throws. Error message: " << e.what() \ - << std::endl; \ - } catch (...) { \ - FAIL() << "Expected: " << #statement \ - << " doesn't throw an exception.\nActual: it throws. Error message is not available." \ - << std::endl; \ - } - -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include - -namespace autoware::planning_test_manager -{ -class PlanningInterfaceTestManager -{ -public: - PlanningInterfaceTestManager(); - - template - void publishInput( - const rclcpp::Node::SharedPtr target_node, const std::string & topic_name, const InputT & input, - const int repeat_count = 3) const - { - autoware::test_utils::publishToTargetNode( - test_node_, target_node, topic_name, {}, input, repeat_count); - } - - template - void subscribeOutput(const std::string & topic_name) - { - const auto qos = []() { - if constexpr (std::is_same_v) { - return rclcpp::QoS{1}; - } - return rclcpp::QoS{10}; - }(); - - test_output_subs_.push_back(test_node_->create_subscription( - topic_name, qos, [this](const typename OutputT::ConstSharedPtr) { received_topic_num_++; })); - } - - void testWithNormalTrajectory( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - void testWithAbnormalTrajectory( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void testWithNormalRoute(rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - void testWithAbnormalRoute(rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void testWithBehaviorNormalRoute( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void testWithNormalPathWithLaneId( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - void testWithAbnormalPathWithLaneId( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void testWithNormalPath(rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - void testWithAbnormalPath(rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void testWithOffTrackInitialPoses( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void testWithOffTrackOdometry( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name); - - void resetReceivedTopicNum() { received_topic_num_ = 0; } - - size_t getReceivedTopicNum() const { return received_topic_num_; } - - rclcpp::Node::SharedPtr getTestNode() const { return test_node_; } - -private: - // Subscriber - std::vector test_output_subs_; - - // Node - rclcpp::Node::SharedPtr test_node_; - - size_t received_topic_num_ = 0; -}; // class PlanningInterfaceTestManager - -} // namespace autoware::planning_test_manager - -#endif // AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_HPP_ diff --git a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp b/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp deleted file mode 100644 index 8a075594ebd3a..0000000000000 --- a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2024 TIER IV, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_ -#define AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -namespace autoware_planning_test_manager::utils -{ -using autoware::route_handler::RouteHandler; -using autoware_planning_msgs::msg::LaneletRoute; -using geometry_msgs::msg::Pose; -using nav_msgs::msg::Odometry; -using RouteSections = std::vector; - -inline Pose createPoseFromLaneID( - const lanelet::Id & lane_id, const std::string & package_name = "autoware_test_utils", - const std::string & map_filename = "lanelet2_map.osm") -{ - auto map_bin_msg = autoware::test_utils::makeMapBinMsg(package_name, map_filename); - // create route_handler - auto route_handler = std::make_shared(); - route_handler->setMap(map_bin_msg); - - // get middle idx of the lanelet - const auto lanelet = route_handler->getLaneletsFromId(lane_id); - const auto center_line = lanelet.centerline(); - const size_t middle_point_idx = std::floor(center_line.size() / 2.0); - - // get middle position of the lanelet - geometry_msgs::msg::Point middle_pos; - middle_pos.x = center_line[middle_point_idx].x(); - middle_pos.y = center_line[middle_point_idx].y(); - - // get next middle position of the lanelet - geometry_msgs::msg::Point next_middle_pos; - next_middle_pos.x = center_line[middle_point_idx + 1].x(); - next_middle_pos.y = center_line[middle_point_idx + 1].y(); - - // calculate middle pose - geometry_msgs::msg::Pose middle_pose; - middle_pose.position = middle_pos; - const double yaw = autoware::universe_utils::calcAzimuthAngle(middle_pos, next_middle_pos); - middle_pose.orientation = autoware::universe_utils::createQuaternionFromYaw(yaw); - - return middle_pose; -} - -// Function to create a route from given start and goal lanelet ids -// start pose and goal pose are set to the middle of the lanelet -inline LaneletRoute makeBehaviorRouteFromLaneId( - const int & start_lane_id, const int & goal_lane_id, - const std::string & package_name = "autoware_test_utils", - const std::string & map_filename = "lanelet2_map.osm") -{ - LaneletRoute route; - route.header.frame_id = "map"; - auto start_pose = createPoseFromLaneID(start_lane_id, package_name, map_filename); - auto goal_pose = createPoseFromLaneID(goal_lane_id, package_name, map_filename); - route.start_pose = start_pose; - route.goal_pose = goal_pose; - - auto map_bin_msg = autoware::test_utils::makeMapBinMsg(package_name, map_filename); - // create route_handler - auto route_handler = std::make_shared(); - route_handler->setMap(map_bin_msg); - - LaneletRoute route_msg; - RouteSections route_sections; - lanelet::ConstLanelets all_route_lanelets; - - // Plan the path between checkpoints (start and goal poses) - lanelet::ConstLanelets path_lanelets; - if (!route_handler->planPathLaneletsBetweenCheckpoints(start_pose, goal_pose, &path_lanelets)) { - return route_msg; - } - - // Add all path_lanelets to all_route_lanelets - for (const auto & lane : path_lanelets) { - all_route_lanelets.push_back(lane); - } - // create local route sections - route_handler->setRouteLanelets(path_lanelets); - const auto local_route_sections = route_handler->createMapSegments(path_lanelets); - route_sections = - autoware::test_utils::combineConsecutiveRouteSections(route_sections, local_route_sections); - for (const auto & route_section : route_sections) { - for (const auto & primitive : route_section.primitives) { - std::cerr << "primitive: " << primitive.id << std::endl; - } - std::cerr << "preferred_primitive id : " << route_section.preferred_primitive.id << std::endl; - } - route_handler->setRouteLanelets(all_route_lanelets); - route.segments = route_sections; - - route.allow_modification = false; - return route; -} - -inline Odometry makeInitialPoseFromLaneId(const lanelet::Id & lane_id) -{ - Odometry current_odometry; - current_odometry.pose.pose = createPoseFromLaneID(lane_id); - current_odometry.header.frame_id = "map"; - - return current_odometry; -} - -} // namespace autoware_planning_test_manager::utils -#endif // AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_ diff --git a/planning/autoware_planning_test_manager/package.xml b/planning/autoware_planning_test_manager/package.xml deleted file mode 100644 index af42894edf6d5..0000000000000 --- a/planning/autoware_planning_test_manager/package.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - autoware_planning_test_manager - 0.41.0 - ROS 2 node for testing interface of the nodes in planning module - Kyoichi Sugahara - Takamasa Horibe - Mamoru Sobue - Apache License 2.0 - - Kyoichi Sugahara - - ament_cmake_auto - autoware_cmake - - autoware_component_interface_specs_universe - autoware_component_interface_utils - autoware_control_msgs - autoware_lanelet2_extension - autoware_map_msgs - autoware_motion_utils - autoware_perception_msgs - autoware_planning_msgs - autoware_route_handler - autoware_test_utils - autoware_universe_utils - autoware_vehicle_msgs - lanelet2_io - nav_msgs - rclcpp - tf2_msgs - tf2_ros - tier4_planning_msgs - unique_identifier_msgs - yaml_cpp_vendor - - ament_cmake_ros - ament_lint_auto - autoware_lint_common - - - ament_cmake - - diff --git a/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp b/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp deleted file mode 100644 index f0e143fa0aea3..0000000000000 --- a/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2023 TIER IV, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "autoware_planning_test_manager/autoware_planning_test_manager.hpp" - -#include - -#include -#include -#include - -#include -#include -#include - -namespace autoware::planning_test_manager -{ -using autoware_internal_planning_msgs::msg::PathWithLaneId; -using autoware_planning_msgs::msg::LaneletRoute; -using autoware_planning_msgs::msg::Path; -using autoware_planning_msgs::msg::Trajectory; - -PlanningInterfaceTestManager::PlanningInterfaceTestManager() -{ - test_node_ = std::make_shared("planning_interface_test_node"); -} - -void PlanningInterfaceTestManager::testWithNormalTrajectory( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput( - target_node, topic_name, autoware::test_utils::generateTrajectory(10, 1.0), 5); -} - -void PlanningInterfaceTestManager::testWithAbnormalTrajectory( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput(target_node, topic_name, Trajectory{}, 5); - publishInput( - target_node, topic_name, autoware::test_utils::generateTrajectory(1, 0.0), 5); - publishInput( - target_node, topic_name, - autoware::test_utils::generateTrajectory(10, 0.0, 0.0, 0.0, 0.0, 1), 5); -} - -void PlanningInterfaceTestManager::testWithNormalRoute( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput(target_node, topic_name, autoware::test_utils::makeNormalRoute(), 5); -} - -void PlanningInterfaceTestManager::testWithAbnormalRoute( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput(target_node, topic_name, LaneletRoute{}, 5); -} - -void PlanningInterfaceTestManager::testWithBehaviorNormalRoute( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput(target_node, topic_name, autoware::test_utils::makeBehaviorNormalRoute(), 5); -} - -void PlanningInterfaceTestManager::testWithNormalPathWithLaneId( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - try { - const auto path = autoware::test_utils::loadPathWithLaneIdInYaml(); - publishInput(target_node, topic_name, path, 5); - } catch (const std::exception & e) { - std::cerr << e.what() << '\n'; - } -} - -void PlanningInterfaceTestManager::testWithAbnormalPathWithLaneId( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput(target_node, topic_name, PathWithLaneId{}, 5); -} - -void PlanningInterfaceTestManager::testWithNormalPath( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - try { - const auto path = autoware::test_utils::loadPathWithLaneIdInYaml(); - publishInput( - target_node, topic_name, autoware::motion_utils::convertToPath(path), 5); - } catch (const std::exception & e) { - std::cerr << e.what() << '\n'; - } -} - -void PlanningInterfaceTestManager::testWithAbnormalPath( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - publishInput(target_node, topic_name, Path{}, 5); -} - -void PlanningInterfaceTestManager::testWithOffTrackInitialPoses( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - for (const auto & deviation : {0.0, 1.0, 10.0, 100.0}) { - publishInput(target_node, topic_name, autoware::test_utils::makeInitialPose(deviation), 5); - } -} - -void PlanningInterfaceTestManager::testWithOffTrackOdometry( - rclcpp::Node::SharedPtr target_node, const std::string & topic_name) -{ - for (const auto & deviation : {0.0, 1.0, 10.0, 100.0}) { - publishInput(target_node, topic_name, autoware::test_utils::makeOdometry(deviation), 5); - } -} -} // namespace autoware::planning_test_manager