ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can use the <arg>
tag to pass arguments to your launch files on the command line: http://wiki.ros.org/roslaunch/XML/arg
In your case, something simple like this would probably do:
<launch>
<arg name="world" default="lawnbot_tutorial_gas_station"/>
<!-- 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="$(find lawnbot_gazebo)/worlds/$(arg world).world"/>
<!-- more default parameters can be changed here -->
</include>
</launch>
And then on the command line, you would do:
roslaunch lawnbot_gazebo lawnbot.launch world:=bot_test_world
Or
roslaunch lawnbot_gazebo lawnbot.launch world:=lawnbot_tutorial_gas_station
and it would load the desired world file from the lawnbot_gazebo package.