-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(autoware_planning_test_manager): rename package (#6995)
* refactor(autoware_planning_test_manager): rename package Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * rename file Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * Add maintainer for planning test utils Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> * Add route handler back into package.xml Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> --------- Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp> Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
- Loading branch information
1 parent
d7c2288
commit 23d103f
Showing
37 changed files
with
206 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Planning Interface 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<planning_test_utils::PlanningInterfaceTestManager>(); | ||
|
||
// get package directories for necessary configuration files | ||
const auto planning_test_utils_dir = | ||
ament_index_cpp::get_package_share_directory("planning_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", | ||
planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", | ||
planning_validator_dir + "/config/planning_validator.param.yaml"}); | ||
|
||
// instantiate the TargetNode with node_options | ||
auto test_target_node = std::make_shared<TargetNode>(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, "motion_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 | | ||
| -------------------------- | ----------------------------------------------------------------------------------------- | ----------------- | -------------- | ------------------------------------------------------------------------------------- | | ||
| planning_validator | NodeTestWithExceptionTrajectory | trajectory | trajectory | Empty, single point, path with duplicate points | | ||
| motion_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 | | ||
| obstacle_avoidance_planner | 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>autoware_planning_test_manager</name> | ||
<version>0.1.0</version> | ||
<description>ROS 2 node for testing interface of the nodes in planning module</description> | ||
<maintainer email="kyoichi.sugahara@tier4.jp">Kyoichi Sugahara</maintainer> | ||
<maintainer email="takamasa.horibe@tier4.jp">Takamasa Horibe</maintainer> | ||
<license>Apache License 2.0</license> | ||
|
||
<author email="kyoichi.sugahara@tier4.jp">Kyoichi Sugahara</author> | ||
|
||
<buildtool_depend>ament_cmake_auto</buildtool_depend> | ||
<buildtool_depend>autoware_cmake</buildtool_depend> | ||
|
||
<depend>autoware_auto_control_msgs</depend> | ||
<depend>autoware_auto_mapping_msgs</depend> | ||
<depend>autoware_auto_planning_msgs</depend> | ||
<depend>autoware_auto_vehicle_msgs</depend> | ||
<depend>autoware_perception_msgs</depend> | ||
<depend>autoware_planning_msgs</depend> | ||
<depend>component_interface_specs</depend> | ||
<depend>component_interface_utils</depend> | ||
<depend>lanelet2_extension</depend> | ||
<depend>lanelet2_io</depend> | ||
<depend>motion_utils</depend> | ||
<depend>nav_msgs</depend> | ||
<depend>planning_test_utils</depend> | ||
<depend>rclcpp</depend> | ||
<depend>route_handler</depend> | ||
<depend>tf2_msgs</depend> | ||
<depend>tf2_ros</depend> | ||
<depend>tier4_api_msgs</depend> | ||
<depend>tier4_autoware_utils</depend> | ||
<depend>tier4_planning_msgs</depend> | ||
<depend>tier4_v2x_msgs</depend> | ||
<depend>unique_identifier_msgs</depend> | ||
<depend>yaml_cpp_vendor</depend> | ||
|
||
<test_depend>ament_cmake_ros</test_depend> | ||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>autoware_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.