18.2.0
Abstract
This pull-request is a part of #1577 by @TauTheLepton
In this pull-request, the noise for /vehicle/status/velocity_status topic is introduced.
Details
The following two items are copied from #1577 and are closely related to this pull request:
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
You can set the additive/multiplicative errors with specifying mean/standard_deviation parameters for longitudinal_velocity/lateral_velocity/heading_rate.
/vehicle/status/velocity_status:
version: 20240605 # architecture_type suffix (mandatory)
seed: 0 # If 0 is specified, a random seed value will be generated for each run.
autoware_vehicle_msgs::msg::VelocityReport:
longitudinal_velocity:
error:
additive:
mean: 0.0
standard_deviation: 0.0
multiplicative:
mean: 0.0
standard_deviation: 0.0
lateral_velocity:
error:
additive:
mean: 0.0
standard_deviation: 0.0
multiplicative:
mean: 0.0
standard_deviation: 0.0
heading_rate:
error:
additive:
mean: 0.0
standard_deviation: 0.0
multiplicative:
mean: 0.0
standard_deviation: 0.0References
Regression Test: OK
Destructive Changes
None
The default parameter is zero.
So the default behavior is not changed
Known Limitations
None