Skip to content
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

Support locked entities, and headless video recording using sim time #862

Merged
merged 13 commits into from
Sep 23, 2021

Conversation

nkoenig
Copy link
Contributor

@nkoenig nkoenig commented Jun 16, 2021

Signed-off-by: Nate Koenig [email protected]

🎉 New feature

Related PR: gazebosim/gz-sensors#137

Summary

The goal of this PR is to support generating videos from log files using a headless simulation instance. In order to accomplish this, I need to spawn a camera into simulation and keep that camera around during log seeks. This lead to the need for locked entities within the ECM.

Recording a video using simulation time is required when you want a video to playback at real-time speeds. I copied the sim time video recording code from the Scene3d plugin.

Test it

There are ECM tests for the locking feature.
The easiest way to test the sim time video recording is to use the camera_video_record_dbl_pendulum.sdf example world file, and add <use_sim_time>true</use_sim_time> to the plugin. Depending on your machine, you may have to adjust the physics step to make sure simulation is running slower than real-time. Record a video, and note the simulation time duration for the video. The resulting video should have matching duration, which can be inspected using:

mplayer -identify VIDEO.MP4 2>/dev/null | grep ID_LENGTH

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • 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

@nkoenig nkoenig requested review from mjcarroll and iche033 June 16, 2021 22:30
@nkoenig nkoenig requested a review from chapulina as a code owner June 16, 2021 22:30
@github-actions github-actions bot added the 🔮 dome Ignition Dome label Jun 16, 2021
@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #862 (1818019) into ign-gazebo4 (8ab51a3) will increase coverage by 0.01%.
The diff coverage is 92.68%.

❗ Current head 1818019 differs from pull request most recent head f70a4e1. Consider uploading reports for the commit f70a4e1 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo4     #862      +/-   ##
===============================================
+ Coverage        67.10%   67.12%   +0.01%     
===============================================
  Files              243      243              
  Lines            18212    18250      +38     
===============================================
+ Hits             12222    12251      +29     
- Misses            5990     5999       +9     
Impacted Files Coverage Δ
include/ignition/gazebo/EntityComponentManager.hh 100.00% <ø> (ø)
src/gui/plugins/scene3d/Scene3D.cc 9.91% <ø> (ø)
src/EntityComponentManager.cc 87.24% <92.68%> (+0.30%) ⬆️
src/gui/plugins/entity_tree/EntityTree.cc 9.62% <0.00%> (-3.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ab51a3...f70a4e1. Read the comment docs.

@iche033
Copy link
Contributor

iche033 commented Jun 17, 2021

The sim time video recording feature is working for me. I also tried running faster than real time and that's working as well and produced the correct video length. (RTF just drops a little when video recording is on).

another nice video recorder param that we could port over later from Scene3D is so users can record high quality videos.

@iche033
Copy link
Contributor

iche033 commented Jun 17, 2021

another nice video recorder param that we could port over later from Scene3D is so users can record high quality videos.

#864

iche033 and others added 3 commits June 18, 2021 08:52
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Nate Koenig <[email protected]>
@chapulina chapulina self-requested a review July 19, 2021 18:28
@nkoenig nkoenig requested a review from mjcarroll September 23, 2021 13:10
Copy link
Contributor

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with Green CI (minus tests we know are flaky)

@nkoenig nkoenig merged commit a6d1c6a into ign-gazebo4 Sep 23, 2021
@nkoenig nkoenig deleted the locked_entities_camera_record branch September 23, 2021 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants