Add upright atomic action#302
Open
skywhite1024 wants to merge 60 commits into
Open
Conversation
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: Jietao Chen <chenjietao@dexforce.com> Co-authored-by: Yueci Deng <dengyueci@qq.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: yuanhaonan <yuanhaonan@dexforce.top>
…entation (#247) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: chenjian <chenjian@dexforce.com> Co-authored-by: yuecideng <dengyueci@qq.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ration (#239) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Chen Jian <mtfl1996@outlook.com> Co-authored-by: chenjian <chenjian@dexforce.com> Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Yueci Deng <dengyueci@qq.com>
Co-authored-by: WaferLi <63717327+WaferLi@users.noreply.github.com> Co-authored-by: liwenfeng <liwenfeng@dexforce.top> Co-authored-by: chenjian <chenjian@dexforce.com> Co-authored-by: daojun <lookangela@qq.com> Co-authored-by: Chen Jian <mtfl1996@outlook.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: yuanhaonan <yuanhaonan@dexforce.top>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: chenjian <chenjian@dexforce.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: yuecideng <dengyueci@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: yuecideng <dengyueci@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: weiyanjun <weiyanjun@dexforce.top>
Co-authored-by: zengkehuan <zengkehuan@dexforece.com> Co-authored-by: Yueci Deng <dengyueci@qq.com>
yuecideng
requested changes
Jun 12, 2026
| drive_args["max_velocity"] = max_velocity[i].cpu().numpy() | ||
| if friction is not None: | ||
| drive_args["joint_friction"] = friction[i].cpu().numpy() | ||
| if armature is not None: |
Contributor
There was a problem hiding this comment.
Please do not modify unrelated file.
Collaborator
Author
There was a problem hiding this comment.
Dropped the unrelated Articulation change. This PR no longer modifies articulation.py.
9061744 to
a12bcb2
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “upright” atomic action to the simulator atomic-actions layer, and provides a tutorial script that demonstrates grasping a fallen object, rotating it upright, placing/pressing it onto a support surface, releasing, and retreating.
Changes:
- Added
UprightAction/UprightActionCfgand exported them via the atomic actions package. - Implemented an upright manipulation trajectory pipeline (approach → final approach/pre-close → close/hold → lift/rotate upright → place/press/hold → release → retreat).
- Added
scripts/tutorials/atomic_action/upright_atomic_action.pyas the demo entry point.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
embodichain/lab/sim/atomic_actions/__init__.py |
Exports the new upright action/config from the atomic actions package. |
embodichain/lab/sim/atomic_actions/actions.py |
Implements UprightActionCfg/UprightAction and improves hand-qpos interpolation/batching helpers used by grasp-like actions. |
scripts/tutorials/atomic_action/upright_atomic_action.py |
Adds a runnable tutorial showcasing grasp and upright action flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
398
to
402
| # Resolve grasp pose | ||
| if isinstance(target, ObjectSemantics): | ||
| is_success, grasp_xpos, open_length = self._resolve_grasp_pose(target) | ||
| is_success, grasp_xpos, _ = self._resolve_grasp_pose(target) | ||
| else: | ||
| is_success, grasp_xpos = self._resolve_pose_target( |
Comment on lines
+823
to
+827
| if not torch.all(is_success).item(): | ||
| logger.log_warning( | ||
| "Failed to resolve grasp pose, using default approach pose" | ||
| ) | ||
| return False, torch.empty(0), self.joint_ids |
Comment on lines
+681
to
+685
| original_hit_point_pairs = generator._hit_point_pairs | ||
| try: | ||
| generator._hit_point_pairs = hit_point_pairs[valid_mask] | ||
| filtered_success, filtered_grasp_xpos, filtered_open_length = ( | ||
| semantics.affordance.get_best_grasp_poses( |
Comment on lines
+670
to
+674
| (pair_axes_world * approach_direction.view(1, 1, 3)).sum(dim=-1) | ||
| ) | ||
| if max_axis_dot is not None: | ||
| valid_mask &= torch.all(pair_axis_dot <= max_axis_dot, dim=0) | ||
| valid_count = int(valid_mask.sum().item()) |
Comment on lines
+17
to
+20
| """ | ||
| This script demonstrates the creation and simulation of a robot that grasps a rigid mug | ||
| in a simulated environment using the SimulationManager and grasp planning utilities. | ||
| """ |
Comment on lines
+82
to
+88
| parser.add_argument( | ||
| "--demo_mode", | ||
| type=str, | ||
| choices=["grasp", "upright"], | ||
| default="grasp", | ||
| help="Select the tutorial scenario to run.", | ||
| ) |
Comment on lines
59
to
63
| "PickUpAction", | ||
| "PlaceAction", | ||
| "UprightAction", | ||
| "MoveActionCfg", | ||
| "PickUpActionCfg", |
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.
Summary
UprightActionandUprightActionCfgto atomic action exports.scripts/tutorials/atomic_action/upright_atomic_action.pyas the demo entry point.Review Updates
main.core.pycandidate-grasp API changesantipodal_generator.pydefault/config changesn_top_grasps,n_deviated_approach_directions, or NMS changesarticulation.pychange; jointarmaturebehavior remains unchanged frommain.embodichain/lab/sim/atomic_actions/__init__.pyembodichain/lab/sim/atomic_actions/actions.pyscripts/tutorials/atomic_action/upright_atomic_action.pyValidation
git diff --check origin/main...HEADpython3 -m py_compile embodichain/lab/sim/atomic_actions/__init__.py embodichain/lab/sim/atomic_actions/actions.py scripts/tutorials/atomic_action/upright_atomic_action.pyconda run -n embodichain040 black --check --target-version py310 embodichain/lab/sim/atomic_actions/__init__.py embodichain/lab/sim/atomic_actions/actions.py scripts/tutorials/atomic_action/upright_atomic_action.py