Skip to content

Latest commit

 

History

History
71 lines (47 loc) · 5.95 KB

File metadata and controls

71 lines (47 loc) · 5.95 KB

Milestone 2 - Basic Robot Simulation with Gazebo

In this Milestone, you are going to learn about Gazebo, a physics engine that allows you to simulate your robots moving through a virtual 3D environment, and hence test your algorithms.

Learning Goals

After completing this milestone, you will be able to

  • Create and demonstrate in the Gazebo simulation environment a robot controlled through ROS.
  • Examine elements of that robot through the Rviz visualization tool.

Installation

Ensure you have installed ROS before starting this Milestone (which you will have done if you completed M1). The instructions below assume you have installed ROS Melodic, but may work in other versions.

Installation guide for Linux users

Just like ROS, Gazebo is native to Ubuntu Linux and thus best supported there. The installation on Ubuntu is fairly straightforward. Things to keep in mind are:

  • Make sure you install Gazebo related packages that match your ROS version (in our case ROS Melodic).

Installation guide for Windows users

A compatible version of Gazebo should have been installed as part of the desktop_full metapackage through chocolatey; for example, the ros-melodic-desktop_full metapackage includes the gazebo-9 package.

Installation guide for MacOS users

If you have managed to install ROS on MacOS by following Milestone 1, it may also be also possible to install Gazebo on MacOS as well. Follow the installation guide here.

ROS/Gazebo Tutorials

Once you have Gazebo installed successfully, you need to learn how to use Gazebo to run your simulations.

  1. Work through the Beginner tutorials listed on the left side of the Gazebo Tutorials page:

    • Overview and Installation. You have already completed the installation, so all you need to do is read the "What is Gazebo?" text.
    • Understanding the GUI. For Windows users the gazebo command is not defined. Instead you can use the command
      roslaunch gazebo_ros empty_world.launch
      
      to get Gazebo started in an empty world. (It also creates a ROS master, but you won't use that in these early tutorials.)
    • Model Editor. We won't use this basic robot -- in fact, no big deal if you cannot get it to move -- but this tutorial gives you a visual idea of what is going on in URDF below.
  2. The tf2 package manages transformation (coordinate) frames in ROS. Work through the first tutorial: Introduction to tf2. Although you are not required in this milestone to complete any more of the available tf2 tutorials, missing or buggy transform trees are a very common source of problems in ROS so you may want to explore further.

  3. URDF is the language we will use to represent our virtual robots. Work through at least the Learning URDF Step by Step tutorials (items 2.1 to 2.5 on that tutorial page).

Build Your Own Robot

Using the examples from the above tutorials, create your own example robot. It should:

  • Have at least three disinct types of links (such as cylinder, sphere, box, ...) with visual and collision components.
  • Have at least three joints, at least one of which is not attached directly to the top level of the link tree.
  • Use an Xacro property and/or macro.
  • Have a launch file which brings up Gazebo (so the robot can be seen moving) and Rviz (so that the elements of the RobotModel can be examined).
  • Include some method for controlling the motion of the robot interactively while the simulation is running. This could be through a RobotSteering panel (from Using a URDF in Gazebo), keyboard control (from Understanding ROS Topics) or perhaps using a joystick that you have lying around the house (you'll need to Google for that one).
  • Be different from the robots of all other students in CPSC 515.

Milestone Evaluation and Acceptance Criteria

To demonstrate that you have completed this Milestone, you need to be able to show (through a screen share) that you can:

  1. Launch Gazebo and Rviz with your robot model launch file.
  2. Show in Gazebo that your robot responds to specified commands through your chosen control interface.
  3. Show in Rviz elements of your robot model.
  4. Show requested elements of your URDF file, such as links, joints or Xacro elements.
  5. Answer questions about elements of your URDF file.

The assessment will be time limited, so make sure your local machine is properly set up in advance, you have sufficient terminal windows open, and you have your URDF file open in an editor. You may use written sources (including internet searches) to answer the questions, but the time limitations will not permit extensive searching and reading. It will be possible to answer the questions in a sentence or two.