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(bytetrack): fix uninteded roi value error due to casting int to uint #5589

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

YoshiRi
Copy link
Contributor

@YoshiRi YoshiRi commented Nov 15, 2023

Description

Sometimes bytetrack publish invalid roi with very large x or y offset value like 4294967293.
I found this is caused by mis-type casting from bytetrack roi int32 to ros message roi uint32.

So I fixed message conversion part.

🤖 Generated by Copilot at 7c8e94f

Fix bytetrack node crash when roi is outside of image. Adjust roi values to fit image boundaries and message type in perception/bytetrack/src/bytetrack_node.cpp.

Tests performed

Tested with yolo roi and odaiba video image.
Original yolo roi do not publish invalid rois and after this PR, bytetrack also publish invalid rois.

Screenshot from 2023-11-15 15-31-14

Effects on system behavior

Not applicable.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@YoshiRi YoshiRi requested a review from manato as a code owner November 15, 2023 06:54
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Nov 15, 2023
@YoshiRi YoshiRi added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Nov 15, 2023
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (3a1d480) 14.77% compared to head (47fcced) 14.77%.
Report is 204 commits behind head on main.

Files Patch % Lines
perception/bytetrack/src/bytetrack_node.cpp 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5589      +/-   ##
==========================================
- Coverage   14.77%   14.77%   -0.01%     
==========================================
  Files        1663     1663              
  Lines      115150   115156       +6     
  Branches    35519    35519              
==========================================
  Hits        17013    17013              
- Misses      78930    78936       +6     
  Partials    19207    19207              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 14.77% <ø> (+<0.01%) ⬆️ Carriedforward from 7c8e94f

*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

@miursh miursh left a comment

Choose a reason for hiding this comment

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

LGTM, but I have not confirmed it on the actual ECU.

@YoshiRi
Copy link
Contributor Author

YoshiRi commented Nov 21, 2023

OK. This is just quick fix. So I will merge it.
@manato Could you approve this PR?

@YoshiRi YoshiRi enabled auto-merge (squash) November 21, 2023 01:40
Copy link
Contributor

@manato manato left a comment

Choose a reason for hiding this comment

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

LGTM.
I confirmed that this modification can be built on a perception ECU. Thank you for the fixing @YoshiRi !

@YoshiRi YoshiRi merged commit 7752350 into autowarefoundation:main Nov 21, 2023
22 of 25 checks passed
@YoshiRi YoshiRi deleted the feat/fix_bytetrack_bug branch November 21, 2023 02:38
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Nov 22, 2023
…int (autowarefoundation#5589)

* fix uint32 conversion bug in bytetrack

Signed-off-by: yoshiri <[email protected]>

* refactor outside xy variable

---------

Signed-off-by: yoshiri <[email protected]>
danielsanchezaran pushed a commit to tier4/autoware.universe that referenced this pull request Dec 15, 2023
…int (autowarefoundation#5589)

* fix uint32 conversion bug in bytetrack

Signed-off-by: yoshiri <[email protected]>

* refactor outside xy variable

---------

Signed-off-by: yoshiri <[email protected]>
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants