Track camera origins in Newton visualizers - #7390
Conversation
Previously, Newton visualizers interpreted eye and lookat as absolute world coordinates. The Kit visualizer already supported world, environment, and asset origins, so the same visualizer config produced different recordings when used with Newton. Add the Kit origin selectors to the Newton visualizer config and apply the resolved origin before pushing the camera pose to GL or RTX. Asset origins are refreshed during normal steps and on RGB capture so recorded frames follow moving assets.
Greptile SummaryThis PR adds world-, environment-, and asset-relative initial camera origins to the Newton visualizer, including dynamic asset tracking and configuration tests.
Confidence Score: 4/5The absolute camera setter can be displaced by the next asset-tracking update and should be corrected before merging. Asset tracking adds its world origin to cfg.eye and cfg.lookat even after set_camera_view has replaced those fields with absolute coordinates, causing the camera to jump after the next update. Files Needing Attention: source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py Important Files Changed
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The new origin configuration preserves existing world-mode behavior and adds environment/asset-relative camera framing, but asset tracking currently conflicts with the documented absolute camera setter and resolves to world zero during initialization or explicit reapplication. The new public origin property also needs the required units and shape documentation.
- Design and architecture: The opt-in origin model is compatible with the existing default, but
cfg.eyeandcfg.lookatare used both as origin-relative configuration and as storage for absolute values passed toset_camera_view(). Subsequent asset tracking or origin reapplication therefore offsets absolute coordinates again; the relative configured pose must be kept separate from absolute setter state. - API: The configuration fields and
reapply_origin()are additive, butreapply_origin()does not correctly resolve asset origins. The publicviewer_originproperty must also document its physical units and tensor shape in accordance with repository API documentation requirements. - Implementation: The environment-origin lookup and bounds validation are coherent. However,
_resolve_asset_origin()unconditionally returns zero, so initialization andreapply_origin()temporarily use world-relative framing, while the per-step asset update later reapplies an origin to whichever values are currently stored incfg.eyeandcfg.lookat, including absolute values written byset_camera_view().
Significant concerns. Posted 3 actionable findings inline.
Automated review; human maintainers own approval decisions.
7ddc048 to
d6845ea
Compare
Description
The Newton visualizer interprets
eyeandlookatin world coordinates only, so in a multi-environment scene the camera ignores the environment and asset origins and frames the wrong place. This adds anorigin_typetoNewtonVisualizerCfg(world,env,asset) withorigin_env_indexandorigin_track_path, mirroring how the Kit visualizer resolves its origin, and offsets the configured pose by the resolved origin.worldkeeps the current behavior,envframes a chosen environment, andassettracks an asset root or body.set_camera_view()stays an absolute setter, matching Kit andSimulationContext.set_camera_view(), so only the configured initial pose is origin-relative.Type of change
Release backport
developScreenshots
Before and after (camera framing env/asset origin instead of world) to be attached from a GPU run.
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.mdor my name already exists there