gazebosim / gz-sim

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

Consolidate entity creation. #2452

Open nkoenig opened 1 week ago

nkoenig commented 1 week ago

🎉 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

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 commented 6 days ago

@osrf-jenkins run tests

nkoenig commented 4 days ago

I see this error msg when running the levels.sdf world but performers + levels do seem to work though:

[Err] [LevelManager.cc:110] Could not find a plugin tag with name gz::sim. Levels and distributed simulation will not work.

Thanks. It looks like I had a incorrect else. Should be fixed in 4c1a186