junchengli1 / Sim-Suction-API

Sim-Suction-API offers a simulation framework to generate synthetic data and train models for robotic suction grasping in cluttered environments.
https://junchengli1.github.io/Sim-Suction/
24 stars 2 forks source link

🚀 Sim-Suction-API

Sim-Suction Logo
Sim-Suction: Learning a Suction Grasp Policy for Cluttered Environments Using a Synthetic Benchmark.
Juncheng Li, David J. Cappelleri.

IEEE Transactions on Robotics
Paper | Project Website

Sim-Suction Demo Sim-Suction Demo

Table of Contents

Isaac Sim Installation

Deploy an Omniverse Virtual Workstation on AWS (Ubuntu Linux 20.04)

Important Notes:

Workstation Installation

System Requirements

Element Good Ideal
OS Ubuntu 20.04/22.04 Ubuntu 20.04/22.04
CPU Intel Core i7 (9th Generation)
AMD Ryzen 7
Intel Core i9, X-series or higher
AMD Ryzen 9, Threadripper or higher
Cores 8 16
RAM 64GB* 64GB*
Storage 500GB SSD 1TB NVMe SSD
GPU GeForce RTX 3080 RTX A6000
VRAM 10GB* 48GB*

Important Notes:

Installing Isaac Sim Environment Dependencies

Before launching the project, ensure to install all the necessary dependencies:

  1. Navigate to your Isaac Sim installation directory: Replace the given path with your specific installation directory if different:

    cd path_to_your_isaac_sim_directory
    # For instance:
    cd ~/.local/share/ov/pkg/isaac_sim-2022.2.1
  2. Install the necessary dependencies: Navigate to the Sim-Suction-API directory (which is this repository's root folder) and locate the isaac_sim_gen folder. Within it, you'll find the issac_sim_requirements.txt file. Replace [YOUR_PATH_TO_THIS_REPO] with the path to the Sim-Suction-API directory on your machine.

    ./python.sh -m pip install -r [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/issac_sim_requirements.txt

Generating Random Cluttered Scenes

Use the generate_cluttered.py script to create synthetic cluttered environments. Below are the available options you can configure:

cd path_to_your_isaac_sim_directory

./python.sh [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/generate_cluttered.py [OPTIONS]

Options for generate_cluttered.py:

Create Instanceable Assets (Optional)

To reduce memory consumption, it's beneficial to leverage the USD’s Scenegraph Instancing functionality. This allows you to mark common meshes shared by different copies of the same robots as instanceable. Note that the instanceable assets are textureless.

Use the convert_instance.py script to facilitate this process:

cd path_to_your_isaac_sim_directory

./python.sh [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/convert_instance.py [OPTIONS]

Options for convert_instance.py:

Point Cloud Generation and Seal Evaluation

Utilize the pointcloud_seal_eval.py script to generate point clouds and evaluate seals.

Execute the script with:

./python.sh [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/pointcloud_seal_eval.py [OPTIONS]

Options:

Outputs:

Digital twin testing board:

Use the 1:1 testing board to evaluate the seal model.

Use ./testing_board/test_board.usd to generate candidates after seal evaluation, and use ./testing_board/test_board.fbx to 3D print the 1:1 model to perform real experiments.

Sample Image 3
Test Board Simulation
Sample Image 4
Test Board 3D printed

Scaling Simulation

The simulation module orchestrates the process of simulating the UR10 robot's interactions with cluttered environments. It uses Isaac Sim to visualize and evaluate the robot's suction operations.

Simulation Setup

Before initiating the simulation, ensure the following:

Running the Simulation

Execute the simulation script suction_simulation.py using the following:

./python.sh [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/suction_simulation.py [OPTIONS]

Script Options:

Outputs:

The script generates a .pkl file containing a dictionary data structure for the simulation evaluation results with keys such as rotation_after_exp_success, translation_after_exp_success, object_mass, and more. The file is saved in the following format:

data_root+"/stage_"+stage_ind+"/"+"stage_"+stage_ind+"_candidates_after_simulation.pkl"

Annotation Results Visualization

This script visualizes the suction evaluation results. It uses the Open3D library to display 3D point clouds and mesh objects.

Requirements

Usage

To run the script, use the following command:

python3 [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/view_suction.py [--data_path DATASET_PATH] [--stage_ID STAGE_ID] [--mode MODE] [--ground GROUND_PLANE] [--suction_radius RADIUS]

The command-line arguments are as follows:

Output

The script generates a 3D visualization of the suction annotation results for the specified dataset and parameters. The visualization includes the point cloud data, suction candidates, and collision/seal/dynamic simulation results.

Sim-Suction-Pointnet (Base-Model)

Label Processing

Execute the script sim_suction_label_processing.py using the following:

python3 [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/Sim-Suction-Pointnet/sim_suction_label_processing.py [OPTIONS]

Options

Output

The script generates the training suction labeling (binary) and stored in ../sim_suction_label folder.

Model Training

The code has been tested with CUDA 11.7 and pytorch 1.13.1 on ubuntu 20.04. The training was performed on 2 A100 (80G) for 200 epochs.

Usage

Download and set your dataset paths:

data_root="/path/to/your/pointcloud_train"
suction_label_root="/path/to/your/sim_suction_label"

Install the utils of pointnet++ backbone:

cd /path/to/your/sim_suction_model/utils/pn2_utils
python3 setup.py install --user
cd /path/to/your/sim_suction_model/utils/pn2_utils/fuctions
python3 setup.py install --user

Execute the script sim_suction_train.py using the following:

python3 sim_suction_train.py [OPTIONS]

Options used in this repo:

Testing Dataset Generation (Single Shot)

Downloading the Assets and Datasets

Generate Testing Dataset Single Shot Point Cloud

cd path_to_your_isaac_sim_directory

./python.sh [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/test_single_shot_generator.py [OPTIONS]

Options:

Visualize point clouds

To visualize point clouds from either the test_similar or test_novel dataset, use the command below:

python3 [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/isaac_sim_gen/view_pointcloud.py [OPTIONS]
Sample Image 1
Point Cloud from Test_Similar
Sample Image 2
Point Cloud from Test_Novel

Inference

Execute the script sim_suction_inference.py using the following:

python3 sim_suction_inference.py [OPTIONS]

Options:

Online Evaluation (slow)

Execute the script sim_suction_eval.py using the following:

(Notes: slow process takes more than 24 hours)

cd path_to_your_isaac_sim_directory

./python.sh [YOUR_PATH_TO_THIS_REPO]/Sim-Suction-API/Sim_Suction_Pointnet/sim_suction_eval.py [OPTIONS]

To get result metrics from saved ../test_similar_eval_result, execute the script eval_post_processing.py using the following:

python3 eval_post_processing.py [OPTIONS]

Sim-Suction-Policy

Sim-Suction framework

Prerequisites

How to Run the Demo

Execute the sim_suction_demo.py script as follows:

python3 sim_suction_demo.py [OPTIONS]

Notes: use RGB and registered point cloud from demo folder.

Example Results: Picking Up Cups

The visualization below showcases the system's capability to identify and select cups for grasping.

Sim-Suction Demo

Release Notes

Here you will find information about the updates and improvements in each release.

[v1.0.0] - 2023-10-05

Added

[v1.0.1] - Upcoming Release

Citations

If you find this work useful for your research, please consider citing our paper:


@ARTICLE{10314015,
  author={Li, Juncheng and Cappelleri, David J.},
  journal={IEEE Transactions on Robotics}, 
  title={Sim-Suction: Learning a Suction Grasp Policy for Cluttered Environments Using a Synthetic Benchmark}, 
  year={2023},
  volume={},
  number={},
  pages={1-16},
  doi={10.1109/TRO.2023.3331679}}