Gazebo_world_tutorial

Custom Gazebo World with Textures

Table of Contents

  1. Prepare STL
  2. Texture Mapping
  3. Gazebo Setup

    Prepare STL

    Open the workspace model in solidworks. Press “save as”. Select “.STL” for “save as type” saveas

STL is a unitless format. Solidwork exports the dimentions with the default unit of the model file (mm/inch). Gazebo and blender use meter as default unit. To match the unit, click on options, select meters for unit. Save the STL unit

Texture Mapping

Create a new project in Blender. Delete all existing objects. Import the workspace model by import STL. Orient the obejct properly using the transform field.

transform

Go to the uv editing tab

unwrap the mesh with smart uv project

you should see the uv map on the left hand side

load the desired texture image

Go to material properties tab

add new material

go to base color and click on the circle

select image texture

Drop down the image icon, select the image we just loaded

Switch to object mode

change shading to material preview, now the texture should be shown in the rendering

export the file as DAE

Gazebo Setup

Go to the home directory of your ros machine, select show hidden files

Find “.gazebo” folder

Create new folder, name it “models”

Put the DAE file and the texture image in the models folder

Create a folder named worlds in your package, create the world file in it.

point the mesh model and collision model to “model://[MODEL NAME]”. the “model://” path is default to the models folder we created earlier.

make a launch file that launch the world we created

roslaunch it and the model with texture should be showing up