Conversation
…llow + SimRenderer.set_camera_view) Implements #64: - SystemCameraCfg gains a declarative `follow` field naming a body object in SceneCfg.objs; validate_scene_cfg rejects undeclared or non-body follow targets at scene validation time. - MotrixSimRenderer resolves the follow target's attach-root link once at construction and refreshes the system-camera lookat from live state on every rendered frame (windowed render, headless capture) while keeping the configured distance/elevation/azimuth; no update when not rendering. - SimRenderer gains a pure-value set_camera_view method as the script-level escape hatch; MotrixSimRenderer implements it for both modes. - scripts/view.py robot viewing and scripts/motion/replay.py migrate onto MotrixSimRenderer, removing direct RenderApp/system_camera wiring. - Tests cover the follow name-resolution contract and per-frame follow refresh; no numeric viewpoint assertions.
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.
Implements #64.
Summary
SystemCameraCfggains afollow: str | Nonefield naming a body object (BodyCfg/RobotCfgfield name) inSceneCfg.objs.validate_scene_cfgresolves the name at scene validation time — undeclared names or non-body objects (e.g. terrain) produce a clear error, mirroring query name resolution.MotrixSimRendererresolves the follow target's attach-root link once at construction and compiles a one-fieldLinkPositionquery plan;render()/capture()refresh the system-camera lookat from live state (env row 0 + its render offset) on every rendered frame whiledistance/elevation/azimuthkeep their configured values. No rendering → zero overhead; frontend and core stay unaware.SimRenderer.set_camera_view(lookat, distance, elevation, azimuth)— a pure value method with no backend camera object crossing the boundary.MotrixSimRendererimplements it for both windowed and headless modes.scripts/view.pyrobot viewing andscripts/motion/replay.pynow useMotrixSimRenderer, removing their hand-wiredRenderApp/system_camera.set_viewcode.Non-goals (per issue)
cameraproperty returning backend-native objects; no abstractCamerainterface.Tests
test_scene_cfg.py).render()and headlesscapture(), static view unchanged without follow,set_camera_viewpassthrough + lookat shape validation (test_renderer.py).Closes #64