How to add new YCB model into Drake simulation

FloraH
2 min readSep 3, 2021

--

First, download ycb-tools for python3

ycb dataset provides high-quality 3D models for sim2real

After cloning this repository, go to the directory in the terminal, run

python3 download_ycb_datasets.py

After successful download, run

python3 create_ycb_sdf.py

this command will generate all the .sdf files needed later.

Now, go to the directory (usually called models) where you stored all the 3D models, and create a new directory, for example, /003_cracker_box

Create 2 sub-directories in 003_cracker_box, /meshes and /sdf

how the directories should be set up

Add these 3 existing files to /meshes:

cd /your_home/Downloads/ycb-tools/models/ycb/003_cracker_box/tsdf and find

Add this 1 file to /sdf:

cd /your_home/Downloads/ycb-tools/models/ycb/003_cracker_box and find

Open the .sdf file you just added, look for the lines that begin with <url> and ends with </url>

change the line into <url>../meshes/textured.obj</url> if the line is within <mesh>

change the line into <url>../cracker_box.material</url> if the line is within <material>

All done!!

Create a new object in .yaml file and test it out! If the object does not react with the simulation, try adding <collision> in the.sdf file.

How to write in SDFormat

--

--

FloraH
FloraH

No responses yet