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(autonomous_emergency_braking): filter and crop aeb pointcloud #6875

Conversation

danielsanchezaran
Copy link
Contributor

@danielsanchezaran danielsanchezaran commented Apr 24, 2024

Description

This PR introduces an overhaul to the autonomous_emergency_braking (AEB) module.

  1. Added Euclidean clustering to consider only groups of point clouds that are bigger than a certain size (given by cluster tolerance and min amount of point parameters).
  2. The Point Cloud from sensing is cropped to only include points close to, or inside the ego predicted path.
  3. A Convex hull is created around each cluster of objects. The Vertices of the hull are the points used to calculate if a collision happens or not (the vertices of the hull correspond to the most “external points”, so it really only makes sense to consider said points.
  4. Only the closest Object/Vertex is evaluated for collision, (if ego evaluates that the closest point is safe, the other points will be safe too since they have, by definition, larger distances to the ego).

The goal of these changes is to avoid false positive triggering of the AEB by noisy points, reduce computation time by cropping out unrelated points off of the AEB point cloud, and simplify collision detection by checking the closest point

Example of AEB ignoring objects far from path (AEB points show as red points, normal are grey):

cap-.2024-04-24-14-57-47.mp4

Related links

Tests performed

PSIM tests

LSIM
Replayed these rosbags where AEB was wrongly activated, and there was no longer an activation
TIER IV INTERNAL LINK
TIER IV INTERNAL LINK

Notes for reviewers

Requires changes to Launch: autowarefoundation/autoware_launch#966

Interface changes

Effects on system behavior

Reduced false positive detection for AEB

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Apr 24, 2024
@danielsanchezaran danielsanchezaran marked this pull request as ready for review April 24, 2024 06:57
@danielsanchezaran danielsanchezaran force-pushed the feat/filter-and-crop-aeb-pointcloud branch from 1a3382e to 74d6251 Compare April 24, 2024 06:59
@@ -65,6 +67,33 @@ using visualization_msgs::msg::MarkerArray;
using Path = std::vector<geometry_msgs::msg::Pose>;
using Vector3 = geometry_msgs::msg::Vector3;

// For debugging
class DebugTimer
Copy link
Contributor

Choose a reason for hiding this comment

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

We have tier4_autoware_utils::StopWatch for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted

Copy link
Contributor

@soblin soblin left a comment

Choose a reason for hiding this comment

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

Ok, so you are filtering out the obstacle pointclouds that belong to clusters on the (inflated) ego footprint convex hull on the path. And then find the closest point (not the center of the cluster) along ego's path and check safety in the conventional way.

Is it possible to move cropeed_pointcloud_ptr from the member to a local variable / argument ? I prefer having less internal state variables.

@danielsanchezaran
Copy link
Contributor Author

Ok, so you are filtering out the obstacle pointclouds that belong to clusters on the (inflated) ego footprint convex hull on the path. And then find the closest point (not the center of the cluster) along ego's path and check safety in the conventional way.

Is it possible to move cropeed_pointcloud_ptr from the member to a local variable / argument ? I prefer having less internal state variables.

Exactly, I think it is fine to move the point cloud to a local variable, I will push a commit with the fix tomorrow!

@tkimura4
Copy link
Contributor

Could you update Readme ?

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
This reverts commit b5091fc.

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
@danielsanchezaran danielsanchezaran force-pushed the feat/filter-and-crop-aeb-pointcloud branch from 74d6251 to 4d6cbeb Compare April 25, 2024 04:42
Signed-off-by: Daniel Sanchez <[email protected]>
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Apr 25, 2024
@danielsanchezaran
Copy link
Contributor Author

Could you update Readme ?

Done!

@danielsanchezaran
Copy link
Contributor Author

Ok, so you are filtering out the obstacle pointclouds that belong to clusters on the (inflated) ego footprint convex hull on the path. And then find the closest point (not the center of the cluster) along ego's path and check safety in the conventional way.

Is it possible to move cropeed_pointcloud_ptr from the member to a local variable / argument ? I prefer having less internal state variables.

Done

@danielsanchezaran danielsanchezaran added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 25, 2024
@danielsanchezaran danielsanchezaran self-assigned this Apr 25, 2024
Signed-off-by: Daniel Sanchez <[email protected]>
@danielsanchezaran danielsanchezaran merged commit 80eca5e into autowarefoundation:main Apr 26, 2024
20 of 22 checks passed
@danielsanchezaran danielsanchezaran deleted the feat/filter-and-crop-aeb-pointcloud branch April 26, 2024 02:18
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request May 17, 2024
…utowarefoundation#6875)

* enable aeb, fix topic problem

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate unused var

Signed-off-by: Daniel Sanchez <[email protected]>

* enable aeb, fix topic problem

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate unused var

Signed-off-by: Daniel Sanchez <[email protected]>

* add clustering method to eliminate small objects/noise

Signed-off-by: Daniel Sanchez <[email protected]>

* remove comments

Signed-off-by: Daniel Sanchez <[email protected]>

* Crop points outside of EGO predicted path

Signed-off-by: Daniel Sanchez <[email protected]>

* remove offset

Signed-off-by: Daniel Sanchez <[email protected]>

* Update library use

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for empty cloud

Signed-off-by: Daniel Sanchez <[email protected]>

* add extra width for pointcloud cropping

Signed-off-by: Daniel Sanchez <[email protected]>

* Use single PC ptr

Signed-off-by: Daniel Sanchez <[email protected]>

* remove problematic option

Signed-off-by: Daniel Sanchez <[email protected]>

* Revert "Use single PC ptr"

This reverts commit b5091fc.

Signed-off-by: Daniel Sanchez <[email protected]>

* refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* Add back timestamp

Signed-off-by: Daniel Sanchez <[email protected]>

* consider all points in clusters

Signed-off-by: Daniel Sanchez <[email protected]>

* USe object hull to detect collisions

Signed-off-by: Daniel Sanchez <[email protected]>

* Use only closest object point

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused functions

Signed-off-by: Daniel Sanchez <[email protected]>

* remove debug timer out of code

Signed-off-by: Daniel Sanchez <[email protected]>

* make it so the clustering uses parameters

Signed-off-by: Daniel Sanchez <[email protected]>

* solve type problem

Signed-off-by: Daniel Sanchez <[email protected]>

* update comment

Signed-off-by: Daniel Sanchez <[email protected]>

* update README

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate member var in favor of local pointcloud ptr

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused chrono dependency

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
danielsanchezaran added a commit to tier4/autoware.universe that referenced this pull request May 22, 2024
…utowarefoundation#6875)

* enable aeb, fix topic problem

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate unused var

Signed-off-by: Daniel Sanchez <[email protected]>

* enable aeb, fix topic problem

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate unused var

Signed-off-by: Daniel Sanchez <[email protected]>

* add clustering method to eliminate small objects/noise

Signed-off-by: Daniel Sanchez <[email protected]>

* remove comments

Signed-off-by: Daniel Sanchez <[email protected]>

* Crop points outside of EGO predicted path

Signed-off-by: Daniel Sanchez <[email protected]>

* remove offset

Signed-off-by: Daniel Sanchez <[email protected]>

* Update library use

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for empty cloud

Signed-off-by: Daniel Sanchez <[email protected]>

* add extra width for pointcloud cropping

Signed-off-by: Daniel Sanchez <[email protected]>

* Use single PC ptr

Signed-off-by: Daniel Sanchez <[email protected]>

* remove problematic option

Signed-off-by: Daniel Sanchez <[email protected]>

* Revert "Use single PC ptr"

This reverts commit b5091fc.

Signed-off-by: Daniel Sanchez <[email protected]>

* refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* Add back timestamp

Signed-off-by: Daniel Sanchez <[email protected]>

* consider all points in clusters

Signed-off-by: Daniel Sanchez <[email protected]>

* USe object hull to detect collisions

Signed-off-by: Daniel Sanchez <[email protected]>

* Use only closest object point

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused functions

Signed-off-by: Daniel Sanchez <[email protected]>

* remove debug timer out of code

Signed-off-by: Daniel Sanchez <[email protected]>

* make it so the clustering uses parameters

Signed-off-by: Daniel Sanchez <[email protected]>

* solve type problem

Signed-off-by: Daniel Sanchez <[email protected]>

* update comment

Signed-off-by: Daniel Sanchez <[email protected]>

* update README

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate member var in favor of local pointcloud ptr

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused chrono dependency

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…utowarefoundation#6875)

* enable aeb, fix topic problem

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate unused var

Signed-off-by: Daniel Sanchez <[email protected]>

* enable aeb, fix topic problem

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate unused var

Signed-off-by: Daniel Sanchez <[email protected]>

* add clustering method to eliminate small objects/noise

Signed-off-by: Daniel Sanchez <[email protected]>

* remove comments

Signed-off-by: Daniel Sanchez <[email protected]>

* Crop points outside of EGO predicted path

Signed-off-by: Daniel Sanchez <[email protected]>

* remove offset

Signed-off-by: Daniel Sanchez <[email protected]>

* Update library use

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for empty cloud

Signed-off-by: Daniel Sanchez <[email protected]>

* add extra width for pointcloud cropping

Signed-off-by: Daniel Sanchez <[email protected]>

* Use single PC ptr

Signed-off-by: Daniel Sanchez <[email protected]>

* remove problematic option

Signed-off-by: Daniel Sanchez <[email protected]>

* Revert "Use single PC ptr"

This reverts commit b5091fc.

Signed-off-by: Daniel Sanchez <[email protected]>

* refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* Add back timestamp

Signed-off-by: Daniel Sanchez <[email protected]>

* consider all points in clusters

Signed-off-by: Daniel Sanchez <[email protected]>

* USe object hull to detect collisions

Signed-off-by: Daniel Sanchez <[email protected]>

* Use only closest object point

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused functions

Signed-off-by: Daniel Sanchez <[email protected]>

* remove debug timer out of code

Signed-off-by: Daniel Sanchez <[email protected]>

* make it so the clustering uses parameters

Signed-off-by: Daniel Sanchez <[email protected]>

* solve type problem

Signed-off-by: Daniel Sanchez <[email protected]>

* update comment

Signed-off-by: Daniel Sanchez <[email protected]>

* update README

Signed-off-by: Daniel Sanchez <[email protected]>

* eliminate member var in favor of local pointcloud ptr

Signed-off-by: Daniel Sanchez <[email protected]>

* remove unused chrono dependency

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:control Vehicle control algorithms and mechanisms. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants