Gazebo Answers logo

Hi all,

I'm trying to use gazebo from ROS and my problem is the following: I have a mesh saved in .dae format that I want to load from a world file.

So, this is what I've done:

Then, I wrote the following world file:

<?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">

and the corresponding launch file:


  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="extra_gazebo_args" default=""/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="physics" default="ode"/>
  <arg name="verbose" default="false"/>
  <arg name="world_name" default="$(find mapping_environments)/worlds/my_mesh.world"/> 

  <!-- set use_sim_time flag -->
  <group if="$(arg use_sim_time)">
    <param name="/use_sim_time" value="true" />

  <!-- set command arguments -->
  <arg unless="$(arg paused)" name="command_arg1" value=""/>
  <arg     if="$(arg paused)" name="command_arg1" value="-u"/>
  <arg unless="$(arg headless)" name="command_arg2" value=""/>
  <arg     if="$(arg headless)" name="command_arg2" value="-r"/>
  <arg unless="$(arg verbose)" name="command_arg3" value=""/>
  <arg     if="$(arg verbose)" name="command_arg3" value="--verbose"/>
  <arg unless="$(arg debug)" name="script_type" value="gzserver"/>
  <arg     if="$(arg debug)" name="script_type" value="debug"/>

  <!-- start gazebo server-->
  <node name="gazebo" pkg="gazebo_ros" type="$(arg script_type)" respawn="false" output="screen"
    args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) -e $(arg physics) $(arg extra_gazebo_args) $(arg world_name)" />

  <!-- start gazebo client -->
  <group if="$(arg gui)">
    <node name="gazebo_gui" pkg="gazebo_ros" type="gzclient" respawn="false" output="screen"/>


but when I roslaunch the file, gazebo starts with an empty world. Is there someone that can, please, explain me how to solve this problem?



@hamzamerzic according to http://wiki.ros.org/roslaunch/XML/env, the env tag is deprecated and, in fact, it has no effect. There, it is suggested to use env-loader. But, if I'm not wrong, this is meant to be used in distributed machines settings. Do you have any clue on how I can solve this problem?

Originally posted by federico.nardi on Gazebo Answers with karma: 23 on 2017-08-01

Post score: 0

Original comments

Comment by hamzamerzic on 2017-08-02:
What I find useful is setting the GAZEBO_MODEL_PATH env variable to point to the location of your custom models. You can add within your launch file the following command: .

Comment by federico.nardi on 2017-08-02:
Yep, that works for sure. I'm going to follow your suggestion. Thanks

Comment by hamzamerzic on 2017-08-02:
@federico.nardi This is strange, because I use that extensively and it works like a charm. You can find examples here and here. You can also set the environment variable in your .bashrc by adding export GAZEBO_MODEL_PATH="$(rospack find mapping_environments)/models", but I prefer to have everything in the launch file.


1 Answer 1


Gazebo Answers logo

The URI should be pointing to the mesh file, for example model://my_model/meshes/mesh.dae.

See an example here.

I also recommend you use the verbose argument so you can see error messages which should help identify the issue.

Originally posted by chapulina with karma: 7504 on 2017-08-01

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.