-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancing log playback performance #351
Conversation
After taking a look at the failed tests in Jenkins, I believe that the failed tests can be ignored for the following reasons:
Considering that the @chapulina @iche033 what do you guys think? |
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: Ashton Larkin <[email protected]>
852fc9e
to
06ba47b
Compare
Signed-off-by: Nate Koenig <[email protected]>
I'm noticing some jerky playback. I tested with a log file that has five robot models. Can you confirm? |
The problem appears to be on the GUI side. The GUI process is running at over 200% CPU, and the server is running at 48% while maintaining a constant RTF. |
@nkoenig @iche033 I believe the jerky playback has been re-introduced by commit b07ebdd. We cannot call clear on every So, we must keep the poses that are currently cached until we know that we have new poses to overwrite the cache with, or else we run the risk of losing track of recent changes since Does that make sense? If not, I can try to explain things another way, but essentially, we have to remember that the |
@nkoenig @iche033 as a follow up, I tested the code before and after commit b07ebdd, and noticed that jumpy playback occurs when calling clear every In order to achieve smooth playback, should we revert b07ebdd and go back to 06ba47b, or do either of you have any other preferences? |
Thanks for the explanation. That makes sense. I'll revert my changes. |
Signed-off-by: Nate Koenig <[email protected]>
Reverted. |
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: Ashton Larkin <[email protected]>
changes look good. Waiting for one last round of CI builds |
Can I get one more review of this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @adlarkin ! Solves 2 problems at once 👍
Codecov Report
@@ Coverage Diff @@
## ign-gazebo2 #351 +/- ##
================================================
+ Coverage 53.78% 77.99% +24.20%
================================================
Files 121 186 +65
Lines 5838 10184 +4346
================================================
+ Hits 3140 7943 +4803
+ Misses 2698 2241 -457
Continue to review full report at Codecov.
|
* enhanced log playback performance Signed-off-by: Ashton Larkin <[email protected]> * Handling multiple Parse(...) calls in a single Update Signed-off-by: Ashton Larkin <[email protected]> * Change clear behavior Signed-off-by: Nate Koenig <[email protected]> * Revert changes Signed-off-by: Nate Koenig <[email protected]> * explain cached pose clearing behavior Signed-off-by: Ashton Larkin <[email protected]> * fixed whitespacing for codecheck Signed-off-by: Ashton Larkin <[email protected]> Co-authored-by: Nate Koenig <[email protected]> Co-authored-by: Ian Chen <[email protected]> Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: Guillaume Doisy <[email protected]>
I've changed how log playback works in order to increase RTF and remove jumpy playback.
Previously, when setting updated entity poses in the log file as a
PeriodicChange
, log playback was jumpy. This was because theSceneBroadcaster
updates at a different rate than when the log file is parsed (60 Hz), so, if log parsing didn't occur during the same cycle as a publication from theSceneBroadcaster
, changed poses from the latest log parse call were not captured in the rendering update. In order to get around this, the updated poses were saved as aOneTimeChange
.The issue with using
OneTimeChange
is that playback performance is noticeably slower for worlds with a lot of entities. The reason for this is because whenever there is aOneTimeChange
, theSceneBroadcaster
will publish the full state, even if only one pose was changed.In order to maintain the performance that comes with
PeriodicChange
while removing the jumpy playback that arises from different parsing and scene update rates, I cached the changed poses from the latest log parse call as aPeriodicChange
. Then, whenever it is time for a scene update, only the cached pose updates are rendered instead of the full scene.Below shows the RTF difference when playing back a log at regular speed for a SubT world, which has a lot of entities. The first video is before caching (
OneTimeChange
), and the second video uses caching (PeriodicChange
). A few things to note:OneTimeChange
, when it should stay close to 100% since we omit physics during log playback.PeriodicChange
, which is expected for log playback at regular speed since we have the pose updates for every step without having to run any physics.Here is an example of log playback at double speed with the simple double pendulum world. We still achieve smooth playback and keep an RTF close to the theoretical expectation of 200% for 2x playback speed (on my machine, at least).
Signed-off-by: Ashton Larkin [email protected]