Refactor atomic actions into primitives package#346
Open
yuecideng wants to merge 1 commit into
Open
Conversation
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.
Contributor
There was a problem hiding this comment.
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 aprimitivespackage export surface. - Converted
atomic_actions/actions.pyinto a backward-compatible re-export facade and updatedatomic_actions/__init__.pyto import fromprimitives. - Extended Sphinx API reference and tutorial/overview docs (plus the
add-atomic-actionskill) 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, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the built-in atomic action implementations into a dedicated
embodichain.lab.sim.atomic_actions.primitivessubpackage while preserving existing public imports.Summary:
atomic_actions/primitives/.embodichain.lab.sim.atomic_actionsas the recommended public API andatomic_actions.actionsas a backward-compatible re-export facade.add-atomic-actionskill to point future built-ins at the new layout.Dependencies: None.
Fixes: N/A
Type of change
Screenshots
N/A
Verification
black .black --check --diff --color ./git diff --checkpython -m compileall -q embodichain/lab/sim/atomic_actionspytest 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)--headless --auto_play --device cpuChecklist
black .command to format the code base.