Skip to content

Commit 20d4ca0

Browse files
committed
Fix urdf extraction from shapenet dataset, add instructions to README
1 parent 9da1f0a commit 20d4ca0

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**/google_scanned_objects/
44
**/ycb_objects/
55
**/test_folder/
6-
**/shapenet/
6+
**/shapenet/ShapeNetCore.v2
77
__pycache__
88
*.egg-info
99
*.bak

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The list of available objects includes:
2424
- [Google Scanned Objects](#google-scanned-objects)
2525
- [Evolved Grasping Analysis Dataset (EGAD)](#egad-objects)
2626
- [Gibson Objects](#gibson-objects)
27+
- [ShapeNetCore.v2](#shapenetcorev2)
2728

2829
Each object has the following files:
2930

@@ -178,6 +179,36 @@ To set up these objects:
178179

179180
- Some of the meshes have been simplified to reduce the number of triangles.
180181

182+
### ShapeNetCore.v2 ###
183+
184+
- The dataset is available on the ShapeNet website ([https://shapenet.org/](https://shapenet.org/)).
185+
186+
To extract `.urdf` files from the `ShapeNetCore.v2` dataset, please follow these instructions:
187+
188+
1. Download the `ShapeNetCore.v2` dataset and place it under `pybullet_object_models/shapenet/`. The name of the dataset folder needs to be `ShapeNetCore.v2`.
189+
2. Copy the `_protype.urdf` file from `/egad/` into the `ShapeNetCore.v2` directory.
190+
3. Once these two steps are done, you should have the following tree:
191+
```
192+
pybullet_object_models
193+
├── shapenet
194+
│ ├── ShapeNetCore.v2
195+
│ │ ├── _prototype.urdf
196+
│ │ ├── ... # example: 02942699
197+
| | | ├── ... # example: 1ab3abb5c090d9b68e940c4e64a94e1e
198+
```
199+
4. In the project root folder, run `python build_shapenet_urdfs.py`. The extracted `.urdf` files are named `model.urdf`. They are placed under the object ID directory. For example:
200+
```
201+
pybullet_object_models
202+
├── shapenet
203+
│ ├── ShapeNetCore.v2
204+
│ │ ├── _prototype.urdf
205+
│ │ ├── 02942699
206+
| | | ├── 1ab3abb5c090d9b68e940c4e64a94e1e
207+
| | | | ├── models
208+
| | | | ├── images
209+
| | | | ├── model.urdf <-- EXTRACTED .URDF
210+
```
211+
181212
### Usage ###
182213

183214
Example scripts for importing the objects into pybullet are provided in the examples folder. To run these cd into the `examples` directory and run `python demo_load_object.py`. Use the `-object_set=` argument to load from a given object set, currently this can be selected from `primitive`, `random`, `ycb`, `superquadric` or `google` if setup correctly.

pybullet_object_models/build_shapenet_urdfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Build entire libraries of URDFs
88
# Can take a while
99

10-
shapenet_folder = "shapenet/ShapeNetCoreV2"
10+
shapenet_folder = "shapenet/ShapeNetCore.v2"
1111

1212
subdirs = get_immediate_subdirectories(shapenet_folder)
1313

@@ -24,7 +24,7 @@
2424
builder.build_library(force_overwrite=True,
2525
decompose_concave=False,
2626
force_decompose=False,
27-
center='mass')
27+
center='geometric')
2828

2929
# tidy up
3030
move_urdfs_to_subdirs(object_folder)
6 KB
Binary file not shown.

pybullet_object_models/shapenet/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)