Home Lecture Blog Resources Project Discussion Group Assignments

Submit material you wish to deliver electronically via:

  submit fredm ps4 zip-or-tar-file

Files Needed



Write a control program to complete the race track simulation provided in the attached Your robot should travel no faster than 5m/s. This will be enforced by a referee node that is watching you when the robot starts. The starting location of the robot may be anywhere within a 4x10m bounding box around the start location so do not hard code the turns.

  • The robot has a 5 meter laser scanner that can see 180 degrees in front of it. The output of this topic is published to /robot/base_scan.
  • The robot listens to a command_velocity topic on /robot/cmd_velocity. This topic expects a linear motion in x y z as well as angular motion in x y z.


Extract the uml_race folder and add it to your ROS_PACKAGE_PATH. You should then be able to use roslaunch just like the turtlesim example in the tutorials.

$ roslaunch uml_race racetrack.launch

In the stage window you may see the output of the laser by selecting View > Data. This will be a useful debugging tool so make sure you use it.

To Turn In

You should zip or tar up all of the below when submitting your assignment:

  1. The py file (or file in other language) that contains your implementation. If you used a language other than Python, that is fine. If your implementation is split across multiple files, turn them all in.
  2. A narrative explanation (approx. 300 to 500 words) describing how your solution works. This is preferably a txt file (odt, doc, or pdf is also acceptable).
  3. A ROS bag file obtained with your code running the course. You should record the /robot/cmd_vel topic.


There will be two prizes given to encourage good solutions.

  • The shortest control code needed to complete the course. As a hint similar race tracks have been completed in <10~15 lines of actual control code.
  • The fastest lap time recorded by the referee node.

More Notes

  • Watch along with Nat's tutorial at the Echo360 Lecture 4 capture.
  • Make sure to add the directory in which you do your work to your ROS_PACKAGE_PATH, probably by editing your ~/ file.
  • Don't forget how to get everything started: Open a terminal and run roscore .
  • Start up the racetrack project per the note above.
  • You will need to add <depend package="nav_msgs"/> to your project's manifest.xml file.
  • The command for launching your program is ROS_NAMESPACE=robot rosrun track_control .
  • In Stage, tick the Data checkbox in the View menu to see the laser scan. This helps you know which way your robot is facing.
  • It turns out that msg.ranges[0] is the right-hand laser reading. Use msg.ranges[179] to get the left-side reading.