Skip to content

Refactor atomic actions into primitives package#346

Open
yuecideng wants to merge 1 commit into
mainfrom
enhance/atomic-action-primitives
Open

Refactor atomic actions into primitives package#346
yuecideng wants to merge 1 commit into
mainfrom
enhance/atomic-action-primitives

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR refactors the built-in atomic action implementations into a dedicated embodichain.lab.sim.atomic_actions.primitives subpackage while preserving existing public imports.

Summary:

  • Moves each built-in atomic action implementation into one primitive module under atomic_actions/primitives/.
  • Keeps embodichain.lab.sim.atomic_actions as the recommended public API and atomic_actions.actions as a backward-compatible re-export facade.
  • Adds API reference coverage for the new primitives subpackage.
  • Updates the atomic actions tutorial, overview docs, and add-atomic-action skill to point future built-ins at the new layout.

Dependencies: None.

Fixes: N/A

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

N/A

Verification

  • black .
  • black --check --diff --color ./
  • git diff --check
  • python -m compileall -q embodichain/lab/sim/atomic_actions
  • pytest tests/sim/atomic_actions -q (93 passed)
  • python -m sphinx -b html docs/source /tmp/embodichain-docs-atomic-actions (succeeded with existing project-wide warnings)
  • All five atomic action tutorials were smoke-tested earlier with --headless --auto_play --device cpu

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

Move built-in atomic action implementations into atomic_actions.primitives while preserving existing package-level and actions.py imports. Update tutorial, API reference, overview docs, and the add-atomic-action skill to reflect the new layout.
Copilot AI review requested due to automatic review settings July 1, 2026 11:16
@yuecideng yuecideng added enhancement New feature or request docs Improvements or additions to documentation refactor atomic action atomic action related functionality labels Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes EmbodiChain’s built-in atomic action implementations into a dedicated embodichain.lab.sim.atomic_actions.primitives subpackage while keeping existing public and legacy import paths working, and updates the docs/skill guidance accordingly.

Changes:

  • Split each built-in atomic action into its own module under atomic_actions/primitives/ and added a primitives package export surface.
  • Converted atomic_actions/actions.py into a backward-compatible re-export facade and updated atomic_actions/__init__.py to import from primitives.
  • Extended Sphinx API reference and tutorial/overview docs (plus the add-atomic-action skill) to reflect the new layout.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
embodichain/lab/sim/atomic_actions/primitives/place.py New Place primitive module.
embodichain/lab/sim/atomic_actions/primitives/pick_up.py New PickUp primitive module (grasp planning + held-object state).
embodichain/lab/sim/atomic_actions/primitives/move_joints.py New MoveJoints primitive module (joint-space planning).
embodichain/lab/sim/atomic_actions/primitives/move_held_object.py New MoveHeldObject primitive module (object-pose target while holding).
embodichain/lab/sim/atomic_actions/primitives/move_end_effector.py New MoveEndEffector primitive module (EEF pose planning).
embodichain/lab/sim/atomic_actions/primitives/_helpers.py Shared internal helpers extracted for primitives.
embodichain/lab/sim/atomic_actions/primitives/init.py New primitives package exports.
embodichain/lab/sim/atomic_actions/actions.py Replaced concrete implementations with compatibility re-exports.
embodichain/lab/sim/atomic_actions/init.py Public API now imports built-ins from primitives.
docs/source/tutorial/atomic_actions.rst Tutorial updated to describe new primitives layout and export steps.
docs/source/overview/sim/atomic_actions/index.md Overview updated to mention primitives and legacy facade.
docs/source/api_reference/embodichain/embodichain.lab.sim.atomic_actions.rst API reference updated with layout notes + hidden toctree to primitives.
docs/source/api_reference/embodichain/embodichain.lab.sim.atomic_actions.primitives.rst New API reference page documenting primitive modules.
.agents/skills/add-atomic-action/SKILL.md Skill guidance updated to scaffold built-ins under primitives/ and docs paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

third_phase_name="back",
)

lift_offset = torch.tensor([0, 0, 1], device=self.device) * self.cfg.lift_height
Comment on lines +158 to +161
lift_xpos = self.builder.apply_local_offset(
grasp_xpos,
torch.tensor([0, 0, 1], device=self.device) * self.cfg.lift_height,
)
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 docs Improvements or additions to documentation enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants