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

Feature/simple sensor simulator/custom noise #1200

Merged
merged 20 commits into from
Mar 28, 2024

Conversation

yamacir-kit
Copy link
Collaborator

@yamacir-kit yamacir-kit commented Feb 27, 2024

Description

Abstract

Added customization point CustomNoiseApplicator for Autoware developers to implement a method for calculating the positional noise that simple_sensor_simulator's DetectionSensor applies to detected_objects.

This pull request also includes the following three bug fixes found in its implementation.

  • A bug that makes the actual recognition distance 300 m when DetectionSensor is set to 300 m or more
  • A bug that causes invalid (empty) detected_objects to be published from the start of the simulation until the number of seconds set for the sensor's recognition delay time has elapsed
  • A bug that causes invalid (empty) ground truth objects to be published from the start of the simulation until the number of seconds set for the sensor's recognition delay time has elapsed

In addition, the process by which DetectionSensor lists entities that are within the sensor's range was extremely inefficient and was refactored.

Background

The developer of Autoware asked us to try an arbitrary method of applying position noise for planner development, such as "increasing the position noise according to the distance between Autoware and the recognition target". In order to make it easy for them to do this, it became necessary to provide a customization point that would allow them to easily replace the existing default noise application functionality while keeping it in place.

Details

DefaultNoiseApplicator and CustomNoiseApplicator

The DefaultNoiseApplicator implements conventional noise handling and the CustomNoiseApplicator inherits it. DetectionSensor<>::update uses CustomNoiseApplicator, but Custom only inherits from DefaultNoiseApplicator and does not define any member functions, so the actual work is done by DefaultNoiseApplicator.

And (as the comments in the code indicate) the contents of the CustomNoiseApplicator are intended to be implemented by Autoware developers as needed.

Refactoring

The process by which DetectionSensor lists entities that are within range of the sensor originally looked like this:

  1. List the names of entities that are within 300 m (this is a fixed value, one of the bugs fixed) of the sensor.
  2. List the names of the entities listed in 1 that are within X m (this is an externally given parameter) of the sensor.
  3. Copy the data of the entities whose names match the names listed in 2 to a new vector.

The above has been changed by this pull request to "iterate (not copy) on non-Ego entities that are within a distance of X meters".

@yamacir-kit yamacir-kit self-assigned this Feb 27, 2024
Copy link

github-actions bot commented Feb 27, 2024

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@yamacir-kit yamacir-kit added the bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 label Mar 26, 2024
@yamacir-kit yamacir-kit requested a review from HansRobo March 27, 2024 03:56
@yamacir-kit yamacir-kit marked this pull request as ready for review March 27, 2024 03:56
@HansRobo HansRobo merged commit 9a5c063 into master Mar 28, 2024
10 checks passed
@HansRobo HansRobo deleted the feature/simple_sensor_simulator/custom_noise branch March 28, 2024 09:05
@github-actions github-actions bot restored the feature/simple_sensor_simulator/custom_noise branch March 28, 2024 09:06
@github-actions github-actions bot deleted the feature/simple_sensor_simulator/custom_noise branch March 28, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor If this pull request merged, bump minor version of the scenario_simulator_v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants