[gazebo] Visual plugins not showing correctly in state log playback

Issue #88 resolved
Deanna Hood created an issue

The shipping boxes have two visuals: the open box, and the closed box. The visual gets toggled when the box reaches the end of the belt: the shipping box plugin publishes on a gazebo topic that the visual plugin is listening to. This works fine at sim-time.

During playback of the gazebo state log, the visualisation is never toggled.

Comments (9)

  1. Deanna Hood reporter

    I suspect that during playback, visual plugins are not re-playing pre-recorded state, but instead are being re-run. This is because the blink_visual.world during log playback will blink the visuals based off the wall time (even if the log playback is paused), while the visual plugins using sim time don't work.

  2. Deanna Hood reporter

    I think what's happening is that the model plugins are not loaded during playback (https://bitbucket.org/osrf/gazebo/issues/2427/state-log-wont-play-with-gazebo-83-because#comment-43348994), which means that no one is publishing the message to toggle the visual during log playback.

    The visual plugins are loaded, however, so they are subscribed to the message, we just need to get the drone plugin and the shipping box plugins to load and then they'd publish the toggle message. However, I'm not sure what other side effects there would be of loading those model plugins even if it were possible: the shipping box plugin triggers an animation at the end of the belt, for example: would that happen again during playback? I'm not sure.

    As an alternative to getting gazebo to load the model plugins, we could move the topic publishing to a sensor plugin as a workaround, since sensor plugins are loaded during playback. The shipping box just publishes the message when it reaches a location, so it's feasible to pull that out into a different plugin. The drone plugin sends a toggle message when it is part way through its collection animation... that could be pulled into a separate plugin too if it's location based instead of event based.

  3. Deanna Hood reporter

    From some brief investigation (https://bitbucket.org/osrf/ariac/branch/visual_playback_debug), it looks like sensor plugins are loaded during playback but don't update, but visual plugins will. So the workaround I had in mind would be:

    1. Move the box closing logic from the shipping box plugin to a separate visual plugin. That should take care of the box visual toggling.
    2. The drone has a box visual associated with it, disabled by default. The drone plugin (triggered with the /ariac/drone service) currently enables the box visual at the same time it triggers the "trap door" to dispose of the waiting box. We could add another visual plugin the the shipping box to detect when it has been disposed of ("underground" pose) and at that time trigger the drone's box visual too.

    There might be ways to do this with world or system plugins too but I haven't investigated that.

  4. Nate Koenig

    I think I'll try moving the code to a system plugin. Are you okay with altering the command that is run to playback a log file? The system plugin would need to be specified on the command line.

  5. Log in to comment