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(object_lanelet_filter): add configurable margin for object lanel… #9240

Conversation

sebekx
Copy link
Contributor

@sebekx sebekx commented Nov 5, 2024

object_lanelet_filter

Description

Added configurable margin to object lanelet filter which extends area of ​​non filtered objects.

With margin 3m:
image
image

Related links

Related autoware launch pr with configs
Parent Issue:
None.

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@sebekx sebekx force-pushed the feat/autoware_detected_object_validation branch 2 times, most recently from b34c04b to 8ab23a3 Compare November 5, 2024 14:36
@sebekx sebekx force-pushed the feat/autoware_detected_object_validation branch from 8ab23a3 to f5196e4 Compare November 5, 2024 14:46
@YoshiRi
Copy link
Contributor

YoshiRi commented Nov 14, 2024

@badai-nguyen @technolojin Could you check this PR? (especially calculation cost)

@technolojin technolojin self-assigned this Nov 19, 2024
@technolojin technolojin added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 29.50%. Comparing base (0831075) to head (5bf3d37).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...t_validation/src/lanelet_filter/lanelet_filter.cpp 0.00% 34 Missing ⚠️
...t_validation/src/lanelet_filter/lanelet_filter.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9240      +/-   ##
==========================================
- Coverage   29.51%   29.50%   -0.01%     
==========================================
  Files        1442     1443       +1     
  Lines      108594   108629      +35     
  Branches    41502    41525      +23     
==========================================
  Hits        32055    32055              
- Misses      73418    73453      +35     
  Partials     3121     3121              
Flag Coverage Δ *Carryforward flag
differential 5.30% <0.00%> (?)
total 29.52% <ø> (+<0.01%) ⬆️ Carriedforward from 0831075

*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.

@a-maumau
Copy link
Contributor

a-maumau commented Nov 21, 2024

@sebekx Hi, thank you for your PR!

I timed the processing time by the TimeKeeper.

vs. implementation

impl. larger map lanelet_extra_margin avg. processing time
current impl. - N/A ~6.0 ms
current impl. N/A ~6.5 ms
this PR - 0.0 ~3.8 ms
this PR 0.0 ~4.0 ms
this PR - 0.1 ~12.6 ms
this PR 0.1 ~13.6 ms
this PR - 0.5 ~11.4ms
this PR - 1.0 ~10.3 ms
this PR - 3.0 ~8.5 ms
this PR 3.0 ~9.2 ms

case of debug=true

impl. debug lanelet_extra_margin avg. processing time
this PR true 0.0 ~4.4 ms
  • "larger map" in the table indicates that the same rosbag with a larger map, so the size of the map is the only difference. The rows having '✓' is using the larger map.
  • debug, lanelet_extra_margin is the parameter in the config file.

The implementation of this PR is faster than the current one when the lanelet_extra_margin is set to 0.0 (disabled).
(It should be coming from the reduction of the method calls)

@sebekx since I am not familiar with the bg::strategy::buffer, do you know what kind of behavior is expected for distance_strategy(<negative value>)? Checking the lanelets with debug=true option in this PR, it seems it does not create the margin for the lanelets.

@a-maumau
Copy link
Contributor

Also, it would be nice if you create the update PR for the config file in the autoware_launch too!

Comment on lines 79 to 85
viz_pub_ =
this->create_publisher<visualization_msgs::msg::MarkerArray>("~/debug/marker", rclcpp::QoS{1});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to create the publisher when the filter_settings_.debug == true since it only be used in publishDebugMarkers that is also only get called when filter_settings_.debug == true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added code that creates publisher only whether there is filter_settings_.debug == true.

filter_settings_.debug = declare_parameter<bool>("filter_settings.debug");
filter_settings_.lanelet_extra_margin =
declare_parameter<double>("filter_settings.lanelet_extra_margin");
//
Copy link
Contributor

Choose a reason for hiding this comment

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

remove //

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it still exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, now should be removed

@a-maumau
Copy link
Contributor

@sebekx also, could you fix the error in the cppcheck result ?

@sebekx
Copy link
Contributor Author

sebekx commented Nov 22, 2024

@sebekx since I am not familiar with the bg::strategy::buffer, do you know what kind of behavior is expected for distance_strategy(<negative value>)? Checking the lanelets with debug=true option in this PR, it seems it does not create the margin for the lanelets.

@a-maumau Hi, thanks for review. Normally it will make polygon smaller but in this implementation there is a condition to only expand polygons whether there is positive value of extra margin.

@sebekx
Copy link
Contributor Author

sebekx commented Nov 22, 2024

Also, it would be nice if you create the update PR for the config file in the autoware_launch too!

there is pr

@sebekx
Copy link
Contributor Author

sebekx commented Nov 22, 2024

@sebekx also, could you fix the error in the cppcheck result ?

fixed

@a-maumau
Copy link
Contributor

Hi, thanks for review. Normally it will make polygon smaller but in this implementation there is a condition to only expand polygons whether there is positive value of extra margin.

Ah, I simply forgot that part, thank you.

I first thought shrinking might have some needs in some cases, but it would make some gaps between the lanelet connections, so this is reasonable.

@technolojin
Copy link
Contributor

Also, it would be nice if you create the update PR for the config file in the autoware_launch too!

there is pr

Can you kindly add this link and description to this PR description?

@technolojin
Copy link
Contributor

I am going to test its performance.

@technolojin
Copy link
Contributor

I measured processing time in 3 different situation

A. Before
B. After with lanelet_extra_margin of 3.0
C. After withlanelet_extra_margin of zero

Screenshot from 2024-11-25 14-31-33

A: 5ms in low, 10ms of high load
B. 8ms in low, 19ms of high load
C. 3ms in low, 2ms of high load

In conclusion, the performance of the same usage is improved. If the extra margin is added, it causes computational cost (as expected).

Copy link
Contributor

@technolojin technolojin left a comment

Choose a reason for hiding this comment

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

LGTM

@technolojin
Copy link
Contributor

@YoshiRi can you confirm this PR?

Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Nov 29, 2024
@sebekx sebekx force-pushed the feat/autoware_detected_object_validation branch from 1e78267 to 97b0fad Compare November 29, 2024 09:44
@sebekx sebekx force-pushed the feat/autoware_detected_object_validation branch from a823ef8 to 8de8bed Compare November 29, 2024 11:05
Copy link
Contributor

@Shin-kyoto Shin-kyoto left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

NOTE: I did NOT check this PR by running this code.

@sebekx sebekx force-pushed the feat/autoware_detected_object_validation branch from 8de8bed to b96939e Compare November 29, 2024 21:34
Sebastian Zęderowski and others added 10 commits November 30, 2024 11:11
…et filter

Signed-off-by: Sebastian Zęderowski <[email protected]>

	modified:   perception/autoware_detected_object_validation/src/lanelet_filter/lanelet_filter.cpp

Signed-off-by: Sebastian Zęderowski <[email protected]>
… empty in debug mode

Signed-off-by: Sebastian Zęderowski <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
…ter/debug.cpp

Co-authored-by: Shintaro Tomie <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
Signed-off-by: Sebastian Zęderowski <[email protected]>
@sebekx sebekx force-pushed the feat/autoware_detected_object_validation branch from b96939e to 5bf3d37 Compare November 30, 2024 10:11
@technolojin technolojin merged commit 4479e94 into autowarefoundation:main Dec 2, 2024
32 checks passed
@technolojin
Copy link
Contributor

@sebekx Thank you for your contribution!

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) tag:require-cuda-build-and-test type:documentation Creating or refining documentation. (auto-assigned)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants