Skip to content

Conversation

@TauTheLepton
Copy link
Contributor

@TauTheLepton TauTheLepton commented Apr 15, 2025

Description

Abstract

This pull request aims to add noise to the topics:

  • /vehicle/status/velocity_status
  • /sensing/imu/imu_data
  • /localization/pose_estimator/pose_with_covariance

Note

This pull request may seem to be big, but the majority of the PR are tests and appending the parameters file.
For details on what part of this PR is not changing any functionality or actual simulator code, please see the table below.

What How many lines changed
Normal distribution tests +358
IMU sensor tests +510
Parameters file +191
SUM +1059

Background

Details

Publisher noise framework refactoring

The concealer noise framework has been slightly refactored in order to make it easier to implement additional randomizers.

The struct Error defined in NormalDistribution<nav_msgs::msg::Odometry> has been moved outside the NormalDistribution<nav_msgs::msg::Odometry> and renamed to NormalDistributionError, so that it could be used in other NormalDistribution specializations.
It has also been converted to template so that other real types supported by std::normal_distribution could be used.

Additionally, a member active has been added, so that the randomization of data could be turned off (this is opt-in, default is always active).

NormalDistributionBase base struct has been implemented in order to provide common functionality for all normal NormalDistribution specializations. It provides seed and engine members and a constructor that initializes them. The seed is obtained from the appropriate seed ROS parameter, and engine is initialized using the seed.

Thanks to the NormalDistributionBase, NormalDistribution specializations only have to define what randomization errors they contain, how they are initialized and how they are applied.

What is more, the Publisher::randomize member has been declared mutable, because its internal state changes (the random number generator engine) and this should not block developers from creating const Publishers.

Concealer noise

The NormalDistribution<nav_msgs::msg::Odometry> has been adjusted to the changes mentioned above.

The noise adding framework from concealer::Publisher has been used implementing additional concealer noise, that is noise applied to topics

  • /vehicle/status/velocity_status
  • /localization/pose_estimator/pose_with_covariance

For this reason, the NormalDistribution<autoware_vehicle_msgs::msg::VelocityReport> and NormalDistribution<geometry_msgs::msg::PoseWithCovarianceStamped> have been implemented and used in AutowareUniverse class.

Additionally, the unit tests for new NormalDistribution specializations have been implemented.

Simple sensor simulator noise

Noise adding framework from concealer::Publisher has been used implementing simple sensor simulator noise, that is the noise applied to topic

  • /sensing/imu/imu_data

Applying noise to this topic has been slightly more complicated, because the sensor already had some noise implementation.
The older noise implementation is incompatible with the normal distribution noise framework fromconcealer::Publisher.
For this reason, and the fact we want to keep the simulator backward compatible - the new noise adding method has been added "on top" of the old implementation with a switch enabling to choose which implementation should be used.

This means the original implementation is used by default and only when user specifies the parameter /sensing/imu/imu_data.override_legacy_configuration to be true the legacy method is switched off and the new method is switched on (part of this process involves calculating new covariance matrices, because they depend on the new noise parameters).

Additionally, unit tests (testing only the noise application correctness) for ImuSensor with both noise configurations (legacy and new) have been implemented.

Parameters

Finally, all parameters used for implemented noise have been listed in the scenario test runner parameters file.

References

INTERNAL LINK
No regressions confirmed

Destructive Changes

None

Known Limitations

None

…ionError and make it a template to accept multiple floating point types

Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
The previous noise mechanism is not in use

This required accessing Publisher::randomize to obtain normal distribution error standard deviations

Signed-off-by: Mateusz Palczuk <[email protected]>
Test applying noise using legacy parameters - simulation_api_schema

Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
@TauTheLepton TauTheLepton self-assigned this Apr 15, 2025
@github-actions
Copy link

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.

Signed-off-by: Mateusz Palczuk <[email protected]>
@TauTheLepton TauTheLepton added feature New feature or request waiting for CI bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 labels Apr 16, 2025
@TauTheLepton TauTheLepton changed the title Feature: Publisher Noise Feature: Add noise to Localization, Velocity status and IMU Apr 16, 2025
@TauTheLepton
Copy link
Contributor Author

No regressions confirmed here.

@TauTheLepton TauTheLepton force-pushed the feature/publisher-noise branch from fa7b459 to c3fc045 Compare June 16, 2025 09:38
@TauTheLepton TauTheLepton force-pushed the feature/publisher-noise branch from c3fc045 to 2d3fb38 Compare June 16, 2025 09:38
@TauTheLepton
Copy link
Contributor Author

No regressions confirmed here

@github-actions
Copy link

Failure optional scenarios

Note

This is an experimental check and does not block merging the pull-request.
But, please be aware that this may indicate a regression.

scenario failed: execution_time_test
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.005033000000000000147271084217) is greaterThan 0.005?}, {&quot;avoid startup&quot;: Is the simulation time (= 8.649999999999987920773492078297) is greaterThan 1.000000000000000000000000000000?}" />

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

@github-actions
Copy link

This PR has failed the SonarQube scan. Please check the details in the SonarQube dashboard.

@HansRobo HansRobo mentioned this pull request Nov 4, 2025
@HansRobo HansRobo mentioned this pull request Nov 25, 2025
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 feature New feature or request wait for regression test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants