This repository contains the YCB object models as URDF files, for use in simulation environments.
More information on the objects can be found here.
To download all object models, clone the repository or download it as a ZIP file:
git clone https://github.com/kwonathan/ycb_urdfs.git
You can also build all or a subset of the object models from scratch by following these steps:
-
Download this script.
-
Choose which objects you would like to download, by changing the
objects_to_download
variable, as shown in the comments. The full list of available objects can be found here. -
Choose the file types to download, by changing the
files_to_download
variable. You can find more information on the different file types here. The objects in this repository were downloaded withfiles_to_download = ["google_16k"]
. -
Run the script to download the object models:
python download_ycb_dataset.py
Note that it may take some time for the object models to finish downloading.
-
Now that the object models have finished downloading, we need to generate URDF files for each object. First, clone this repository:
git clone https://github.com/harvard-microrobotics/object2urdf.git
-
Move the newly downloaded object models to
object2urdf/examples/ycb
. You will find a few object models already in this directory. -
Replace the code in
object2urdf/examples/build_object_library.py
with the following:import os import sys from object2urdf import ObjectUrdfBuilder # Build entire libraries of URDFs object_folder = "ycb" builder = ObjectUrdfBuilder(object_folder) builder.build_library(decompose_concave=True)
You can find more information on the code in the object2urdf repository.
-
Navigate to the
object2urdf/examples
directory:cd object2urdf/examples
Then, generate the URDF files:
python build_object_library.py
You will find the URDF files in the
object2urdf/examples/ycb
directory.
You can then move the downloaded object asset files and the generated URDF files to your working directory to load them in the simulator.
You can find an example script to load the objects in the PyBullet simulation environment in this repository.
Run the example script with the following command:
python example.py
More information on PyBullet can be found here. The GitHub page can be found here. A useful quickstart guide can be found here.