Optimization: skip applying noise and distortion to lidars and camera sensors if parameters are 0s #450
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🦟 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
codecheck
passed (See contributing)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.