I am moving from Player/Stage/Gazebo to ROS. Working with Gazebo, in Player/Stage/Gazebo used to be with world files (viz. gazebo pioneer2dx.world) however in ROS it is with launch files. So, my first question - how to make launch file for the corresponding world file ?
If you want to launch Gazebo using an empty world and then put your_robot (URDF) model into that world you can use:
<!-- Start Gazebo. -->
<param name="/use_sim_time" value="false"/>
<node
pkg="gazebo" type="gazebo" name="gazebo"
args="$(find gazebo_worlds)/worlds/empty.world">
</node>
<node
pkg="gazebo" type="spawn_model" name="spawn_your_robot"
args="-urdf -file $(find your_robot_model)/your_robot.xml -model your_robot">
</node>
Further, you can create a node called your_robot that broadcasts a transform for your robot. If you want to see your robot move in Gazebo, then the your_robot node also needs to publish the state of your robot on the topic gazebo/set_model_state. See this page for more details about what ROS Gazebo publishes and subscribes to.
Alternatively, you can use the Gazebo services to make your_robot URDF model move in Gazebo.
Asked: Sep 01 '11
Seen: 205 times
Last updated: Sep 02 '11
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.