Home | Tutorials | Wiki | Issues
Ask Your Question
0

roslaunch gazebo_ros mars_world.launch cannot find mars.world

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

ynevatia gravatar image

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

nkoenig gravatar image

Hi,

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).

<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"/>
  </include>
</launch>

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
GAZEBO_MODEL_PATH=:/home/yn/faster_dev/branches/yn/gazebo/models:
GAZEBO_RESOURCE_PATH=/home/yn/local/share/gazebo-1.9:/home/yn/local/share/gazebo_models:/home/yn/faster_dev/branches/yn/gazebo/plugin:/home/yn/faster_dev/branches/yn/gazebo/models
GAZEBO_MASTER_URI=http://localhost:11345
GAZEBO_PLUGIN_PATH=/home/yn/local/lib/gazebo-1.9/plugins:/home/yn/faster_dev/branches/yn/gazebo/plugin/build:/home/yn/faster_dev/trunk/gazebo/plugin/build
GAZEBO_MODEL_DATABASE_URI=http://gazebosim.org/models

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..

Thanks!

Yasho

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

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

ynevatia gravatar image

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

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
0

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

nkoenig gravatar image

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

~/faster_dev/branches/yn/gazebo/plugin/worlds/mars.world

edit flag offensive delete link more

Comments

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 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 758 times

Last updated: Jul 30 '13