Add reset-aware camera render intervals#1025
Open
zchJo wants to merge 1 commit into
Open
Conversation
Camera sensors can now set `render_update_period` to render images every N `sim.sense()` calls while reusing the previous camera buffers on skipped calls. Reset paths force a fresh camera render so post-reset visual observations remain current.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the feature mentioned in [Reset-aware camera render intervals for batched visual RL · Issue #1024 · mujocolab/mjlab](#1024).
This adds
CameraSensorCfg.render_update_period, defaulting to1so existing camera behavior is unchanged. When users set a larger period, mjlab skips camera rendering on intermediatesim.sense()calls and leaves the previous RGB/depth/segmentation buffers in place. Environment resets and GUI-driven reset updates force a fresh full-batch camera render, which keeps post-reset visual observations current without requiring users to render cameras every control step.The implementation keeps using MuJoCo Warp's public
refit_bvhandrenderAPIs. It does not implement selected-world rendering yet; that remains a possible follow-up after discussion in the linked issue and in google-deepmind/mujoco_warp#1373.Tests cover skipped camera updates, forced refresh after a skipped update, rejection of mismatched render periods across cameras that share one render context, and the existing camera and auto-reset paths. Documentation and the changelog were updated for the new configuration option.
Check results:
UV_NO_SYNC=1 make check: passed.UV_NO_SYNC=1 make test: passed, 903 passed.UV_NO_SYNC=1 make test-all: passed, 903 passed.UV_NO_SYNC=1 uv run pytest tests/test_camera_sensor.py: passed, 17 passed.UV_NO_SYNC=1 uv run pytest tests/test_auto_reset.py: passed, 6 passed.git diff --check: passed.