Remove hardcoded camera prim paths from OVRTX renderer#4843
Conversation
source/isaaclab_tasks/isaaclab_tasks/direct/cartpole/cartpole_camera_presets_env_cfg.py
Outdated
Show resolved
Hide resolved
Greptile SummaryThis PR removes hardcoded
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant S as Simulation
participant R as OVRTXRenderer
participant USD as ovrtx_usd
participant SV as sensor._view
S->>R: prepare_stage(stage, num_envs)
R->>USD: create_cloning_attributes(stage, num_envs, use_cloning)
Note over USD: Discovers cameras via UsdGeom.Camera type,<br/>no longer relies on hardcoded "Camera" name
USD-->>R: total_objects count
R->>USD: export_stage_for_ovrtx(stage, path, num_envs)
R->>R: store _exported_usd_path
S->>R: initialize(sensor)
R->>SV: prims[0].GetPath().pathString
SV-->>R: first_cam_path (e.g. /World/envs/env_0/Robot/ee_link/Camera)
R->>R: _camera_rel_path = "Robot/ee_link/Camera"
R->>USD: inject_cameras_into_usd(..., camera_rel_path)
Note over USD: Builds camera_paths using dynamic rel_path<br/>instead of hardcoded "Camera"
USD-->>R: (combined_usd_path, render_product_path)
R->>R: _update_scene_partitions_after_clone<br/>(uses _camera_rel_path)
R->>R: camera_paths = [/World/envs/env_i/{_camera_rel_path}]
R->>R: bind_attribute(camera_paths, "omni:xform")
R->>R: _setup_object_bindings<br/>(filters via _camera_rel_path substring)
Last reviewed commit: ffac2e9 |
ooctipus
left a comment
There was a problem hiding this comment.
its already a lot less hardcoded than before, : D Maybe you can let user pass in /World/envs/env_.* as default argument if user doesn't have any other prefix preference. that will somewhat address the hardcoding concern.
Derive the camera prim path from the sensor's resolved view prims instead of assuming it is always "Camera". This fixes scenes where the camera lives at a non-default path (e.g. Robot/ee_link/palm_link/Camera). - Extract camera relative path from sensor._view at initialization - Use it for camera bindings, scene partitions, object binding filter, and USD camera injection - Discover cameras by USD type (UsdGeom.Camera) in create_cloning_attributes instead of matching on the "Camera" string
ffac2e9 to
04ec48b
Compare
Remove hardcoded camera prim paths from OVRTX renderer
Derive the camera prim path from the sensor's resolved view prims
instead of assuming it is always "Camera". This fixes scenes where the
camera lives at a non-default path (e.g. Robot/ee_link/palm_link/Camera).
and USD camera injection
instead of matching on the "Camera" string