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(autoware_detected_object_validation): add height filter in lanelet filtering #10003

Merged
merged 7 commits into from
Jan 22, 2025

Conversation

YoshiRi
Copy link
Contributor

@YoshiRi YoshiRi commented Jan 22, 2025

Description

Add height filter in lanelet filter.
This filter is based on z axis comparison between ego base_link and not considering lanelet slope.
I think we should use lane information for future, but currently it will be helpful in some feature such as radar filter.

image

Related links

Parent Issue:

  • Link

How was this PR tested?

Add node test. You can test it with

colcon test --packages-select autoware_detected_object_validation --event-handlers console_direct
+ --return-code-on-test-failure

Test case is like following:

sorry I had typo:

  • filtered means the objects will be remained
  • remained means the objects will be filtered out
    image

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jan 22, 2025
Copy link

github-actions bot commented Jan 22, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

@YoshiRi YoshiRi added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jan 22, 2025
@YoshiRi YoshiRi changed the title feat(autoware_detected_validation): add height filter in lanelet filtering feat(autoware_detected_object_validation): add height filter in lanelet filtering Jan 22, 2025
Comment on lines +114 to 123
"max_height_threshold": {
"type": "number",
"default": 10.0,
"description": "Maximum height threshold for filtering objects (in meters)."
},
"min_height_threshold": {
"type": "number",
"default": -1.0,
"description": "Minimum height threshold for filtering objects (in meters)."
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YoshiRi
Please add description which frame_id is based for these parameters?
I think it should be map/lanelet_frame_id_ as there is a transformation to lanelet_frame_id_ at

autoware_perception_msgs::msg::DetectedObjects transformed_objects;
if (!autoware::object_recognition_utils::transformObjects(
*input_msg, lanelet_frame_id_, tf_buffer_, transformed_objects)) {
RCLCPP_ERROR(get_logger(), "Failed transform to %s.", lanelet_frame_id_.c_str());
return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed in the latest test.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 29.52%. Comparing base (a24a335) to head (7206f1d).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...t_validation/src/lanelet_filter/lanelet_filter.cpp 84.21% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10003      +/-   ##
==========================================
+ Coverage   29.41%   29.52%   +0.10%     
==========================================
  Files        1419     1419              
  Lines      107507   107535      +28     
  Branches    42545    42561      +16     
==========================================
+ Hits        31624    31749     +125     
+ Misses      72513    72401     -112     
- Partials     3370     3385      +15     
Flag Coverage Δ *Carryforward flag
differential 9.19% <84.21%> (?)
differential-cuda 9.19% <84.21%> (?)
total 29.41% <ø> (ø) Carriedforward from f94bdcf

*This pull request uses carry forward flags. Click here to find out more.

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

@YoshiRi YoshiRi marked this pull request as draft January 22, 2025 07:37
@YoshiRi YoshiRi marked this pull request as ready for review January 22, 2025 09:56
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Jan 22, 2025
@YoshiRi YoshiRi force-pushed the feat/enable_height_filter branch from 1936d8a to f94bdcf Compare January 22, 2025 10:17
@YoshiRi
Copy link
Contributor Author

YoshiRi commented Jan 22, 2025

Test run result:

2: Test command: /usr/bin/python3.10 "-u" "/home/yoshiri/autoware/install/ament_cmake_test/share/ament_cmake_test/cmake/run_test.py" "/home/yoshiri/autoware/build/autoware_detected_object_validation/test_results/autoware_detected_object_validation/object_lanelet_filter_tests.gtest.xml" "--package-name" "autoware_detected_object_validation" "--output-file" "/home/yoshiri/autoware/build/autoware_detected_object_validation/ament_cmake_gtest/object_lanelet_filter_tests.txt" "--command" "/home/yoshiri/autoware/build/autoware_detected_object_validation/object_lanelet_filter_tests" "--gtest_output=xml:/home/yoshiri/autoware/build/autoware_detected_object_validation/test_results/autoware_detected_object_validation/object_lanelet_filter_tests.gtest.xml"
2: Test timeout computed to be: 60
2: -- run_test.py: invoking following command in '/home/yoshiri/autoware/build/autoware_detected_object_validation':
2:  - /home/yoshiri/autoware/build/autoware_detected_object_validation/object_lanelet_filter_tests --gtest_output=xml:/home/yoshiri/autoware/build/autoware_detected_object_validation/test_results/autoware_detected_object_validation/object_lanelet_filter_tests.gtest.xml
2: Running main() from /opt/ros/humble/src/gtest_vendor/src/gtest_main.cc
2: [==========] Running 5 tests from 2 test suites.
2: [----------] Global test environment set-up.
2: [----------] 2 tests from IsTargetTest
2: [ RUN      ] IsTargetTest.AllTarget
2: [       OK ] IsTargetTest.AllTarget (0 ms)
2: [ RUN      ] IsTargetTest.VehicleTarget
2: [       OK ] IsTargetTest.VehicleTarget (0 ms)
2: [----------] 2 tests from IsTargetTest (0 ms total)
2: 
2: [----------] 3 tests from DetectedObjectValidationTest
2: [ RUN      ] DetectedObjectValidationTest.testObjectLaneletFilterWithMap
2: 1737541032.230064 [112] object_lan: determined wlp9s0 (udp/192.168.68.120) as highest quality interface, selected for automatic interface.
2: 1737541032.230079 [112] object_lan: selected interface "lo" is not multicast-capable: disabling multicast
2: [INFO 1737541032.543702409] [autoware_test_manager_node]: Published message on topic 'input/vector_map' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [INFO 1737541032.845868288] [autoware_test_manager_node]: Published message on topic 'input/object' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [       OK ] DetectedObjectValidationTest.testObjectLaneletFilterWithMap (625 ms)
2: [ RUN      ] DetectedObjectValidationTest.testObjectLaneletFilterEmptyObjects
2: 1737541032.864113 [112] object_lan: determined wlp9s0 (udp/192.168.68.120) as highest quality interface, selected for automatic interface.
2: 1737541032.864127 [112] object_lan: selected interface "lo" is not multicast-capable: disabling multicast
2: [INFO 1737541033.170140550] [autoware_test_manager_node]: Published message on topic 'input/vector_map' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [INFO 1737541033.471837259] [autoware_test_manager_node]: Published message on topic 'input/object' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [       OK ] DetectedObjectValidationTest.testObjectLaneletFilterEmptyObjects (638 ms)
2: [ RUN      ] DetectedObjectValidationTest.testObjectLaneletFilterHeightThreshold
2: 1737541033.494470 [112] object_lan: determined wlp9s0 (udp/192.168.68.120) as highest quality interface, selected for automatic interface.
2: 1737541033.494502 [112] object_lan: selected interface "lo" is not multicast-capable: disabling multicast
2: [INFO 1737541033.803453966] [autoware_test_manager_node]: Published message on topic 'input/vector_map' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [INFO 1737541034.104742896] [autoware_test_manager_node]: Published message on topic 'input/object' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [INFO 1737541034.407122978] [autoware_test_manager_node]: Published message on topic 'input/object' (test_pub_msg() at /home/yoshiri/autoware/install/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp:601)
2: [       OK ] DetectedObjectValidationTest.testObjectLaneletFilterHeightThreshold (926 ms)
2: [----------] 3 tests from DetectedObjectValidationTest (2189 ms total)
2: 
2: [----------] Global test environment tear-down
2: [==========] 5 tests from 2 test suites ran. (2189 ms total)
2: [  PASSED  ] 5 tests.
2: -- run_test.py: return code 0
2: -- run_test.py: inject classname prefix into gtest result file '/home/yoshiri/autoware/build/autoware_detected_object_validation/test_results/autoware_detected_object_validation/object_lanelet_filter_tests.gtest.xml'
2: -- run_test.py: verify result file '/home/yoshiri/autoware/build/autoware_detected_object_validation/test_results/autoware_detected_object_validation/object_lanelet_filter_tests.gtest.xml'
2/6 Test #2: object_lanelet_filter_tests .........   Passed    2.30 sec

Comment on lines 155 to 165
// vehicle base pose :map -> base_link
try {
ego_base_height_ = tf_buffer_
.lookupTransform(
lanelet_frame_id_, "base_link", transformed_objects.header.stamp,
rclcpp::Duration::from_seconds(0.5))
.transform.translation.z;
} catch (const tf2::TransformException & ex) {
RCLCPP_ERROR_STREAM(get_logger(), "Failed to get transform: " << ex.what());
return;
}
Copy link
Contributor

@badai-nguyen badai-nguyen Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YoshiRi
IMO, it is better to add condition of use_height_threshold here also

Suggested change
// vehicle base pose :map -> base_link
try {
ego_base_height_ = tf_buffer_
.lookupTransform(
lanelet_frame_id_, "base_link", transformed_objects.header.stamp,
rclcpp::Duration::from_seconds(0.5))
.transform.translation.z;
} catch (const tf2::TransformException & ex) {
RCLCPP_ERROR_STREAM(get_logger(), "Failed to get transform: " << ex.what());
return;
}
// vehicle base pose :map -> base_link
if (filter_settings_.use_height_threshold) {
try {
ego_base_height_ = tf_buffer_
.lookupTransform(
lanelet_frame_id_, "base_link", transformed_objects.header.stamp,
rclcpp::Duration::from_seconds(0.5))
.transform.translation.z;
} catch (const tf2::TransformException & ex) {
RCLCPP_ERROR_STREAM(get_logger(), "Failed to get transform: " << ex.what());
return;
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed in 7206f1d.

@badai-nguyen badai-nguyen added the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label Jan 22, 2025
@badai-nguyen badai-nguyen self-requested a review January 22, 2025 12:36
Copy link
Contributor

@badai-nguyen badai-nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@YoshiRi YoshiRi merged commit 30ab90e into main Jan 22, 2025
33 of 34 checks passed
@YoshiRi YoshiRi deleted the feat/enable_height_filter branch January 22, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants