gazebosim / gz-sensors

Provides numerous sensor models designed to generate realistic data from simulation environments.
https://gazebosim.org
Apache License 2.0
64 stars 58 forks source link

Optimization: skip applying noise and distortion to lidars and camera sensors if parameters are 0s #450

Closed iche033 closed 4 months ago

iche033 commented 4 months ago

🦟 Bug fix

Summary

When Gaussian noise params and distortion coefficients are 0s, there shouldn't be any change to the sensor output. So skip doing extra computations in this case.

One instance where this usually happens is when a user saves the world to file in gz-sim, all sdf elements are written out with their default values. So when you load the saved world sdf file back in, you now have noise / distortion sdf elements present but with values of 0s.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.