Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(planning_test_manager): abstract message-specific functions #9882

Conversation

mitukou1109
Copy link
Contributor

@mitukou1109 mitukou1109 commented Jan 9, 2025

Description

This PR abstracts message-specific functions provided by autoware::planning_test_manager::PlanningInterfaceTestManager by using templates.
In addition, the node interface test in each package of the planning component is revised to adapt to the new test manager.

Correspondence of functions
Old New
publishOdometry(target_node, topic_name, shift) publishInput(target_node, topic_name, autoware::test_utils::makeOdometry(shift))
publishInitialPose(target_node, topic_name, shift) publishInput(target_node, topic_name, autoware::test_utils::makeInitialPose(shift))
publishMaxVelocity(target_node, topic_name) publishInput(target_node, topic_name, tier4_planning_msgs::msg::VelocityLimit{})
publishPointCloud(target_node, topic_name) publishInput(target_node, topic_name, sensor_msgs::msg::PointCloud2{}.set__header(std_msgs::msg::Header{}.set__frame_id("base_link")))
publishAcceleration(target_node, topic_name) publishInput(target_node, topic_name, geometry_msgs::msg::AccelWithCovarianceStamped{})
publishPredictedObjects(target_node, topic_name) publishInput(target_node, topic_name, autoware_perception_msgs::msg::PredictedObjects{})
publishExpandStopRange(target_node, topic_name) publishInput(target_node, topic_name, tier4_planning_msgs::msg::ExpandStopRange{})
publishOccupancyGrid(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeCostMapMsg())
publishCostMap(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeCostMapMsg())
publishMap(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeMapBinMsg())
publishLaneDrivingScenario(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeScenarioMsg(tier4_planning_msgs::msg::Scenario::LANEDRIVING))
publishParkingScenario(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeScenarioMsg(tier4_planning_msgs::msg::Scenario::PARKING))
publishParkingState(target_node, topic_name) publishInput(target_node, topic_name, std_msgs::msg::Bool{})
publishTrajectory(target_node, topic_name) publishInput(target_node, topic_name, autoware_planning_msgs::msg::Trajectory{})
publishRoute(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeNormalRoute())
publishTF(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeTFMsg(target_node, "base_link", "map"))
publishInitialPoseTF(target_node, topic_name) publishInput(target_node, topic_name, autoware::test_utils::makeTFMsg(target_node, "odom", "base_link"))
publishLateralOffset(target_node, topic_name) publishInput(target_node, topic_name, tier4_planning_msgs::msg::LateralOffset{})
publishOperationModeState(target_node, topic_name) publishInput(target_node, topic_name, autoware_adapi_v1_msgs::msg::OperationModeState{})
publishTrafficSignals(target_node, topic_name) publishInput(target_node, topic_name, autoware_perception_msgs::msg::TrafficLightGroupArray{})
publishVirtualTrafficLightState(target_node, topic_name) publishInput(target_node, topic_name, tier4_v2x_msgs::msg::VirtualTrafficLightStateArray{})
set***TopicName(topic_name) (unnecessary)
setTrajectorySubscriber(topic_name) subscribeOutput<autoware_planning_msgs::msg::Trajectory>(topic_name)
setScenarioSubscriber(topic_name) subscribeOutput<tier4_planning_msgs::msg::Scenario>(topic_name)
setPathWithLaneIdSubscriber(topic_name) subscribeOutput<tier4_planning_msgs::msg::PathWithLaneId>(topic_name)
setRouteSubscriber(topic_name) subscribeOutput<autoware_planning_msgs::msg::LaneletRoute>(topic_name)
setPathSubscriber(topic_name) subscribeOutput<autoware_planning_msgs::msg::Path>(topic_name)
testWithNominalTrajectory(target_node) testWithNormalTrajectory(target_node, topic_name)
testWithAbnormalTrajectory(target_node) testWithAbnormalTrajectory(target_node, topic_name)
testWithNominalRoute(target_node) testWithNormalRoute(target_node, topic_name)
testWithAbnormalRoute(target_node) testWithAbnormalRoute(target_node, topic_name)
testWithBehaviorNominalRoute(target_node) testWithBehaviorNormalRoute(target_node, topic_name)
testWithNominalPathWithLaneId(target_node) testWithNormalPathWithLaneId(target_node, topic_name)
testWithAbnormalPathWithLaneId(target_node) testWithAbnormalPathWithLaneId(target_node, topic_name)
testWithNominalPath(target_node) testWithNormalPath(target_node, topic_name)
testWithAbnormalPath(target_node) testWithAbnormalPath(target_node, topic_name)
testRouteWithInvalidEgoPose(target_node) testWithBehaviorNormalRoute(target_node, topic_name); testWithOffTrackInitialPoses(target_node, topic_name)
testPathWithInvalidEgoPose(target_node) testWithNormalPath(target_node, topic_name); testWithOffTrackInitialPoses(target_node, topic_name)
testPathWithLaneIdWithInvalidEgoPose(target_node) testWithNormalPathWithLaneId(target_node, topic_name); testWithOffTrackOdometries(target_node, topic_name)
testTrajectoryWithInvalidEgoPose(target_node) testWithNormalTrajectory(target_node, topic_name); testWithOffTrackOdometries(target_node, topic_name)

How was this PR tested?

The node interface tests in every package of the planning component were performed, and all of them passed.

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@mitukou1109 mitukou1109 force-pushed the feat/abstract-planning-interface-test-manager branch from 85c9f2d to 886d85f Compare January 17, 2025 02:09
@mitukou1109 mitukou1109 force-pushed the feat/abstract-planning-interface-test-manager branch from 03a6653 to 49bcfb2 Compare January 27, 2025 04:09
Signed-off-by: mitukou1109 <[email protected]>
Signed-off-by: mitukou1109 <[email protected]>
Signed-off-by: mitukou1109 <[email protected]>
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 93.50649% with 5 lines in your changes missing coverage. Please review.

Project coverage is 30.03%. Comparing base (4c13bb0) to head (e0fbe51).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...est_manager/src/autoware_planning_test_manager.cpp 82.75% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9882      +/-   ##
==========================================
+ Coverage   29.84%   30.03%   +0.19%     
==========================================
  Files        1434      526     -908     
  Lines      108037    47452   -60585     
  Branches    42951    21137   -21814     
==========================================
- Hits        32246    14254   -17992     
+ Misses      72662    31596   -41066     
+ Partials     3129     1602    -1527     
Flag Coverage Δ
differential 30.03% <93.50%> (?)
total ?

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Takayuki Murooka <[email protected]>
@takayuki5168 takayuki5168 merged commit 17927bf into autowarefoundation:main Jan 30, 2025
33 of 34 checks passed
yhisaki pushed a commit to tier4/autoware.universe that referenced this pull request Feb 6, 2025
…owarefoundation#9882)

* abstract message-specific functions

Signed-off-by: mitukou1109 <[email protected]>

* include necessary header

Signed-off-by: mitukou1109 <[email protected]>

* adapt velocity_smoother to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt path_optimizer to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* fix output subscription

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt scenario_selector to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt freespace_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt planning_validator to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt obstacle_stop_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt obstacle_cruise_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* disable test for freespace_planner

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_crosswalk_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_lane_change_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_avoidance_by_lane_change_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_dynamic_obstacle_avoidance_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_external_request_lane_change_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_side_shift_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_static_obstacle_avoidance_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt path_smoother to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_blind_spot_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_detection_area_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_intersection_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_no_stopping_area_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_run_out_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_stop_line_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_traffic_light_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_virtual_traffic_light_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_walkway_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt motion_velocity_planner_node_universe to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* include necessary headers

Signed-off-by: mitukou1109 <[email protected]>

* Odometries -> Odometry

Signed-off-by: Takayuki Murooka <[email protected]>

---------

Signed-off-by: mitukou1109 <[email protected]>
Signed-off-by: Takayuki Murooka <[email protected]>
Co-authored-by: Takayuki Murooka <[email protected]>
SakodaShintaro pushed a commit to tier4/autoware.universe that referenced this pull request Feb 7, 2025
…owarefoundation#9882)

* abstract message-specific functions

Signed-off-by: mitukou1109 <[email protected]>

* include necessary header

Signed-off-by: mitukou1109 <[email protected]>

* adapt velocity_smoother to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt path_optimizer to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* fix output subscription

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt scenario_selector to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt freespace_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt planning_validator to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt obstacle_stop_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt obstacle_cruise_planner to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* disable test for freespace_planner

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_crosswalk_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_lane_change_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_avoidance_by_lane_change_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_dynamic_obstacle_avoidance_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_external_request_lane_change_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_side_shift_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_path_static_obstacle_avoidance_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt path_smoother to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_blind_spot_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_detection_area_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_intersection_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_no_stopping_area_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_run_out_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_stop_line_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_traffic_light_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_virtual_traffic_light_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt behavior_velocity_walkway_module to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* adapt motion_velocity_planner_node_universe to new test manager

Signed-off-by: mitukou1109 <[email protected]>

* include necessary headers

Signed-off-by: mitukou1109 <[email protected]>

* Odometries -> Odometry

Signed-off-by: Takayuki Murooka <[email protected]>

---------

Signed-off-by: mitukou1109 <[email protected]>
Signed-off-by: Takayuki Murooka <[email protected]>
Co-authored-by: Takayuki Murooka <[email protected]>
SakodaShintaro added a commit to tier4/autoware.universe that referenced this pull request Feb 7, 2025
feat(planning_test_manager): abstract message-specific functions (autowarefoundation#9882)
@mitukou1109 mitukou1109 deleted the feat/abstract-planning-interface-test-manager branch February 7, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants