UP | HOME

Gazebo and ROS

Objective

You will be taking a urdf model of a robot and and adding it to gazebo, along with a gazebo world.

Instructions

  1. Clone https://github.com/m-elwin/me495_urdf.git and checkout the xacro branch
    • You can directly clone it with https://github.com/m-elwin/me495_urdf.git -b xacro
  2. Start gazebo (rosrun gazebo_ros gazebo), add some items to the world, and save the world within the me495_urdf package
  3. Write a file urdf/slidebot.gazebo.xacro to add <material> tags to each link
    • The file starts with a robot tag with the name slidebot, like any other xacro
    • Use <gazebo reference="linkname"> to augment an existing link with gazebo-specific properites
      • Any tags within the gazebo tag are effectively added to the link
    • An example material in gazebo is <material>Gazebo/Black</material>
  4. In urdf/slidebot.urdf.xacro, be sure to <xacro:include filename="<The slidebot.gazebo.xacro file"
  5. Use xacro to convert your xacro file into a urdf
  6. Use the spawn_urdf node from the gazebo_ros package to spawn your model in gazebo
  7. Modify the see_robot.launch file to start gazebo in a paused state and spawn the model in a gazebo world

Resources

Author: Matthew Elwin