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

fix(autoware_image_projection_based_fusion): resolve issue with segmentation pointcloud fusion node failing with multiple mask inputs #8769

Conversation

vividf
Copy link
Contributor

@vividf vividf commented Sep 5, 2024

Description

This PR addresses issue #8460. The current design of the segmentation pointcloud fusion node is incompatible with the fusion base class because the fuseOnSingleImage function always uses the original input pointcloud in each iteration (camera), instead of the pointcloud that has filtered out points that fall outside the mask before processing. In the end, the current algorithm will lead to the problem that the output pointcloud will only filter out the points with the last camera's mask, instead of all cameras' masks

A simple fix would be to copy the output pointcloud and use it as the input for the next iteration. However, this approach increases processing time by approximately 0.2 ms per iteration (camera). Moreover, it impacts four other nodes in the autoware_image_projection_based_fusion package.

To avoid these drawbacks, I opted to modify the algorithm directly within the segmentation pointcloud fusion node. The new solution involves storing the offsets of points that are filtered out in a set. During post-processing, the points in the set are ignored, and the remaining points are copied to the output pointcloud.

Related links

Parent Issue:

How was this PR tested?

I test the PR with xx1 bag with using three camera (0, 1, 2)

launch yolox segmentation (modify multiple_yolox.launch.xml by adding output/mask)

ros2 launch autoware_tensorrt_yolox multiple_yolox.launch.xml

launch fusion node

ros2 launch autoware_image_projection_based_fusion segmentation_pointcloud_fusion.launch.xml

launch the xx1 tf

ros2 launch static_tf_publisher static_transforms_launch.py

Before (only filter out the camera 2 information (left) )

Screenshot from 2024-09-05 15-50-08

After
Screenshot from 2024-09-05 15-49-55

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@vividf vividf self-assigned this Sep 5, 2024
@vividf vividf added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

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

Project coverage is 25.02%. Comparing base (4cc1f75) to head (8820ac6).

Files with missing lines Patch % Lines
...fusion/src/segmentation_pointcloud_fusion/node.cpp 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8769      +/-   ##
==========================================
- Coverage   25.02%   25.02%   -0.01%     
==========================================
  Files        1322     1322              
  Lines       97979    97990      +11     
  Branches    37811    37815       +4     
==========================================
+ Hits        24521    24522       +1     
- Misses      70992    71001       +9     
- Partials     2466     2467       +1     
Flag Coverage Δ *Carryforward flag
differential 4.33% <0.00%> (?)
total 25.03% <ø> (+<0.01%) ⬆️ Carriedforward from 4cc1f75

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

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.

@vividf I really appreciate your PR.
LGTM

@vividf vividf enabled auto-merge (squash) September 5, 2024 16:56
@vividf vividf merged commit 301e36b into autowarefoundation:main Sep 5, 2024
24 of 25 checks passed
badai-nguyen pushed a commit to tier4/autoware.universe that referenced this pull request Sep 10, 2024
…ntation pointcloud fusion node failing with multiple mask inputs (autowarefoundation#8769)
badai-nguyen added a commit to tier4/autoware.universe that referenced this pull request Sep 10, 2024
….29.0 (#1526)

* feat(tensorrt yolox): inference and publish mask image from yolox model with semantic segmentation header (autowarefoundation#5553)

* add segmentation model

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

fix: add multitask for segment

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: publish mask

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* feat: publish colorized mask

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: resize yolox mask

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add memory allocate operations

Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>

* refactor: remove underscore for a local variable

Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>

* chore: add condition to check the number of subscriber for newly added topics

Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>

* chore: pre-commit

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add roi overlapping segment

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: roi overlay segment

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: refactor

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: update model name

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add utils into tensorrt_yolox

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: launch file

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: remove unnecessary depend

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: fix yaml file

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: remove duplicated param in launch

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: semantic class

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update readme

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: update default param

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: add processing time topic

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* chore: fix cspell error

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: yolox default param

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: rename debug topics

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: rename debug topics

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* docs: update model description

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix: launch

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* refactor: unpublish mask for single task

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* Update perception/tensorrt_yolox/src/tensorrt_yolox.cpp

Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>

* Update perception/tensorrt_yolox/src/tensorrt_yolox.cpp

Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>

* Update perception/tensorrt_yolox/src/tensorrt_yolox.cpp

Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>

* style(pre-commit): autofix

* docs: update reamde

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix: skip mask size as yolox output

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>
Co-authored-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>

* fix(tensorrt_yolox): add run length encoding for sematic segmentation mask (autowarefoundation#7905)

* fix: add rle compress

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: rle compress

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: move rle into utils

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: pre-commit

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* Update perception/autoware_tensorrt_yolox/src/utils.cpp

Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>

* fix: remove unused variable

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* Update perception/autoware_tensorrt_yolox/src/utils.cpp

Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>

* style(pre-commit): autofix

* feat: add unit test for utils

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix: unit test

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: change to explicit index

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix: cuda cmake

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: separate unit test into different PR

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>
Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* refactor(tensorrt_yolox): move utils into perception_utils (autowarefoundation#8435)

* chore(tensorrt_yolo): refactor utils

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix: tensorrt_yolox

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix(perception_utils): install library after build (autowarefoundation#8501)

Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>

* fix(image_projection_based_fusion): resize sematic segmentation mask as input image size (autowarefoundation#7635)

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix(image_projection_based_fusion): segmentation pointcloud fusion param update (autowarefoundation#7858)

* fix(image_projection_based_fusion): add run length decoding for segmentation_pointcloud_fusion (autowarefoundation#7909)

* fix: add rle decompress

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix: use rld in tensorrt utils

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: rebase error

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: dependency

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: skip publish debug mask

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* Update perception/autoware_image_projection_based_fusion/src/segmentation_pointcloud_fusion/node.cpp

Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com>

* style(pre-commit): autofix

* Revert "fix: skip publish debug mask"

This reverts commit 30fa9ae.

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com>

* feat(tier4_perception_launch): add image segmentation based pointcloud filter (autowarefoundation#7225)

* feat(tier4_perception_launch): add image segmentation based pointcloud filter

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: typo

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: detection launch

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* chore: add maintainer

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* Revert "chore: add maintainer"

This reverts commit 5adfef6.

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* style(pre-commit): autofix

* fix(autoware_image_projection_based_fusion): resolve issue with segmentation pointcloud fusion node failing with multiple mask inputs (autowarefoundation#8769)

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>
Co-authored-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Manato Hirabayashi <3022416+manato@users.noreply.github.com>
Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>
Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com>
Co-authored-by: Yi-Hsiang Fang (Vivid) <146902905+vividf@users.noreply.github.com>
emuemuJP pushed a commit to arayabrain/autoware.universe.origin that referenced this pull request Sep 10, 2024
…ntation pointcloud fusion node failing with multiple mask inputs (autowarefoundation#8769)

Signed-off-by: emuemuJP <k.matsumoto.0807@gmail.com>
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) tag:require-cuda-build-and-test tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Development

Successfully merging this pull request may close these issues.

2 participants