Lab #2: Introduction to Turtlebots

       Introduction

The main objective of this lab is to familiarize you with basic control of the Turtlebot robot. You are welcome to copy code from the internet, but make sure to credit where it came from. You are also welcome to talk with others on this assignment, but please don't directly copy their code.

Objectives

Upon successful completion of this lab, you will be able to:

  1. Run the turtlebot simulator in Gazebo (or Stage)
  2. Control the turtlebot via ROS messages in Python (or C++)
Assignment
  1. I recommend you use Gazebo for this lab. You're welcome to use Stage instead (lower graphics requirements and very similar commands as the physical robot) but please specify this in your submission so that it's graded correctly.
  2. In preparation for this lab, you have already gone through a tutorial on Gazebo. In class on the 21st, Matt demonstrated bringing up Gazebo, running rviz, and using keyboard commands:
    roslaunch turtlebot_gazebo turtlebot_world.launch
    roslaunch turtlebot_rviz_launchers view_robot.launch
    roslaunch kobuki_keyop keyop.launch
  3. Download the goForward.py, a simple python script for making the turtlebot go forward. Make sure you can run it:
    python goForward.py
    and work to understand each line of the file
  4. Your job is to create two new python files. When I run square.py, your turtlebot will move in a square, stop, and then the program will end. When I run spiral.py, your turtlebot will move in an outward spiral until I hit Ctrl-C, at which point it will stop and the program will end.
    spiral picture
    You'll probably want to learn more about the Twist message in order to accomplish these tasks.
  5. For extra credit, see if you can create two turtlebots and get them executing the spiral pattern simultaneously.
Hand in
In Blackboard, please submit the following:
  1. A text file with:
    • Your name
    • The names of any people you worked with (optional)
    • What you thought the hardest part of the assignment was
    • Any on-line references / websites you found particularly useful
  2. A video or screen capture of your code running the square, spiral and the (optional) extra credit. If the video is large, instead of uploading to blackboard, you can add a link as the final line of your text file with a URL to youtube, dropbox, etc.
  3. The code you wrote for the assignment: square.py, spiral.py, and anything else we'll need to run it. It doesn't need to be pretty, but it should be commented enough that we can understand what you did.
Grading
  1. Text file content: 10
  2. Code for square (correctness and quality): 30
  3. Code for spiral (correctness and quality): 35
  4. Videos of square and spiral (correctly shows what code does): 25
  5. Extra Credit: 10