Home | Tutorials | Wiki | Issues
Ask Your Question

roslaunch gazebo_ros mars_world.launch cannot find mars.world

asked 2013-07-26 10:57:05 -0500

ynevatia gravatar image

updated 2013-07-26 18:12:23 -0500

nkoenig gravatar image


I have a question regarding the directory structure expected by gazebo_ros when launching it using roslaunch.

I am using ROS Groovy, with Gazebo 1.9 and gazeborospkgs built from source.

I have a catkin workspace with gazebo_ros, where I have copied the following launch file (into ~/gazebo_src/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/launch).

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="mars.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="debug" value="false"/>

I need to keep the mars.world in a separate folder (internal/project repository) - ~/faster_dev/branches/yn/gazebo/plugin - which I have added to GAZEBO_RESOURCE_PATH. However when I try to launch gazebo with the command "roslaunch gazebo_ros mars_world.launch" I get the error that mars.world cannot be found.

I know that the mars.world works when I launch it with gazebo ("gazebo mars.world").

My environment variables are:

env | grep GAZEBO

The relevant folders are

gazebo_ros: ~/gazebo_source/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros
models: ~/faster_dev/branches/yn/gazebo/models (contains a databse.config and a number of models in subfolders)
world file: ~/faster_dev/branches/yn/gazebo/plugin
launch file: ~/gazebo_source/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/launch

Does anyone have any ideas why this could be giving me an error even though the world file path is correct (relative to GAZEBO_RESOURCE_PATH)?

I guess I could include "~/faster_dev/branches/yn/gazebo/plugin" in my global path, but I'd rather avoid this if possible..



edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-07-30 06:50:57 -0500

ynevatia gravatar image

updated 2013-07-30 06:51:55 -0500

I finally figured out the problem: it lies with the scripts in gazebo_ros/scripts. These call the setup.sh from Gazebo, which was overwriting the environment variables I had set in my .bashrc with default values.

By commenting out the relevant lines in gazebo_ros/scripts/gazebo and building it again (for safety), roslaunch gazebo_ros mars_world.launch works.

edit flag offensive delete link more

answered 2013-07-26 18:25:02 -0500

nkoenig gravatar image

Try putting the mars.world file in a "worlds" subdirectory:


edit flag offensive delete link more


Hi Nate, I tried doing that and it gives the same error - with the launch file referencing either worlds/mars.world or just mars.world.

ynevatia gravatar imageynevatia ( 2013-07-27 02:41:12 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2013-07-26 10:57:05 -0500

Seen: 778 times

Last updated: Jul 30 '13