Skip to content

Comments

Implement shape-aware grip point computation for object manipulation#24

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-60357d46-d4b5-489e-919b-fa951a1c935e
Draft

Implement shape-aware grip point computation for object manipulation#24
Copilot wants to merge 3 commits intomainfrom
copilot/fix-60357d46-d4b5-489e-919b-fa951a1c935e

Conversation

Copy link

Copilot AI commented Sep 26, 2025

Problem

The current implementation in reach_for_object() uses hardcoded grip point offsets like {0.1, 0.1, 0.1} and {-0.1, -0.1, 0.1} for all objects, regardless of their shape or size. This approach is suboptimal because:

  • A thin book requires different grip strategies than a sphere
  • Small objects may not accommodate standard grip offsets
  • Large objects could benefit from multiple approach angles
  • The existing vision system already provides shape information (BOX, SPHERE, CYLINDER) that wasn't being utilized

Solution

This PR implements intelligent grip point computation that adapts to object geometry:

Box Objects

Generates 3-7 grip points based on dimensions:

  • Top approach (highest priority for pick-up operations)
  • Side approaches when object dimensions exceed minimum grip size (4cm)
  • Angled approaches for flat objects like books

Sphere Objects

Creates 5-13 grip points with circular patterns:

  • Top approach with highest priority
  • Equatorial ring of 8 approach points at 45° intervals
  • Additional angled approaches for small spheres (<5cm radius)

Safety Constraints

  • 8cm safe approach distance from object surface
  • 4cm minimum grip size requirement to ensure gripper accessibility
  • Gripper constraint validation before adding side approaches

Implementation Details

The solution adds three new methods to CrackleManipulation:

std::vector<Vector3> compute_grip_points_for_box(const std::vector<double>& dimensions, const geometry_msgs::msg::Pose& object_pose);
std::vector<Vector3> compute_grip_points_for_sphere(double radius, const geometry_msgs::msg::Pose& object_pose);
std::vector<Vector3> compute_shape_aware_grip_points(const moveit_msgs::msg::CollisionObject& obj);

The reach_for_object() function now calls compute_shape_aware_grip_points() instead of using hardcoded offsets, with graceful fallback to default points for unknown shapes.

Testing

Comprehensive testing shows the system generates optimal grip points:

  • Standard box (10×10×5cm): 5 points (top + 4 sides)
  • Thin book (20×15×2cm): 7 points (includes angled approaches)
  • Small box (3×3×3cm): 3 points (respects gripper constraints)
  • Ball (6cm radius): 9 points (top + equatorial pattern)
  • Small ball (3cm radius): 13 points (additional angled approaches)

Backward Compatibility

No breaking changes - maintains existing reach_for_object() interface
Preserves all logging and ROS service functionality
Graceful fallback for invalid/unknown shapes uses original default behavior
Same workflow - planning and execution logic unchanged

The implementation seamlessly integrates with the existing vision system that already provides shape detection through SolidPrimitive types and dimensional information.

Original prompt

This section details on the original issue you should resolve

<issue_title>Compute Grip Points for objects by their shape in Crackle moveit/moveit_manipulation.cpp</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #23

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 26, 2025 07:00
Co-authored-by: Tanyk2004 <29299359+Tanyk2004@users.noreply.github.com>
Co-authored-by: Tanyk2004 <29299359+Tanyk2004@users.noreply.github.com>
Copilot AI changed the title [WIP] Compute Grip Points for objects by their shape in Crackle moveit/moveit_manipulation.cpp Implement shape-aware grip point computation for object manipulation Sep 26, 2025
Copilot AI requested a review from Tanyk2004 September 26, 2025 07:05
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.

Compute Grip Points for objects by their shape in Crackle moveit/moveit_manipulation.cpp

2 participants