gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
621 stars 251 forks source link

Use SetComponentData to simplify code and improve coverage #2360

Closed scpeters closed 3 months ago

scpeters commented 3 months ago

🦟 Bug fix

Split out from #2228

Summary

There are several places in our code that can be simplified by using EntityComponentManager::SetComponentData to create a component for the specified entity if the component doesn't already exist. I initially made these improvements in #2228 but am splitting them out here and back porting to harmonic. There should be no behavior changes from this PR, just more concise code.

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.

scpeters commented 3 months ago

ABI checker passed though it didn't update the github status:

scpeters commented 3 months ago

I believe the test failures are unrelated to the systems modified here, merging