Repository navigation
Conversation
yuecideng
left a comment
There was a problem hiding this comment.
Reviewed PR #1171 at 85f25b4d869159e91154a9f2afe114a79767be72 against base f13fb1a4d3430487f98b236280699d6969958910 (11 changed files).
The overall loading architecture is coherent: parsed USD descriptors retain ownership of native geometry, physics and visuals; source paths/resource keys remain separate from runtime UIDs; a stable CableObject facade binds during prepare(); and Gym preflight shares the runtime compiler. I recommend retaining this structure.
Confirmed finding
One P2 finding is attached inline to spawn/usd_import.py:151: a valid cable/anchor UID rename is rejected as self-attachment because validation runs before attachment target remapping. Please fix this ordering before merge.
| Priority | Location | Root cause | Impact | Recommended action |
|---|---|---|---|---|
| P2 | usd_import.py:151 | Attachment validation observes a partially renamed identity graph | Valid USD imports and Gym preflight fail | Resolve final UIDs and references before validating attachment relationships |
Follow-up API recommendations, referencing Isaac Lab v3.0.0
These are follow-up design recommendations and can be split into subsequent PRs. Isaac Lab's cable support is itself experimental; the useful reference here is its separation of authoring/source configuration, runtime assets and segment state.
-
Add a single-cable USD source entry point while retaining whole-scene import. Isaac Lab's AssetBaseCfg accepts a
spawnconfiguration, including UsdFileCfg;spawn=Nonebinds an existing scene asset. For EmbodiChain, keep the existing project-widesource=UsdSourceCfg(...)vocabulary and consider extendingadd_cable_object()accordingly:# Proposed API; currently unsupported by #1171. cable = sim.add_cable_object( CableObjectCfg( uid="wire", source=UsdSourceCfg( file_path="wire.usda", source_prim_path="/World/wire", ), ) ) sim.prepare()
Make source-backed and procedural
points/radiusinputs mutually exclusive; reject ambiguous selections in the singleton route. Reuse the existing parser, override and declaration logic. Keepadd_usd(UsdImportCfg(...))for scenes containing cables, connectors, supports and constraints, and keep UID lookup for already-imported facades so each physical cable has one managed instance. -
Give sparse overrides an explicit type/schema without losing field-presence semantics. A
TypedDictor dedicated sparse configuration can improve completion and validation while preserving omitted fields, explicit zero coefficients, explicitNonecoefficients and an explicit emptyfixed_segmentslist. The current key-presence approach is valuable. Avoid treating a fullCableObjectCfgas a patch: defaults such as density 1000 and empty fixed segments can accidentally overwrite authored USD values. DocumentNonesemantics per field; the coefficient and optional contact-overlay paths have different behavior. -
Document physical units and qualify cross-tool USD compatibility. Isaac Lab's CableMaterialCfg exposes elastic moduli, while EmbodiChain's CablePhysicsCfg exposes direct per-connection coefficients:
Parameter Isaac Lab v3.0.0 EmbodiChain stretch_stiffnessElastic modulus, Pa Joint stiffness, N/m bend_stiffnessElastic modulus, Pa Angular joint stiffness, N m/rad Isaac Lab discretizes these using cross-section and joint dual rest length, e.g.
EA/LandEI/L. Copying its numerical settings directly intoattrschanges the physical meaning. Preserve the existing direct-coefficient contract and provide explicit conversions or a separately identified material parameterization if needed.There is also a concrete schema boundary: a CPU-only minimal USD constructed from the fields authored by Isaac Lab v3.0.0's material/spawner code was rejected by the installed DexSim 0.6.0rc2 parser with
NotImplementedError: ...physics:thickness: migrate to geometry thicknesses and physics:curves*Stiffness structural coefficients. This was a reconstructed field-output fixture, not an executed Isaac Lab export. A cross-tool fixture should verify radius, mass, per-connection stiffness and endpoint constraints before claiming direct asset compatibility. -
Separate source provenance, authoring intent and resolved runtime metadata.
_usd_cable_cfg()reconstructs enough geometry/configuration for the facade and Viser, butcable.cfgdoes not capture every authored visual/contact descriptor. Document its scope and retain provenance separately; do not present its serialization as a complete reconstruction recipe for the USD asset. Keep the parsed descriptor as the native asset definition. -
Keep segment-based state and make reset semantics explicit. The world-frame segment poses/velocities and XYZW convention align well with Isaac Lab's cable data model. Keep state teleport, object reset and full episode reset as distinct operations. Isaac Lab's CableObject.reset() resets internal buffers; EmbodiChain's object reset restores creation state and clears loads, while manager/Scene reset owns the episode boundary and attached physical assets. Preserve the actual backend contracts when aligning API names.
For the compiler, a clear sequence is: parse source -> merge sparse overrides -> resolve all final UIDs -> remap attachments/constraints -> validate the complete scene -> declare facades -> prepare/bind.
Validation
- Related no-simulation tests: 106 passed, 3 skipped, using Python 3.12 and DexSim 0.6.0rc2:
python -m pytest tests/sim/objects/test_cable_object.py tests/sim/spawn/test_usd_scene_overrides.py -m no_sim -q -p no:cacheprovider. - Real-USD parsing/compiler reproduction confirmed the P2 finding without creating a World.
- Independent engine, API and verification passes were completed and the finding was rechecked by the lead.
- Native CUDA simulation, a live Viser server, and Gym recording/replay execution were not run for this review; those paths received static review.
| setattr(descriptor, name, overrides[name]) | ||
| # Revalidate indices, attachments and thickness against the source | ||
| # geometry before publishing any part of this freshly parsed scene. | ||
| descriptor.__post_init__() |
There was a problem hiding this comment.
[P2] Resolve attachment targets before validating the renamed cable
A valid source cable wire attached to rigid object base fails when these overrides reuse the rigid object's original name:
asset_cfgs = {
"/World/base": {"uid": "anchor"},
"/World/wire": {"uid": "base"},
}The final UIDs are unique and the intended connection is cable base -> rigid anchor. However, _usd_cable_cfg() changes descriptor.name to base and calls CableDesc.__post_init__() while start_attachment.target still contains the old name base. The SDK raises ValueError: a cable cannot attach to itself before target remapping at lines 646-660 can run. Both add_usd() and Gym's manager-free preflight reject this valid configuration.
Reproduced with a real parsed USD under DexSim 0.6.0rc2, with the cable endpoint and rigid anchor both at world [0, 0, 0]. Renaming the cable to renamed_wire succeeds and produces renamed_wire -> anchor; changing only that UID to base causes the error.
Please validate attachment relationships after all final UIDs and attachment targets have been resolved, while retaining early validation of geometry and fixed indices. A focused no-simulation regression for this valid UID-reuse case would cover the gap.
Description
Register USD-authored cables as managed
CableObjectinstances.add_usd()returns one facade per source resource key, andget_cable_object()andget_asset()resolve the same instance by UID. The parsed DexSim descriptor supplies the native geometry, physics, and visuals. The facade carries the resolved geometry used by the Viser capsule exporter.This closes the USD entry-point gap for the reset behavior introduced in #838 and the Gym and visualization integrations in #839. This branch uses main's pinned DexSim 0.6.0rc2.
Sparse
asset_cfgsmappings keyed by the USD simulation curve prim can set the UID, fixed segments, self-collision filter span, rod stiffness/damping and Newton contact parameters before spawning. Unspecified fields and the authored centerline stay in the source descriptor. The same recipe participates in Gym preflight and creates the registered facade at runtime. #834 and #923 exercise this path.Type of change
Validation on DexSim 0.6.0rc2
Earlier validation on rc1
Checklist