Repository navigation
Conversation
f952af4 to
e0e0deb
Compare
f747519 to
1235a13
Compare
9dfaea4 to
f38545a
Compare
[Medium impact] Adds asset preparation and pouring task features. Fix the settings comparison before merging so supported sensor-disabled and no-render runs can collect asset batches.
|
f38545a to
6de309c
Compare
60814d1 to
eaecf39
Compare
| if _declaration(getattr(current, name, None)) != _declaration( | ||
| getattr(selected, name, None) | ||
| ): | ||
| raise ValueError(f"Asset replacement cannot change environment {name}") |
There was a problem hiding this comment.
Filtered settings stop collection
_check_environment compares the running environment's filtered manager settings with a freshly loaded, unfiltered configuration. With enable_sensor=False and sensor-dependent terms, environment setup replaces those terms with None. The first replacement then raises ValueError even when it reloads the same deployment, stopping collection before any objects are replaced. No-render runs with visual terms fail the same way.
Compare equally filtered settings, or retain the original declarations for this check.
Knowledge Base Used: Gym environments and task integration
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/gym/envs/_asset_replacement.py
Line: 97-100
Comment:
**Filtered settings stop collection**
`_check_environment` compares the running environment's filtered manager settings with a freshly loaded, unfiltered configuration. With `enable_sensor=False` and sensor-dependent terms, environment setup replaces those terms with `None`. The first replacement then raises `ValueError` even when it reloads the same deployment, stopping collection before any objects are replaced. No-render runs with visual terms fail the same way.
Compare equally filtered settings, or retain the original declarations for this check.
**Knowledge Base Used:** [Gym environments and task integration](https://app.greptile.com/dexforce/-/custom-context/knowledge-base/dexforce/embodichain/-/docs/gym-environments.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Description
Prepare semantically compatible asset combinations and collect Task Program demonstrations through the existing
replace_assets_from_groupfunctor. Collection retains one B=1 environment, robot, unselected scene objects, sensors and recorder instances across asset batches. The functor jointly replaces the selected rigid bodies throughreplace_rigid_objects()and refreshes their task bindings before execution.The original
entity_cfg/folder_pathdirectory-sampling constructor and call remain supported. The new mutually exclusivedeploymentinput consumes verified artifacts produced by Provider preparation, semantic matching and explicit geometry adaptation. Provider I/O and matching happen before collection. Runtime applies each combination at a cleared batch boundary, after previous recording buffers are consumed and before new observation/recording state is seeded.Native-bound Task Program policy ports are constructed after replacement. Manager terms declaring
SceneEntityCfgselectors for replaced bodies obtain fresh bindings; unrelated terms and recorders retain their state. Independent physical objectives retain their authored criteria and bind to the replacement body. Configuration provenance refreshes without restarting session identity or recorder counters. Changes to fixed robot, backend, control/schema or unselected-object declarations are rejected before native mutation; native preparation errors stop collection.Expansion examples are consolidated under
examples/expansion/: asset catalogs, asset generalization and trajectory expansion. Primitive cube/platform and bottle/cup acceptance configurations live beside the examples, reusing SDK embodiments/policies without adding official tasks. The PourWater adapter checks profile-bound calibration, recalculates grasp/staging/return geometry and measures simultaneous tilt, mouth alignment and height, cup stability and final bottle return.Refs #810. Planned PR6 online generation remains deferred.
Stack
mainValidation
environment_constructions: 1, both episodes accepted/submitted and final shared close completed. Fluid transfer is explicitly unmeasured.black .), changed-file syntax/header/export checks, context validation/routing and public API docs coverage (2678/2678) passed.Validation uses pinned DexSim 0.5.1rc1 and Warp 1.17.0 through process-local dependency paths; no shared installation was changed. Native qualification covers rigid B=1 replacement on the Default backend. Custom consumers with hidden cached handles need explicit selectors or live UID lookup. Full native workspace/material-randomization and asynchronous camera/dataset combinations remain unqualified; recorder/provenance contracts are covered by focused CPU tests. DexSim teardown still emits the previously observed entity-balance warning. Liquid transfer, articulated replacement and heterogeneous parallel scenes remain outside scope.
A Sphinx dummy build completed; the changed asset/functor APIs emitted no diagnostics. Existing unrelated cross-reference warnings remain.
Context guidance now describes shared-environment replacement, fresh native bindings and session recording. Existing physical scene, Task Program language and motion contracts remain applicable.
Usage
See
examples/expansion/README.mdandexamples/expansion/asset_generalization/README.md.PourWater accepts
--bottle-catalogand--cup-catalog; failed acceptance exits nonzero and retains diagnostics separately from accepted trajectories.run.pyremains the direct Cube-primitive baseline.Type of change
Checklist
black .with Black 26.3.1.