CM10135 / Programming II:   Tutorial 3

This is a completely optional third tutorial.  It should be done only if you have your CW1 code working.

The objectives are to get a feel for programming real-time systems.  The main characteristic of such systems is that actions, once taken in the real world, cannot be revoked.  As you learned in class, one canonical example is the ATM, where once money is dispensed it will not be returned.  Another is robotics.  Once a robot has fallen off a table, it's not likely to ever run again.

The other objective is to help you think a little more about non-linear control, since the robots you will be working with have special clauses for responding to certain events in the environment.

What to do:

  1. Go to and download the program.
  2. Have a look at the tutorial & the code of existing robots -- run them & see how they work.
  3. For real robots, the first task you would try to do is to get the robot to find a wall then follow the wall all the way around the room.  I encourage you to do this, as it will help you think about how do you steer relative to the robot, not yourself.  Also, you will have to think about how to sense that you have found a wall.
  4. Obviously, some of you will be tempted to work in the robot wars.  That's fine if you like.  One thing to think about is deictic representations.   That is, you don't need to be reasoning about / reacting to a particular opponent robot (e.g. Bob the Robot), you might just want to reason about `the robot that's shooting at me now' or `the robot closest to me'.
  5. If you want to do something less violent, then you may want to try implementing robot tag (or tig if you are British).
    1.  Be sure to use the change colour command so that you can tell which robot is `it'. 
    2. To communicate, you will want to extend "team robots", not just regular robots.
    3. In case anyone doesn't know the rules:
      1. One robot is `it' and must tag (bump) another robot to make it become `it'.
      2. The other robots all avoid the `it' robot.
      3. Further challenge:  the `no tagbacks' rule -- the robot that becomes `it' can't just bump back into the robot that just tagged it.

page author: Joanna Bryson
8 March 2005