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

refactor(autoware_image_projection_based_fusion): organize 2d-detection related members #9789

Conversation

technolojin
Copy link
Contributor

@technolojin technolojin commented Dec 25, 2024

Description

Avoid to use index-based member management.

  1. A new struct Det2dStatus replaces vector of variables related to roi/camera.
  2. Index-based accesses were replaced by object-oriented way as much as possible.
  3. Templates of input/output types are revised
  4. Comments on each process were added

This PR do not contain any logical change.

Related links

Parent Issue:

  • Link

How was this PR tested?

TIER IV INTERNAL 1
TIER IV INTERNAL 2
TIER IV INTERNAL 3

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@technolojin technolojin self-assigned this Dec 25, 2024
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Dec 25, 2024
Copy link

github-actions bot commented Dec 25, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@technolojin technolojin force-pushed the refactor/image-proj-fus/input-rois-channel branch 2 times, most recently from e079772 to f5a5a56 Compare December 26, 2024 09:10
@technolojin technolojin marked this pull request as ready for review December 26, 2024 09:13
@technolojin technolojin added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 26, 2024
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

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

Project coverage is 29.62%. Comparing base (1e68602) to head (b819259).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
..._image_projection_based_fusion/src/fusion_node.cpp 0.00% 134 Missing ⚠️
...on_based_fusion/src/roi_pointcloud_fusion/node.cpp 0.00% 21 Missing ⚠️
...fusion/src/segmentation_pointcloud_fusion/node.cpp 0.00% 18 Missing ⚠️
...ction_based_fusion/src/roi_cluster_fusion/node.cpp 0.00% 16 Missing ⚠️
...sed_fusion/src/roi_detected_object_fusion/node.cpp 0.00% 15 Missing ⚠️
...ion_based_fusion/src/pointpainting_fusion/node.cpp 0.00% 10 Missing ⚠️
...ware/image_projection_based_fusion/fusion_node.hpp 0.00% 4 Missing ⚠️
...sed_fusion/segmentation_pointcloud_fusion/node.hpp 0.00% 3 Missing ⚠️
..._image_projection_based_fusion/src/utils/utils.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9789      +/-   ##
==========================================
- Coverage   29.72%   29.62%   -0.10%     
==========================================
  Files        1453     1453              
  Lines      108989   108841     -148     
  Branches    42627    42510     -117     
==========================================
- Hits        32392    32244     -148     
+ Misses      73484    73391      -93     
- Partials     3113     3206      +93     
Flag Coverage Δ *Carryforward flag
differential 3.50% <0.00%> (?)
differential-cuda 2.51% <0.00%> (?)
total 29.69% <0.00%> (-0.03%) ⬇️ Carriedforward from dd60d8e

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

@kminoda
Copy link
Contributor

kminoda commented Dec 26, 2024

@technolojin Are you sure this is "refactor" and not "feat" nor "fix"? At least the logic around mutex is changed, so I think it is risky to name it "refactor".

@technolojin
Copy link
Contributor Author

@technolojin Are you sure this is "refactor" and not "feat" nor "fix"? At least the logic around mutex is changed, so I think it is risky to name it "refactor".

Since the mutex related changes are removed, this PR became a pure refactoring.
a01f84f

@technolojin technolojin requested a review from kminoda December 27, 2024 09:00
@vividf vividf self-requested a review January 3, 2025 12:35
Copy link
Contributor

@vividf vividf left a comment

Choose a reason for hiding this comment

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

Thank you for your thoughtful refactoring! The updated code is significantly more readable and well-structured compared to the previous version.
In my opinion, there are likely areas within roi_pointcloud_fusion and pointpainting_fusion that could also be improved further.

Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

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

Would you consider making splitting this PR into several ones? Current changes are bit too many to assess.

My suggestion is:

  • PR 1: Simply replacing the type names with "using PointCloudMsgType", "using RoiMsgType"
  • PR 2: Introduce Det2dStatus

@technolojin
Copy link
Contributor Author

Would you consider making splitting this PR into several ones? Current changes are bit too many to assess.

My suggestion is:

* PR 1: Simply replacing the type names with "using PointCloudMsgType", "using RoiMsgType"

* PR 2: Introduce `Det2dStatus`

I understand your point.
Unfortunately, those two changes are overlapped, therefore, it will take a big effort from now.
How much do you think separating PR is important? Is it worth 5h for example?

@kminoda
Copy link
Contributor

kminoda commented Jan 7, 2025

@technolojin I see, I thought it is worth splitting if it only takes 20-30min, but if it takes 5hr then it's not necessary. Let me review this PR as it is.

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Export the `exportProcess()` method in `fusion_node.cpp` to handle the post-processing and publishing of the fused messages. This method cancels the timer, performs the necessary post-processing steps, publishes the output message, and resets the flags. It also adds processing time for debugging purposes. This change improves the organization and readability of the code.

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Refactor the `fusion_node.hpp` and `fusion_node.cpp` files to improve code organization and readability. This includes exporting the `exportProcess()` method in `fusion_node.cpp` to handle post-processing and publishing of fused messages, adding comments on each process step, organizing methods, and fusing the main message with cached ROI messages. These changes enhance the overall quality of the codebase.

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
…zation and readability

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

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

Sorry for 五月雨式 comments 🙇

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
@technolojin technolojin force-pushed the refactor/image-proj-fus/input-rois-channel branch from 63fd796 to ca1a474 Compare January 7, 2025 02:16
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
@vividf vividf self-requested a review January 7, 2025 08:44
…zation and readability

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
@technolojin technolojin requested a review from kminoda January 7, 2025 09:03
@vividf vividf self-requested a review January 7, 2025 09:38
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
Copy link
Contributor

@vividf vividf left a comment

Choose a reason for hiding this comment

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

LGTM for the refactor 🚀

Copy link
Contributor

@kminoda kminoda 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 technolojin enabled auto-merge (squash) January 8, 2025 06:56
@technolojin technolojin disabled auto-merge January 8, 2025 07:10
@technolojin technolojin enabled auto-merge (squash) January 8, 2025 07:21
@technolojin technolojin merged commit 14ee08b into autowarefoundation:main Jan 8, 2025
32 of 34 checks passed
@technolojin technolojin deleted the refactor/image-proj-fus/input-rois-channel branch January 8, 2025 07:39
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)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants