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_image_based_projection_fusion): redesign image based projection fusion node #10016

Conversation

vividf
Copy link
Contributor

@vividf vividf commented Jan 24, 2025

Description

This PR refactors the fusion node, introducing several new features:

  • Parsing diagnostics from the concatenate node to adjust the offset between 3D messages and ROIs dynamically.
  • Implementing a stricter matching strategy.
  • Allowing the collector to control when the fusion process is executed.
  • Publishing diagnostics for the fusion status

More information is provided in the readme

Related links

Parent Issue:
TIER IV INTERNAL link

PRs that need to be merged together with this PR

How was this PR tested?

Evaluator

Diagnostics

Screenshot from 2025-02-26 17-57-18

Comparison

Rosbag: TIER4_ROSBAG

Frame comparison

New algorithm
Screenshot from 2025-02-26 15-42-16

Old algorithm
Screenshot from 2025-02-26 15-50-54

Video comparison

New algorithm vs Old algorithm

Processing time

Almost the same (1-2 ms difference)
new:

new_algorithm

old:

  • Note that this cannot be tested directly with the current (old) algorithm because the trigger for processing time is incorrect, making it impossible to accurately measure the time from preprocessing through fusion to postprocessing.
    old_algorithm_modify_processing_new_param

Notes for reviewers

How to run with awf-latest in pilot.auto

  • Follow the TIER4_INTERNAL_LINK to build the project from main branch.
  • Build the project
  • Replace the universe
  • Build the autoware_pointcloud_preprocessor and autoware_image_projection_based_fusion

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jan 24, 2025
Copy link

github-actions bot commented Jan 24, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

@technolojin technolojin self-assigned this Jan 24, 2025
@vividf vividf self-assigned this Jan 24, 2025
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@github-actions github-actions bot added the component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) label Jan 30, 2025
vividf added 11 commits February 6, 2025 18:53
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
…oo many processing collector

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@technolojin technolojin added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Feb 20, 2025
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Feb 20, 2025
vividf and others added 3 commits February 21, 2025 00:52
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf vividf added the run:deploy-docs Mark for deploy-docs action generation. (used-by-ci) label Feb 20, 2025
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 0.88810% with 558 lines in your changes missing coverage. Please review.

Project coverage is 26.35%. Comparing base (b7acf99) to head (3f01fcf).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
..._image_projection_based_fusion/src/fusion_node.cpp 0.00% 256 Missing ⚠️
...tion_based_fusion/src/fusion_matching_strategy.cpp 0.00% 146 Missing ⚠️
...e_projection_based_fusion/src/fusion_collector.cpp 0.00% 117 Missing ⚠️
...sed_fusion/src/roi_detected_object_fusion/node.cpp 0.00% 11 Missing ⚠️
...on_based_fusion/src/roi_pointcloud_fusion/node.cpp 0.00% 8 Missing ⚠️
...ion_based_fusion/src/pointpainting_fusion/node.cpp 0.00% 6 Missing ⚠️
...ction_based_fusion/src/roi_cluster_fusion/node.cpp 0.00% 5 Missing ⚠️
...image_projection_based_fusion/fusion_collector.hpp 0.00% 3 Missing ⚠️
...fusion/src/segmentation_pointcloud_fusion/node.cpp 0.00% 3 Missing ⚠️
...ojection_based_fusion/fusion_matching_strategy.hpp 0.00% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10016      +/-   ##
==========================================
- Coverage   26.48%   26.35%   -0.14%     
==========================================
  Files        1386     1391       +5     
  Lines      107338   107495     +157     
  Branches    41270    41332      +62     
==========================================
- Hits        28430    28330     -100     
- Misses      76074    76304     +230     
- Partials     2834     2861      +27     
Flag Coverage Δ *Carryforward flag
differential 20.62% <0.71%> (?)
differential-cuda 16.96% <0.71%> (?)
total 26.39% <100.00%> (-0.10%) ⬇️ Carriedforward from 3ba2da8

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

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@technolojin
Copy link
Contributor

I updated the branch but still build test issue persist.
#10198

@vividf Can you check it if the branch is based on the updated main branch???

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

Dear code owners, please review this PR.
This PR improves message synchronization so that overall latency decreases.

vividf and others added 5 commits February 26, 2025 18:48
@vividf
Copy link
Contributor Author

vividf commented Feb 27, 2025

@technolojin
I updated the parameters in 842eabc , 0f4c027, and 01b076b to match the sample example explained in the README.
Initially, I planned to set the parameters for xx1 gen1, but the offset settings differ significantly from our other project. I felt that using parameters from an older project in our sample example might not be ideal for understanding.

So, I created a fake sample and set corresponding fake parameters instead.

I will set the parameters for each project in their respective launchers.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf
Copy link
Contributor Author

vividf commented Feb 27, 2025

Regarding how to test this PR with the launcher.

  • Follow the TIER4_INTERNAL_LINK to build the project from main branch.
  • Build the project
  • Replace the universe
  • Build the autoware_pointcloud_preprocessor and autoware_image_projection_based_fusion

vividf and others added 6 commits February 27, 2025 17:13
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
….com:vividf/autoware.universe into feature/redesign_image_based_projection_node
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.

Thanks for your tough works! I have few comments. Please check it.

Comment on lines 356 to 361
for (auto existing_timestamp : fractional_timestamp_set_) {
if (std::abs(fractional_part - existing_timestamp) < msg3d_noise_window_ * 2) {
existing_timestamp = (existing_timestamp + fractional_part) / 2;
return; // If it belongs to an existing group, average the timestamp
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since fractional_timestamp_set_ is std::set and elements in set are const, this part won't work actually.

Try erase and re-insert, or replace data structure like vector.

  for (auto it = fractional_set.begin(); it != fractional_set.end(); ++it) {
    if (std::abs(*it - fractional_part) < tolerance) {
      // If it belongs to an existing group, average the timestamp
      double updated_value = (*it + fractional_part) / 2.0;
      fractional_set.erase(it);
      fractional_set.insert(updated_value);
      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.

You are right! Thanks a lot!
Fixed in 9213beb

@@ -16,7 +16,7 @@
<arg name="input/camera_info6" default="/camera_info6"/>
<arg name="input/rois7" default="rois7"/>
<arg name="input/camera_info7" default="/camera_info7"/>
<arg name="input/pointcloud" default="/perception/object_recognition/detection/pointcloud_map_filtered/pointcloud"/>
<arg name="input/pointcloud" default="/sensing/lidar/concatenated/pointcloud"/>
Copy link
Contributor

@YoshiRi YoshiRi Mar 1, 2025

Choose a reason for hiding this comment

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

I do not understand why did you want to do this for now. I do not agree this for several reasons.
We can discuss this in another PR.

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!
I changed this for testing, but I forgot to change it back!
Fixed in ac52b2f

vividf added 2 commits March 3, 2025 15:27
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf vividf requested a review from mojomex as a code owner March 3, 2025 07:37
@vividf vividf requested a review from YoshiRi March 3, 2025 07:39
@technolojin
Copy link
Contributor

Screenshot from 2025-03-03 17-56-27

vividf added 2 commits March 3, 2025 18:25
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
….com:vividf/autoware.universe into feature/redesign_image_based_projection_node
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

@vividf vividf merged commit e9d43e4 into autowarefoundation:main Mar 3, 2025
33 of 35 checks passed
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) component:sensing Data acquisition from sensors, drivers, preprocessing. (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.

3 participants