Lab #4: Odometry and Dead Reckoning

       Introduction

This lab serves as an introduction to the TurtleBot2 robot and is due by Sunday, 11/17, at 11:59pm.

Objectives

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

  1. Create packages and nodes
  2. Control the TurtleBot2 via dead reckoning
Assignment
  1. Create a new package
  2. Create a new C++ or Python node called lab4
  3. Set up your node to publish Twist messages to the cmd_vel_mux/input/teleop topic. Check out the turtlebot_teleop package for examples.
  4. Implement two functions:
    • publishTwist(u,w) : takes in linear and angular velocity as inputs and publishes to robot
    • spinWheels (u1, u2, time) : takes in velocities of left and right wheels and drives the robot for the specified period of time.
  5. Modify your node to subscribe to Odometry messages. Check out turtlebot/src/kobuki/kobuki_node for examples.
  6. Implement two functions:
    • driveStraight(speed, distance) : should be in m/s and m
    • rotate(angle) : can be degrees or radians
  7. Finally, write an executeTrajectory() function that will
    • Drive the turtlebot in a square pattern with 50cm sides
    • Drive the turtlebot in an equilateral triangle pattern with 75 cm sides
Turn in
  1. Submit your code via Angel as a zip file.
  2. Submit a video (or link to a video) showing your robot complete the specified patterns
  3. In less than one page, as a .txt or .pdf, list:
    • Name of group member(s)
    • High-level approach to the project
    • What you What you could have done differently to make things easier on yourselves