gazebosim / gz-sim

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

Restore log playback #2590

Closed arjo129 closed 2 months ago

arjo129 commented 2 months ago

๐ŸฆŸ Bug fix

Summary

Fixes https://github.com/gazebosim/gazebo_test_cases/issues/1640

This is related to: https://github.com/gazebosim/gazebo_test_cases/issues/1640

During the refactor of the SimulationRunner we seem to have broken log playback. In our current set up we need a sdf world to start a SimulationRunner. This sdf world is used for parameterizing which services and topics the server should advertise on. The client GUI then queries the server for running worlds derived from SDFs.

Unfortunately, when playing back from a log file, no SDF world is available. All the world information comes directly from the log file. This means that when we start a playback session the server always responds to the client with a default world. The client then proceeds to listen for the state on /world/default/state, however once the server starts running the log files, it publishes the state on /world/log_pendulum/state.

The current work around this PR proposes is to read the log file during initialization prior to setting up the transport topics. We then set up the relevant topics. There are probably better ways of handling such behaviour, but given the limited time this seemed to be the quickest way to restore functionality. Additionally, the current implementation will not work with zip files.

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.

๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ

arjo129 commented 2 months ago

Closing in favor of #2611