-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Backport release/3.0.0] Newton startup, cloner, and rendering fixes #7299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
74532cf
ba5c2af
55379f8
c780f65
3ad2892
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Docstring-only clarification of the shape-expression convention; behaviour change lives in isaaclab_newton. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added :attr:`~isaaclab.cloner.ClonePlan.global_paths` to identify scene assets shared by every environment | ||
| without representing them as replication rows. | ||
|
|
||
| Changed | ||
| ^^^^^^^ | ||
|
|
||
| * Changed :func:`~isaaclab.cloner.make_clone_plan`, :func:`~isaaclab.cloner.clone_plan_from_env_0`, and | ||
| :class:`~isaaclab.cloner.ReplicateSession` to accept explicit ``global_paths`` tuples. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Fixed camera depth display normalization producing ``NaN`` values and suppressing finite depth contrast when | ||
| no-hit pixels contain ``inf`` or ``NaN`` values. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,8 @@ def replicate(plan: ClonePlan, *, stage: Usd.Stage, replicate_physics: bool = Tr | |
|
|
||
| Cfgs absent from ``plan.cfg_rows`` are silently skipped. Backend contexts run in | ||
| ascending ``replicate_priority`` order. The queue is cleared up front, so a backend | ||
| failure cannot leak stale entries into the next call. | ||
| failure cannot leak stale entries into the next call. Every context receives the plan's | ||
| explicitly declared shared assets when it is constructed. | ||
|
|
||
| Args: | ||
| plan: Replication layout to dispatch. | ||
|
|
@@ -72,7 +73,7 @@ def replicate(plan: ClonePlan, *, stage: Usd.Stage, replicate_physics: bool = Tr | |
| REPLICATION_QUEUE.clear() | ||
|
|
||
| backend_package = FactoryBase._get_package_name(FactoryBase._get_backend()) | ||
| backend_physics_ctx = getattr(importlib.import_module(f"{backend_package}.cloner"), "PHYSICS_CONTEXT", None) | ||
| backend_physics_ctx = importlib.import_module(f"{backend_package}.cloner").PHYSICS_CONTEXT | ||
|
|
||
| # Group queued cfgs by backend, taking the union of row indices each backend owns. | ||
| # In the homogeneous plan every cfg maps to row 0, so multiple queue_replication | ||
|
|
@@ -85,20 +86,20 @@ def replicate(plan: ClonePlan, *, stage: Usd.Stage, replicate_physics: bool = Tr | |
| if rows is None: | ||
| continue | ||
| if cfg.cloning_contexts is None: | ||
| contexts = [backend_physics_ctx] if backend_physics_ctx else [] | ||
| contexts = [backend_physics_ctx] | ||
| else: | ||
| contexts = [string_to_callable(c) if isinstance(c, str) else c for c in cfg.cloning_contexts] | ||
| if not replicate_physics: | ||
| contexts = [c for c in contexts if c is UsdReplicateContext] | ||
| ctx_set = dict.fromkeys(contexts) | ||
| if getattr(cfg, "spawn", None) is not None and kit_available: | ||
| if cfg.spawn is not None and kit_available: | ||
| ctx_set.setdefault(UsdReplicateContext, None) | ||
| for BackendCtxCls in ctx_set: | ||
| backend_rows.setdefault(BackendCtxCls, set()).update(rows) | ||
|
|
||
| backend_ctxs: dict[type, Any] = {} | ||
| for BackendCtxCls, row_set in backend_rows.items(): | ||
| ctx = BackendCtxCls(stage) | ||
| ctx = BackendCtxCls(stage, global_paths=plan.global_paths) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning · Api — Replication-context protocol tightened without migration note Contexts are now constructed as |
||
| backend_ctxs[BackendCtxCls] = ctx | ||
| row_list = sorted(row_set) | ||
| ctx.queue_mapping( | ||
|
|
@@ -109,7 +110,7 @@ def replicate(plan: ClonePlan, *, stage: Usd.Stage, replicate_physics: bool = Tr | |
| positions=plan.positions, | ||
| ) | ||
|
|
||
| for ctx in sorted(backend_ctxs.values(), key=lambda c: getattr(c, "replicate_priority", 0)): | ||
| for ctx in sorted(backend_ctxs.values(), key=lambda ctx: ctx.replicate_priority): | ||
| ctx.replicate() | ||
|
|
||
| SimulationContext.instance().set_clone_plan(plan) | ||
|
|
@@ -139,6 +140,7 @@ def __init__( | |
| device: str, | ||
| *, | ||
| stage: Usd.Stage, | ||
| global_paths: tuple[str, ...] = (), | ||
| clone_strategy: Callable = sequential, | ||
| valid_set: torch.Tensor | None = None, | ||
| replicate_physics: bool = True, | ||
|
|
@@ -152,6 +154,7 @@ def __init__( | |
| env_spacing: Grid spacing between env origins [m]. | ||
| device: Torch device for plan tensors. | ||
| stage: USD stage to author replicated prim specs into. | ||
| global_paths: Complete shared-asset roots declared by the composition root. Defaults to none. | ||
| clone_strategy: Prototype-to-env assignment function. | ||
| valid_set: Optional ``[num_combos, num_groups]`` long tensor of valid | ||
| prototype combinations; ``None`` uses the full cartesian product. | ||
|
|
@@ -166,6 +169,7 @@ def __init__( | |
| num_clones=num_clones, | ||
| env_spacing=env_spacing, | ||
| device=device, | ||
| global_paths=global_paths, | ||
| clone_strategy=clone_strategy, | ||
| valid_set=valid_set, | ||
| env_template=env_template, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Warning · Api — make_clone_plan crashes on previously skipped cfgs
The guard that skipped cfgs without
prim_path/spawnor outside the env root was removed. A global cfg now yieldsmatched=Noneand line 281 raises a bareAttributeError; a spawn-less cfg fails oncfg.spawn.make_clone_plan/ReplicateSessionare documented for scenes assembled outsideInteractiveScene, where such cfgs were previously tolerated. Raise a descriptive error naming the offending path and record the narrowed input contract with migration guidance in the changelog fragment.