This was a bit tough to figure out so here is a simple process to get a 3d model into gazebo simulation. We will do a 3D model of a ArUco marker.
- Get a PNG image of the desired ArUco marker.
- Open blender
- Add an image mesh plane:
Shift+A -> Image -> Mesh Plane - Go to scripting tab
- Paste python script from this repo
- Run script
- Choose place to save model, it must be in a directory that Gazebo can find (
GZ_SIM_RESOURCE_PATH) - Edit your gazebo file to include model (launch, world file)
- Verify it is able to load file
- If you need massless (static) objects in gazebo you will need to modify the
model.sdffile. Add a<static>true</static>element inside<model>and a<mass>0</mass>inside every<link>element.