Skip to main content

A binding of gpg using pybind11 and CMake

Project description

Grasp Pose Generator

Grasp Pose Generator is a Python package that provides bindings for the C++ Grasp Pose Generator (GPG), enabling the creation of grasp candidates for 3D point clouds. This tool is essential for robotic manipulation tasks, allowing robots to determine feasible grasping positions on objects represented by point clouds.

Features

  • Generate 6-DOF grasp poses for 2-finger grippers.
  • Evaluate grasp candidates for antipodal properties using geometric conditions.
  • Seamless integration with Python for easy incorporation into robotic pipelines.

Installation

To install the grasp_pose-generator package, use pip:

pip install grasp-pose-generator

Build

To build the grasp-pose-generator package from source, follow these steps:

Steps

  1. Install Vcpkg and configure it on your system.

  2. Clone the Pybind11 repository into a dependencies directory in your project root:

    mkdir dependencies
    cd dependencies
    git clone https://github.com/pybind/pybind11.git
    
  3. Install the package:

    pip install .
    

This process will compile the C++ code using the Vcpkg dependencies and the Pybind11 bindings.

Usage

Here's a basic example demonstrating how to generate grasp poses for a given point cloud:

import numpy as np
import grasp_pose_generator as gpg

# Generate a random point cloud (replace with your actual point cloud data)
points = np.random.rand(3000, 3)  # n x 3 numpy array

# Parameters
num_samples = 10000
show_grasp = False
gripper_config_file = "path/to/gripper_params.cfg"  # Replace with the path to your gripper configuration file

# Generate grasps
grasps = gpg.generate_grasps(points, num_samples, show_grasp, gripper_config_file)

# Convert grasps to transformation matrices
pose_list = []
for grasp in grasps:
    pose = np.eye(4)
    pose[:3, 0] = grasp.get_grasp_approach()
    pose[:3, 1] = grasp.get_grasp_binormal()
    pose[:3, 2] = grasp.get_grasp_axis()
    pose[:3, 3] = grasp.get_grasp_bottom()
    pose_list.append(pose)

Ensure that you have a valid gripper configuration file. An example configuration file can be found in the gripper_params.cfg.

Example with a Simple Box

To visualize grasp generation on a simple box, you can run the provided example script:

python example/example.py

Press R during the visualization to see the generated grasp poses.

License

This project is licensed under the MIT License.

Acknowledgments

This package is an improved and extended version of the original pyGPG by Hongzhuo Liang. The core grasp generation functionality is based on the Grasp Pose Generator (GPG) by Andreas ten Pas.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grasp_pose_generator-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

grasp_pose_generator-1.0.0-cp312-cp312-win_amd64.whl (22.7 MB view details)

Uploaded CPython 3.12Windows x86-64

grasp_pose_generator-1.0.0-cp311-cp311-win_amd64.whl (25.0 MB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file grasp_pose_generator-1.0.0.tar.gz.

File metadata

  • Download URL: grasp_pose_generator-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for grasp_pose_generator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c99b94af9223383eba431d3c4a8211737ae64f35afa10f2bde8ff367eefd3954
MD5 020275854526b1851c84b607574bcbe9
BLAKE2b-256 e215d6917158b4f504d8cf97ac58a8d66b9383ceba971fb653caf0c3344f06be

See more details on using hashes here.

File details

Details for the file grasp_pose_generator-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for grasp_pose_generator-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 267e53cb5eb62231a22770bf32af835870a951dce3b7952372475a9ce2d36f50
MD5 0103d7ace9bac3f0d0490acbec164ed8
BLAKE2b-256 c18355667dc1a89665b049a9c1f5c1c4fcfe1d26e7d7aa714d1aab00c1cc9ebd

See more details on using hashes here.

File details

Details for the file grasp_pose_generator-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for grasp_pose_generator-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6064f2eea4ffa6c0b218427dac96eea92eb4eeac8627389e6adcfbc62e88cf2e
MD5 907ddf77f9eebf4bde7c52f693633297
BLAKE2b-256 7a5ae170c8a0bf92ada3b6ee879d032180b423a797d2833c0692e341deeb07f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page