Skip to content

Commit 350ac70

Browse files
added grasp sampling code
1 parent b20ee2a commit 350ac70

File tree

275 files changed

+898
-4864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+898
-4864
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
customizing_seal_model
2-
grasps_sampling
32
cad_files
43
physics_simulation
54
scene_generation
6-
media_raw
5+
media_raw
6+
labels_sim
7+
models/models_ifl_copy

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"jupyter.jupyterServerType": "local"
2+
"jupyter.jupyterServerType": "local",
3+
"git.ignoreLimitWarning": true
34
}

README.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
</p>
55

66
# News [dd/mm/yyyy]
7+
- [27/10/2022] **Grasp Sampling Code Online:** Sample parallel-jaw and vacuum grasp labels for custom objects.
78
- [26/07/2022] **Additional Synthetic Data:** Additional training data available.
89

910
# Installation
@@ -32,7 +33,7 @@ If you find our work useful, please consider citing.
3233
Ambidextrous Bin Picking via Physics-based Metaverse Synthesis},
3334
author = {Maximilian, Gilles and Chen, Yuhao and Winter, Tim Robin and Zeng, E. Zhixuan and Wong, Alexander},
3435
year = {2022},
35-
booktitle = {Accepted for IEEE CASE 2022}
36+
booktitle = {IEEE International Conference on Automation Science and Engineering (CASE) [in press]}
3637
}
3738
```
3839

@@ -153,10 +154,19 @@ You can explore the individuals objects labels with:
153154
```
154155
python ./Scripts/visualize_labels.py --root ./models --dataset_name models_ifl --object 008 --parallel_grasps --simulation --score_min 0.8 --max_grasps 100
155156
```
157+
<p align="center">
158+
<img src="./media/pj_grasp_labels.png" width="70%">
159+
</p>
160+
161+
156162
**Vacuum Grasp Labels**
157163
```
158164
python ./Scripts/visualize_labels.py --root ./models --dataset_name models_ifl --object 064 --suction_grasps --analytical --max_grasps 500
159165
```
166+
<p align="center">
167+
<img src="./media/sc_grasp_labels.png" width="50%">
168+
</p>
169+
160170
**Keypoints**
161171
```
162172
python ./Scripts/visualize_labels.py --root ./models --dataset_name models_ifl --object 008 --keypts_byhand
@@ -167,7 +177,7 @@ python ./Scripts/visualize_labels.py --root ./models --dataset_name models_ifl -
167177
```
168178

169179

170-
# Customizing MetaGraspNet (released soon)
180+
# Customizing MetaGraspNet
171181
Our proposed dataset is already very comprehensive, however metaverses allow for customizing data generation.
172182
We provide scripts for that as well, you can find them below.
173183

@@ -179,21 +189,18 @@ You can add custom .obj meshes by following the provided file structure in ./mod
179189
## Vacuum Grasps
180190
We provide scripts to generate your own vacuum grasps based on our proposed cup model:
181191
```
182-
cd grasps_sampling
183-
python ./scripts/sample_grasps.py --mesh_root ../models/models_ifl/ --suction --max_grasps 10
192+
python ./grasps_sampling/scripts/sample_grasps.py --mesh_root ../models/models_ifl/ --suction --max_grasps 10
184193
```
185194
## Parallel-Jaw Grasps
186195
You can sample antipodal grasps with:
187196
```
188-
cd grasps_sampling
189-
python ./scripts/sample_grasps.py --mesh_root ../models/models_ifl/ --two_finger --max_grasps 10
197+
python ./grasps_sampling/scripts/sample_grasps.py --mesh_root ../models/models_ifl/ --paralleljaw --max_grasps 10
190198
```
199+
## Parallel-Jaw Grasps in Isaac Sim (coming soon)
191200
<p align="center">
192201
<img src="./media/gym_1.gif" width="70%">
193202
</p>
194203

195-
196-
197204
For generating parallel grasps based on physics simulation, please fullfill installation process from [IsaacGym](https://developer.nvidia.com/isaac-gym). After you have set up a working isaac gym environment, start simulating with: (Be aware the PJ Grasps labels will be overwritten)
198205
```
199206
cd ./physics_simulation
@@ -208,7 +215,7 @@ python ./Scripts/pcl_label_gui.py --data_root ./models --dataset_name models_ifl
208215
```
209216
A window should appear where you can start labeling. You can move around with **[left mouse]** click, move your mouse cursor to the desired point on the mesh and add a keypt with **[right mouse]** click. The keypoint should appear in the scene, in case you want to remove it you can go over the created keypoint and **[scroll wheel]** click. It should disappear again (please be aware: you can only remove the last keypoint). When you are done, press **[s]** to save it to file or close with **[q]**.
210217

211-
## Generating Custom Data
218+
## Generating Custom Data (coming soon)
212219

213220
We provide scripts which enable you to create your own custom dataset. After successful installation of [Isaac Sim](https://developer.nvidia.com/isaac-sim) Python API, you can start creating custom data with
214221
```
Binary file not shown.

Scripts/visualize_labels.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def create_contact_pose(grasp_config):
255255
return cos_system
256256

257257

258-
if __name__=="__main__":
258+
if __name__ == "__main__":
259259
parser = argparse.ArgumentParser()
260260
parser.add_argument("--root", type=str, default="/home/isaac/GraspNet_Models/models_flairop")
261261
parser.add_argument("--dataset_name", type=str, default="models_ifl")
@@ -281,7 +281,7 @@ def create_contact_pose(grasp_config):
281281
args.analytical = True
282282

283283
## read in dataset
284-
grasp_dict = read_in_mesh_config(
284+
grasp_dict = read_in_mesh_config(
285285
file=PATH_TO_HDF5,
286286
parallel=args.parallel_grasps,
287287
suctioncup=args.suction_grasps,
@@ -364,7 +364,7 @@ def create_contact_pose(grasp_config):
364364
if score >= args.score_min and score <= args.score_max:
365365
contact_pt = [T_W_CONTACT[0,3],T_W_CONTACT[1,3],T_W_CONTACT[2,3]]
366366
#print(score)
367-
vacuum_contact = trimesh.primitives.Sphere(radius=0.15, center=contact_pt)
367+
vacuum_contact = trimesh.primitives.Sphere(radius=0.7, center=contact_pt)
368368
vacuum_contact.visual.vertex_colors = interpolate_between_red_and_green(score)
369369
trimesh_scene.add_geometry(
370370
geometry=vacuum_contact)
@@ -378,7 +378,7 @@ def create_contact_pose(grasp_config):
378378
keypt = grasp_dict['keypts_byhand'][id]
379379
pt_ = [keypt[1],keypt[2],keypt[3]]
380380
id_ = keypt[0]
381-
keypt_vis = trimesh.primitives.Sphere(radius=0.15, center=pt_)
381+
keypt_vis = trimesh.primitives.Sphere(radius=0.3, center=pt_)
382382
keypt_vis.visual.vertex_colors = random_rgb_color(id_)
383383
trimesh_scene.add_geometry(
384384
geometry=keypt_vis)

dataset_sim/scene20/0.npz

-1.17 MB
Binary file not shown.

dataset_sim/scene20/0_camera_params.json

-1
This file was deleted.

dataset_sim/scene20/0_depth.png

-55.8 KB
Binary file not shown.

dataset_sim/scene20/0_order.csv

-7
This file was deleted.

dataset_sim/scene20/0_order.json

-123
This file was deleted.

dataset_sim/scene20/0_rgb.png

-994 KB
Binary file not shown.

dataset_sim/scene20/0_scene.hdf5

-857 KB
Binary file not shown.

dataset_sim/scene20/1.npz

-1.28 MB
Binary file not shown.

dataset_sim/scene20/10.npz

-1.15 MB
Binary file not shown.

dataset_sim/scene20/10_camera_params.json

-1
This file was deleted.

dataset_sim/scene20/10_depth.png

-51.6 KB
Binary file not shown.

dataset_sim/scene20/10_order.csv

-7
This file was deleted.

0 commit comments

Comments
 (0)