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(multi_object_tracker): prevent too large object tracking #7159

Conversation

technolojin
Copy link
Contributor

@technolojin technolojin commented May 29, 2024

Description

A bug was reported that a huge (length of 6km) object is appeared from the object tracking.

It is happening when a unknown object (shape of autoware_auto_perception_msgs::msg::Shape::POLYGON) is assigned to a bicycle tracker.
It was caused by utils::convertConvexHullToBoundingBox(object, bbox_object) which treats the footprint points as global (map coordinate) position, while the input is local (the object coordinate).

  1. Fix bug on utils::convertConvexHullToBoundingBox(object, bbox_object)
  2. Add a detected object size checker. Update the object size only if the size is proper

Tests performed

  1. Configure data_association_matrix.param.yaml to enable the unknown object can be assigned to bicycle tracker
/**:
  ros__parameters:
    can_assign_matrix:
      #UNKNOWN, CAR, TRUCK, BUS,  TRAILER, MOTORBIKE, BICYCLE,PEDESTRIAN <-Measurement
      [1,       0,   0,     0,    0,       0,         0,      0,         #UNKNOWN <-Tracker
       0,       1,   1,     1,    1,       0,         0,      0,         #CAR
       0,       1,   1,     1,    1,       0,         0,      0,         #TRUCK
       0,       1,   1,     1,    1,       0,         0,      0,         #BUS
       0,       1,   1,     1,    1,       0,         0,      0,         #TRAILER
       1,       0,   0,     0,    0,       1,         1,      1,         #MOTORBIKE
       1,       0,   0,     0,    0,       1,         1,      1,         #BICYCLE
       1,       0,   0,     0,    0,       1,         1,      1]         #PEDESTRIAN

Replay a file that contains to associate an object that have poligon shape to a tracker.

simplescreenrecorder-2024-05-29_16.56.45.mp4

Red box: previous tracking object
Green box: fixed tracking object

  1. Perception Regular Test
    test result: TIER IV INTERNAL
    261/264 PASS
    ! This test shows that the reference mode can be used as before, not testing the problem is resolved (since this scene is not in the test)

Effects on system behavior

Not applicable.

Interface changes

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.

@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label May 29, 2024
@technolojin technolojin changed the title fix(multi_object_tracker):prevent too large object tracking fix(multi_object_tracker): prevent too large object tracking May 29, 2024
@technolojin technolojin self-assigned this May 29, 2024
@technolojin technolojin force-pushed the fix/prevent-too-large-object-tracking branch from 740f1ca to e35794e Compare May 29, 2024 10:52
@technolojin technolojin force-pushed the fix/prevent-too-large-object-tracking branch from e35794e to 3e8cff6 Compare May 30, 2024 00:36
@technolojin technolojin marked this pull request as ready for review May 30, 2024 04:08
Signed-off-by: Taekjin LEE <[email protected]>
min_y = std::min(min_y, local_vertex.y());

max_z = std::max(max_z, static_cast<double>(input_object.shape.footprint.points.at(i).z));
const double foot_x = input_object.shape.footprint.points.at(i).x;
Copy link
Contributor

Choose a reason for hiding this comment

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

[imho]
I think footprint is calculated by relative distance from centroid in base_link and not in object coordinate.
So, I guess yaw rotation fix will be necessary before get maximum x,y value.

Currently, it won't make any change because yaw of unknown object may be 0 in all case.

Copy link
Contributor Author

@technolojin technolojin May 30, 2024

Choose a reason for hiding this comment

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

Base line: the source of the unknown polygon object is from shape_estimator.

  1. Object Position:
    • Coordinate origin: base_link
    • Position: polygon centroid
    • evidence
  2. Footprint:
    • Coordinate origin: object position (polygon centroid)
    • Positions: convex hull point positions, local
    • evidence

I also checked the object size, output of this function, and confirmed that the numbers are as expected (about 0.7 m).

Therefore the footprint points are not from the base_link, but from the object origin.

Oh, you are talking about the orientation... let me check it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the message defines the footprint is in the object coordinate (as its position is from the object position), the width and length should be on its coordinate, not rotated one.

It doesn't matter whether the shape_estimator implementation is done in yaw = 0 or not.
If the shape_estimator do the yaw estimation in the polygon&convex hull function, it should rotate the point cloud when it make the message.

Copy link
Contributor

Choose a reason for hiding this comment

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

Understood. Then, your code is fine.

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

@YoshiRi YoshiRi added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label May 31, 2024
@technolojin technolojin merged commit a4a3b82 into autowarefoundation:main May 31, 2024
38 of 41 checks passed
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…efoundation#7159)

* fix: set minimum and maximum object for size update

Signed-off-by: Taekjin LEE <[email protected]>

* fix: bug of convertConvexHullToBoundingBox

Signed-off-by: Taekjin LEE <[email protected]>

* fix: return false when footprint is less than 3 points

Signed-off-by: Taekjin LEE <[email protected]>

* fix: size filter bug

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: try to convert polygon to bbox

Signed-off-by: Taekjin LEE <[email protected]>

* chore: clean-up

Signed-off-by: Taekjin LEE <[email protected]>

* fix: bicycle tracker to try bbox convert

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* chore: clean-up

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
a-maumau pushed a commit to a-maumau/autoware.universe that referenced this pull request Jun 7, 2024
…efoundation#7159)

* fix: set minimum and maximum object for size update

Signed-off-by: Taekjin LEE <[email protected]>

* fix: bug of convertConvexHullToBoundingBox

Signed-off-by: Taekjin LEE <[email protected]>

* fix: return false when footprint is less than 3 points

Signed-off-by: Taekjin LEE <[email protected]>

* fix: size filter bug

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: try to convert polygon to bbox

Signed-off-by: Taekjin LEE <[email protected]>

* chore: clean-up

Signed-off-by: Taekjin LEE <[email protected]>

* fix: bicycle tracker to try bbox convert

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* chore: clean-up

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@technolojin technolojin deleted the fix/prevent-too-large-object-tracking branch July 11, 2024 05:35
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
* fix: set minimum and maximum object for size update

Signed-off-by: Taekjin LEE <[email protected]>

* fix: bug of convertConvexHullToBoundingBox

Signed-off-by: Taekjin LEE <[email protected]>

* fix: return false when footprint is less than 3 points

Signed-off-by: Taekjin LEE <[email protected]>

* fix: size filter bug

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: try to convert polygon to bbox

Signed-off-by: Taekjin LEE <[email protected]>

* chore: clean-up

Signed-off-by: Taekjin LEE <[email protected]>

* fix: bicycle tracker to try bbox convert

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* chore: clean-up

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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) 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.

2 participants