Skip to content

Add upright atomic action#302

Open
skywhite1024 wants to merge 60 commits into
mainfrom
ljd/upright_atomic_action
Open

Add upright atomic action#302
skywhite1024 wants to merge 60 commits into
mainfrom
ljd/upright_atomic_action

Conversation

@skywhite1024

@skywhite1024 skywhite1024 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add UprightAction and UprightActionCfg to atomic action exports.
  • Implement upright atomic action flow: grasp, final approach, close/hold, lift, rotate to upright object pose, place/press, release, and retreat.
  • Add scripts/tutorials/atomic_action/upright_atomic_action.py as the demo entry point.

Review Updates

  • Rebased the branch onto main.
  • Removed grasp-generator related changes from this PR:
    • no core.py candidate-grasp API changes
    • no antipodal_generator.py default/config changes
    • no n_top_grasps, n_deviated_approach_directions, or NMS changes
  • Dropped the unrelated articulation.py change; joint armature behavior remains unchanged from main.
  • Current PR diff is limited to:
    • embodichain/lab/sim/atomic_actions/__init__.py
    • embodichain/lab/sim/atomic_actions/actions.py
    • scripts/tutorials/atomic_action/upright_atomic_action.py

Validation

  • git diff --check origin/main...HEAD
  • python3 -m py_compile embodichain/lab/sim/atomic_actions/__init__.py embodichain/lab/sim/atomic_actions/actions.py scripts/tutorials/atomic_action/upright_atomic_action.py
  • conda 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

yuecideng and others added 30 commits April 12, 2026 14:58
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: 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>
yuecideng and others added 17 commits May 23, 2026 00:58
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 yuecideng requested review from matafela and yuecideng June 12, 2026 08:48
@yuecideng yuecideng changed the base branch from cj/upgrade-grasp-generator to main June 12, 2026 11:26
Comment thread embodichain/lab/sim/atomic_actions/core.py Outdated
Comment thread embodichain/lab/sim/atomic_actions/actions.py Outdated
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:

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.

Please do not modify unrelated file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dropped the unrelated Articulation change. This PR no longer modifies articulation.py.

Comment thread embodichain/toolkits/graspkit/pg_grasp/antipodal_generator.py Outdated
Comment thread embodichain/toolkits/graspkit/pg_grasp/antipodal_generator.py Outdated
@skywhite1024 skywhite1024 changed the title [codex] Add upright atomic action Add upright atomic action Jun 14, 2026
@skywhite1024 skywhite1024 force-pushed the ljd/upright_atomic_action branch from 9061744 to a12bcb2 Compare June 14, 2026 05:44
@yuecideng yuecideng marked this pull request as ready for review June 14, 2026 05:52
Copilot AI review requested due to automatic review settings June 14, 2026 05:52

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 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 / UprightActionCfg and 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.py as 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",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.