Fix graph camera setup for DROID scenes#910
Conversation
Add reviewed camera profiles to environment graph specs so agentic DROID scenes can request the exterior RGB-D camera explicitly. Route that profile through graph generation, YAML loading, and direct graph builds, and fail closed when cameras are disabled. Share CAP Maple/DROID staging and local asset routing between the registered Maple environment and graph-YAML builds so generated graph specs can run directly without mutating shared registered asset classes. Signed-off-by: Lionel Gulich <lgulich@nvidia.com>
Greptile SummaryThis PR adds graph-driven camera setup for DROID scenes. The main changes are:
Confidence Score: 4/5The changed graph local-asset path needs a fix before merging.
isaaclab_arena_environments/cap_asset_overrides.py Important Files Changed
Reviews (1): Last reviewed commit: "Fix graph camera setup for DROID scenes" | Re-trigger Greptile |
| if local_asset_root is not None: | ||
| source_url = getattr(routed_cls, "usd_path", None) | ||
| if source_url: | ||
| routed_cls, _, _ = local_asset_subclass(routed_cls, local_asset_root) |
There was a problem hiding this comment.
Local Mirror Overroutes Assets
When CAP_LOCAL_ASSET_ROOT is set, this branch localizes every graph asset class with a usd_path, while the guard only checks that the embodiment is DROID. A DROID graph that includes normal robolab or YCB objects can then look for those object USDs inside the CAP baked mirror and fail with FileNotFoundError, even though the local closure is documented for the Maple table and DROID scene assets.
| @classmethod | ||
| def apply(cls, embodiment): | ||
| from isaaclab_arena.variations.camera_extrinsics_variation import CameraExtrinsicsVariation | ||
| from isaaclab_arena_environments.maple_cameras import MapleDroidPerceptionCameraCfg |
There was a problem hiding this comment.
🟡 Core embodiment depends on an extension package
This profile lives in core (isaaclab_arena/embodiments/droid/) but pulls MapleDroidPerceptionCameraCfg from the isaaclab_arena_environments extension, and it's really Maple/GaP-specific (see the name and docstring). Deferring the import keeps import-time clean, but conceptually core now depends on an extension. Could the concrete profile live in isaaclab_arena_environments next to maple_cameras, leaving only the generic CameraProfileBase/registry in core?
| **embodiment_params | ||
| ) | ||
| embodiment = asset_registry.get_asset_by_name(embodiment_spec.registry_name)(**embodiment_params) | ||
| camera_profile = getattr(embodiment_spec, "camera_profile", None) |
There was a problem hiding this comment.
🔵 getattr for a declared field
graph_spec.embodiment is now typed EmbodimentSpec, which always declares camera_profile (default None), so the name is known and the fallback can't fire — direct access is clearer.
| camera_profile = getattr(embodiment_spec, "camera_profile", None) | |
| camera_profile = embodiment_spec.camera_profile |
| return f"{{ENV_REGEX_NS}}/{registry_name}/{prim_path.lstrip('/')}" | ||
|
|
||
|
|
||
| def _object_reference_classes() -> tuple[Any, Any]: |
There was a problem hiding this comment.
🔵 Simpler deferred import
The module-level ObjectReference = None globals plus _object_reference_classes() re-implement caching that Python's import system already does, and the inner if ... is None checks are redundant right after the import. A plain deferred from ... import ... inside _instantiate_assets_from_spec (hoisted above the for ref loop) would keep the sim-deferred behavior with less machinery. Is the global caching needed for anything?
🤖 Isaac Lab-Arena Review BotSummaryThis PR gives graph/DROID scenes an explicit, reviewed camera setup by adding a Design, Boundaries & ScopeThe generic camera-profile mechanism (base class + registry) sitting in core is fine — that's a reusable primitive. But the one concrete profile, Findings🟡 Warning: camera_profile_library.py:23 — Core DROID embodiment references a Maple/GaP-specific camera cfg from the Test CoverageGood coverage: registry apply/compat, spec validation (accept/reject/unknown profile), catalogue rendering, system-prompt guidance, CLI flag parsing, the shared CAP override routing (staging/local, non-DROID rejection, temporary registry restoration), and a sim test asserting the installed exterior RGB-D camera dimensions/data types. Sim tests follow the inner/outer VerdictMinor fixes needed |
Summary
Fix graph camera setup for DROID graph specs
Detailed description
pre-commit run --all-filesand focused graph/camera/asset tests: 53 passed, 3 skipped.