Gazebo | Ignition | Community
Ask Your Question

Can't import mesh in Gazebo world

asked 2021-08-29 12:13:29 -0600

Anirban Sinha gravatar image

updated 2021-08-29 14:40:48 -0600


I am working on a custom rospackage to spawn custom meshed models in Gazebo. The package name is person_sim. The file structure of the package is as following,

  |->meshes->, standing.dae

I have a custom world file which includes a mesh as model in the file. The file is as following,

<?xml version="1.0"?>
<sdf version="1.4">
  <world name="default">
    <model name="my_mesh">
      <pose>0 0 0  0 0 0</pose>
      <link name="body">
        <visual name="visual">

I order to check whether the mesh is working properly, I ran the following command which clearly shows the mesh in the gazebo environment.

$ roscd person_sim/meshes
$ gazebo

The figure below shows what I see after running the above commands.

image description

But when I am trying to launch this through roslaunch file, I do not the see the model corresponding to the mesh standing.dae at all. The roslaunch file named environment.launch that I am using is given below

<?xml version="1.0"?>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find person_sim)/meshes/"/>

The figure below shows that no mesh model is in the gazebo world however the model named my_mesh is listed under Gazebo's UI panel on the left. Any help in resolving the issue will be appreciated.

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-08-30 04:53:39 -0600

Veerachart gravatar image

I think with <uri>file://standing.dae</uri>, gazebo will try to look for the file standing.dae at your current directory, and the $GAZEBO_RESOURCE_PATH. So, when you run your world file, you are in the same directory as the mesh file, and therefore it can be loaded. However when you run the ROS launch file, I think you are in the different directory, and Gazebo can't find the standing.dae file. (You can confirm this by adding verbose option when running the ROS script. If it says the file can't be found then that's the point.)

A quick fix would be adding the path to your mesh file to the $GAZEBO_RESOURCE_PATH by running

export GAZEBO_RESOURCE_PATH=$GAZEBO_RESOURCE_PATH:/path/to/person_sim/meshes

and the launch file should load the mesh. However it's probably not the best way.

You can create a model, put your mesh file into the meshes folder of that model, and add an SDF file to load the mesh using <uri>model://meshes/standing.dae</uri>, like other models you can find on Gazebo model server.

edit flag offensive delete link more


Adding the mesh directory to the GAZEBO_RESOURCE_PATH solves the problem. Thank you.

Anirban Sinha gravatar imageAnirban Sinha ( 2021-08-31 08:09:32 -0600 )edit

Question Tools

1 follower


Asked: 2021-08-29 12:13:29 -0600

Seen: 974 times

Last updated: Aug 30 '21