Uh oh!
There was an error while loading. Please reload this page.
feat(atomic-actions): improve upright grasp selection - #542
feat(atomic-actions): improve upright grasp selection#542skywhite1024 wants to merge 30 commits into
Conversation
…mic-prerequisite # Conflicts: # agent_context/MAP.yaml # agent_context/topics/atomic-actions/atomic-actions.md # docs/design/declarative_expert_program_plan.md # docs/design/expert_program_rollout_report.md # docs/design/gen_sim_semantic_skill_integration_plan.md # docs/source/api_reference/embodichain/embodichain.lab.gym.envs.expert_program.rst # docs/source/api_reference/embodichain/embodichain.lab.sim.atomic_actions.rst # docs/source/api_reference/embodichain/embodichain.lab.sim.skills.rst # docs/source/api_reference/public_api.rst # docs/source/overview/sim/atomic_actions/builtin_actions.md # docs/source/overview/sim/atomic_actions/expert_programs.md # docs/source/overview/sim/atomic_actions/index.md # docs/source/overview/sim/atomic_actions/robot_skill_profiles.md # docs/source/overview/sim/index.rst # docs/source/overview/sim/scene_registry.md # docs/source/tutorial/atomic_actions.rst # embodichain/agents/mllm/expert_program.py # embodichain/lab/gym/envs/__init__.py # embodichain/lab/gym/envs/demo.py # embodichain/lab/gym/envs/embodied_env.py # embodichain/lab/gym/envs/expert_program/__init__.py # embodichain/lab/gym/envs/expert_program/bridge.py # embodichain/lab/gym/envs/expert_program/catalog.py # embodichain/lab/gym/envs/expert_program/cfg.py # embodichain/lab/gym/envs/expert_program/compiler.py # embodichain/lab/gym/envs/expert_program/decoder.py # embodichain/lab/gym/envs/expert_program/environment.py # embodichain/lab/gym/envs/expert_program/extensions.py # embodichain/lab/gym/envs/expert_program/loader.py # embodichain/lab/gym/envs/expert_program/simulation.py # embodichain/lab/gym/envs/expert_program/simulation_environment.py # embodichain/lab/gym/envs/expert_program/simulation_handover.py # embodichain/lab/gym/envs/expert_program/simulation_policies.py # embodichain/lab/gym/envs/managers/_event_functors/dynamic_settling.py # embodichain/lab/gym/utils/gym_utils.py # embodichain/lab/sim/atomic_actions/__init__.py # embodichain/lab/sim/atomic_actions/affordance.py # embodichain/lab/sim/atomic_actions/bindings.py # embodichain/lab/sim/atomic_actions/core.py # embodichain/lab/sim/atomic_actions/engine.py # embodichain/lab/sim/atomic_actions/execution.py # embodichain/lab/sim/atomic_actions/goals.py # embodichain/lab/sim/atomic_actions/invocation.py # embodichain/lab/sim/atomic_actions/plans.py # embodichain/lab/sim/atomic_actions/primitives/_helpers.py # embodichain/lab/sim/atomic_actions/primitives/coordinated_pickment.py # embodichain/lab/sim/atomic_actions/primitives/coordinated_placement.py # embodichain/lab/sim/atomic_actions/primitives/hand_over.py # embodichain/lab/sim/atomic_actions/primitives/pick_up.py # embodichain/lab/sim/atomic_actions/primitives/place.py # embodichain/lab/sim/atomic_actions/runtime.py # embodichain/lab/sim/atomic_actions/state.py # embodichain/lab/sim/planners/base_planner.py # embodichain/lab/sim/planners/curobo/curobo_planner.py # embodichain/lab/sim/skills/__init__.py # embodichain/lab/sim/skills/calls.py # embodichain/lab/sim/skills/compiler.py # embodichain/lab/sim/skills/integration.py # embodichain/lab/sim/skills/profiles.py # embodichain/lab/sim/skills/runtime.py # embodichain/lab/sim/skills/scene.py # embodichain/toolkits/graspkit/pg_grasp/_antipodal_backend.py # embodichain_tasks/configs/gym/expert_program/repeated_pick_place.json # embodichain_tasks/configs/gym/open_drawer/cobot_magic_3cam.json # embodichain_tasks/embodichain_tasks/multi_segments/cube_pick_place.py # embodichain_tasks/embodichain_tasks/tableware/__init__.py # embodichain_tasks/embodichain_tasks/tableware/open_drawer.py # scripts/benchmark/expert_program/demo_success.py # scripts/tools/expert_program_rollout_report.py # tests/agents/mllm/test_expert_program.py # tests/benchmark/expert_program/test_cube_physical_recovery_sim.py # tests/benchmark/expert_program/test_demo_success_cube_sim.py # tests/benchmark/expert_program/test_demo_success_open_drawer_sim.py # tests/gym/envs/expert_program/test_bridge.py # tests/gym/envs/expert_program/test_catalog.py # tests/gym/envs/expert_program/test_compiler.py # tests/gym/envs/expert_program/test_completion_metadata.py # tests/gym/envs/expert_program/test_decoder.py # tests/gym/envs/expert_program/test_environment.py # tests/gym/envs/expert_program/test_extensions.py # tests/gym/envs/expert_program/test_loader.py # tests/gym/envs/expert_program/test_parallel_compiler.py # tests/gym/envs/expert_program/test_parallel_schema.py # tests/gym/envs/expert_program/test_simulation.py # tests/gym/envs/expert_program/test_simulation_environment.py # tests/gym/envs/expert_program/test_simulation_policies.py # tests/gym/envs/expert_program/test_task_vertical_slices.py # tests/gym/envs/tasks/test_multi_segments_cube_pick_place.py # tests/gym/envs/test_demo.py # tests/gym/envs/test_embodied_env_expert_program.py # tests/gym/utils/test_gym_utils.py # tests/lab/scripts/test_run_env.py # tests/scripts/tools/test_expert_program_rollout_report.py # tests/sim/atomic_actions/test_actions.py # tests/sim/atomic_actions/test_affordance.py # tests/sim/atomic_actions/test_core.py # tests/sim/atomic_actions/test_engine_per_env.py # tests/sim/skills/test_compiler.py # tests/sim/skills/test_curobo_semantic_runtime_dynamic_recovery_gpu.py # tests/sim/skills/test_effects.py # tests/sim/skills/test_evidence.py # tests/sim/skills/test_integration.py # tests/sim/skills/test_profiles.py # tests/sim/skills/test_runtime.py # tests/test_expert_program_package_data.py
Greptile SummaryThe PR adds object-aware upright grasp reranking, rejects top/bottom clamp poses, and samples yaw-equivalent downstream targets during feasibility checks.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking need to document the newly exposed action option and grasp-generator callback. The changed grasp-ranking and downstream feasibility paths are internally consistent, while the remaining accepted concern is limited to missing user-facing documentation for public API additions. Files Needing Attention: embodichain/toolkits/graspkit/pose_generator.py; embodichain/lab/sim/atomic_actions/primitives/pick_up.py
|
| Filename | Overview |
|---|---|
| embodichain/lab/sim/atomic_actions/primitives/pick_up.py | Adds upright side-grasp ranking, compatibility filtering, normalized upright directions, and yaw-equivalent downstream feasibility checks. |
| embodichain/toolkits/graspkit/pg_grasp/_antipodal_backend.py | Applies an optional validated cost callback before limiting collision-free grasps to the top candidates. |
| embodichain/toolkits/graspkit/pg_grasp/pose_generator.py | Forwards object-aware pose-cost callbacks from the batched generator to each backend invocation. |
| embodichain/toolkits/graspkit/pose_generator.py | Expands the public abstract grasp-generator interface, but the public documentation was not updated for implementors. |
| tests/sim/atomic_actions/test_actions.py | Updates the test generator stub to support object-aware pose-cost callbacks. |
| tests/sim/atomic_actions/test_primitives_helpers.py | Tests yaw-variant translation preservation and positive sample-count validation. |
| tests/toolkits/test_parallel_jaw_grasp_pose_generator.py | Verifies that object-aware costs are applied and returned by the antipodal generator. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Antipodal grasp candidates] --> B[Collision filtering and base costs]
B --> C[Object-aware upright cost callback]
C --> D[Top-k candidate truncation]
D --> E[Pickup path IK checks]
E --> F[Yaw-variant downstream IK checks]
F --> G[Selected feasible grasp]
Prompt To Fix All With AI
### Issue 1
embodichain/toolkits/graspkit/pose_generator.py:128-130
**Document the expanded public APIs**
The public `GraspPoseGenerator` interface now accepts `pose_cost_fn`, and `PickUpOptions` also exposes `upright_yaw_samples`, but the user-facing documentation does not describe either addition. This leaves callers unable to discover the new configuration and gives custom generator implementors no migration guidance for the expanded interface.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Merge branch 'feat/cube-physical-recover..." | Re-trigger Greptile
| pose_cost_fn: ( | ||
| Callable[[torch.Tensor, torch.Tensor, torch.Tensor], torch.Tensor] | None | ||
| ) = None, |
There was a problem hiding this comment.
Document the expanded public APIs
The public GraspPoseGenerator interface now accepts pose_cost_fn, and PickUpOptions also exposes upright_yaw_samples, but the user-facing documentation does not describe either addition. This leaves callers unable to discover the new configuration and gives custom generator implementors no migration guidance for the expanded interface.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/toolkits/graspkit/pose_generator.py
Line: 128-130
Comment:
**Document the expanded public APIs**
The public `GraspPoseGenerator` interface now accepts `pose_cost_fn`, and `PickUpOptions` also exposes `upright_yaw_samples`, but the user-facing documentation does not describe either addition. This leaves callers unable to discover the new configuration and gives custom generator implementors no migration guidance for the expanded interface.
**Context Used:** AGENTS.md ([source](https://github.com/dexforce/embodichain/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Replacement
Supersedes #540. The code is unchanged; this PR moves the head branch from the temporary
codex/namespace toljd/gen-sim-atomic-prerequisite.Stack
feat/cube-physical-recovery-gatesDescription
This PR extracts the reusable Atomic Action prerequisite from GenSim PR #538. It adds object-aware upright grasp ranking before GraspKit top-k truncation, rejects top/bottom clamp poses for upright transport, and checks yaw-equivalent downstream targets without persisting grounded poses in task artifacts.
Dependencies: none. This should land before the rewritten GenSim semantic task-planning stack (#533-#538).
Refs #538
Type of change
Validation
black ./python docs/scripts/check_api_docs.pypytest tests/docs/test_check_api_docs.py -q --confcutdir=tests/docspytest tests/sim/atomic_actions/test_affordance.py tests/sim/atomic_actions/test_primitives_helpers.py tests/sim/atomic_actions/test_actions.py tests/toolkits/test_grasp_pose_generator.py -q --disable-warnings --maxfail=1(120 passed, 1 deselected)Checklist