Skip to content

Simplify atomic action scene context setup - #558

Merged
yuecideng merged 3 commits into
mainfrom
enhance/atomic-action-scene-context
Aug 27, 2026
Merged

Simplify atomic action scene context setup#558
yuecideng merged 3 commits into
mainfrom
enhance/atomic-action-scene-context

Conversation

@yuecideng

@yuecideng yuecideng commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

This PR simplifies direct simulation setup for atomic actions by allowing an engine to borrow a default scene provider and by adding a public create_simulation_atomic_action_engine(...) factory for explicitly selected rigid objects.

It also:

  • updates all 18 atomic-action tutorials to use the appropriate scene strategy;
  • removes redundant manually assembled scene snapshots from rigid-object and static-pose examples;
  • preserves explicit scene lifecycle handling for articulation and dynamic-recovery examples;
  • forwards tracking_policy through AtomicActionEngine.make_invocation();
  • adds engine, simulation-adapter, and tutorial-contract regression tests;
  • removes stale rearrangement task tests and agent-context declarations because that task is not currently shipped;
  • updates agent context and public API documentation.

This keeps direct examples concise while retaining scene_provider= as the advanced override for aliases, articulations, collision roles, dynamic execution, and external perception.

Dependencies: None.

Issue reference: None.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Not applicable.

Validation

  • black .
  • black --check --diff --color ./
  • python docs/scripts/check_api_docs.py — 1716/1716 exports documented
  • python -m compileall -q embodichain/lab/sim/atomic_actions scripts/tutorials/atomic_action tests/sim/atomic_actions/test_engine.py tests/sim/atomic_actions/test_sim_adapter.py tests/sim/atomic_actions/test_tutorial_utils.py
  • pytest -q tests/sim/atomic_actions — 618 passed, 1 skipped, 3 deselected
  • pytest tests/docs -q --confcutdir=tests/docs — 20 passed
  • pytest tests --ignore=tests/docs -m "not requires_sim and not gpu" -n 4 --dist loadgroup — 2574 passed, 2 skipped
  • sphinx-build -b dummy docs/source docs/build/dummy — succeeded with repository warnings
  • git diff --check

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py).
  • I have added tests that prove the change works.
  • Dependencies have been updated, if applicable (no dependency changes required).

Add an engine scene provider default and a simulation factory that registers selected rigid objects. Update atomic action tutorials, tracking-policy forwarding, tests, context, and API documentation.
@yuecideng yuecideng added enhancement New feature or request atomic action atomic action related functionality labels Aug 27, 2026
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR simplifies direct atomic-action simulation setup by allowing engines to obtain initial scene snapshots from a borrowed provider and by adding a public rigid-object factory.

  • Adds default scene-provider support to AtomicActionEngine.
  • Adds and exports create_simulation_atomic_action_engine.
  • Forwards invocation-level tracking policies.
  • Updates tutorials, documentation, and regression tests to use explicit scene strategies.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
embodichain/lab/sim/atomic_actions/engine.py Adds optional scene-provider capture to initial context creation and forwards caller-selected tracking policies into invocations.
embodichain/lab/sim/atomic_actions/sim_adapter.py Adds the public factory that builds an atomic-action engine around explicitly selected rigid objects.
embodichain/lab/sim/atomic_actions/init.py Exposes the new simulation engine factory through the package API.
tests/sim/atomic_actions/test_engine.py Covers provider capture, explicit-scene precedence, provider validation, and tracking-policy forwarding.
tests/sim/atomic_actions/test_sim_adapter.py Covers factory argument forwarding, selected UID registration, snapshot generation, and duplicate UID rejection.
tests/sim/atomic_actions/test_tutorial_utils.py Verifies that all tutorial entry points use their designated rigid, static-pose, explicit-lifecycle, or scene-free strategy.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant Factory as create_simulation_atomic_action_engine
    participant Engine as AtomicActionEngine
    participant Provider as RigidObjectSceneProvider
    participant Object as RigidObject

    Caller->>Factory: motion generator + selected scene entities
    Factory->>Provider: construct UID-keyed provider
    Factory->>Engine: construct with scene_provider
    Caller->>Engine: initial_context(timestamp, control_dt)
    Engine->>Provider: snapshot(timestamp, env_ids)
    Provider->>Object: "get_local_pose(to_matrix=True)"
    Object-->>Provider: batched pose
    Provider-->>Engine: SceneSnapshot
    Engine-->>Caller: PlanningContext
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Remove stale configured-runtime and layout expectations for the rearrangement task, which is not currently shipped. Keep the expert-program context registry aligned with the available task configurations.
…-scene-context

# Conflicts:
#	tests/gym/envs/test_official_task_layout.py
@yuecideng
yuecideng merged commit 9c9fa67 into main Aug 27, 2026
5 checks passed
@yuecideng
yuecideng deleted the enhance/atomic-action-scene-context branch August 27, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

atomic action atomic action related functionality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant