gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

Consolidate entity creation.

Open nkoenig opened this issue 1 week ago • 2 comments

🎉 New feature

Summary

I'm slowly splitting up #1669. This PR breaks out the consolidation of entity creation into a separate PR. The LevelManager had entity creation logic, which mimicked (mostly) the functionality in SdfEntityCreator.

The SdfEntityCreator now contains the logic to create entities, and the level manager's logic has been removed. The SimulationRunner loads the level manager, plugins, and calls SdfEntityCreator::CreateEntities.

Notes

  1. Requires a new release of SDF13 (https://github.com/gazebosim/sdformat/pull/1436).
  2. The LogicalAudioSensorPlugin and PosePublisher systems used topicFromScopedName with false for the _excludeWorld parameter. Prior to this PR, this result was a model scoped name (/mode/blah). This was because the model wasn't attached to the world when the plugin's Configure function was called. With this PR, the model is now properly attached. In order to maintain the expected behavior, I've changed the false to true when using the topicFromScopedName function.
  3. The Wind plugin was loaded by the LevelManager. I've propagated this to SdfEntityCreator. I don't think this should effect simulation behavior.

Test it

The tests should pass.

Checklist

  • [x] Signed all commits for DCO
  • [x] Added tests
  • [ ] Added example and/or tutorial
  • [x] Updated documentation (as needed)
  • [ ] Updated migration guide (as needed)
  • [ ] Consider updating Python bindings (if the library has them)
  • [x] codecheck passed (See contributing)
  • [x] All tests passed (See test coverage)
  • [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

nkoenig avatar Jun 24 '24 13:06 nkoenig