ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

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.