Projects

[Lego Robots] [Sample Code] [Lab Hours] [First Project] [Second Project] [Challenge]

Lego Robots

The projects will use Lego Mindstorms robot kits. These kits are supplied by me rather than the department, so, please guard the kits carefully and make sure you don't drop the box with the kit in it on the subway.

The kits contains an assortment of parts some or all of which you can use to build your robot. There is no restriction on what you can build except that it can only be constructed with the parts you have been given.

If you want to use additional parts (for instance because you need an extra three grommets to build the robot of your dreams), come and see me, and we can discuss if you can have some extra components. (I will only agree if the parts you want are essential to what you robot is doing and don't give the robot an unfair advantage.)

You will need to download the current version of Not Quite C (NQC) (version 2.4 r2 or higher) for the platform you intend to use.

You can also download the User Manual and Programmer's Guide for Not Quite C.

You might also be interested in the Bricx Command Center which is an integrated development environment for NQC (I prefer to use the old-fashioned combination of text editor and compiler).

Another thing you'll need to download is the driver for the USB tower that you use to download programs into the robot.

Finally, Aaron Gibbs has put together a LEGO Mindstorms page which include information on how to get started, how to use NQC, and has a bunch of sample programs that you might like to look at.

[Lego Robots] [Sample Code] [Lab Hours] [First Project] [Second Project] [Challenge]

Sample code

Here are three sample programs:

The sample code also gives you an idea of the level of comments that I want you to include in the code.

[Lego Robots] [Sample Code] [Lab Hours] [First Project] [Second Project] [Challenge]

Lab Hours

Here is the current schedule of times that the lab will be open for other classes; you are free to use the lab at this time. You have to page ahead to get to times for April and May (it defaults to March).

In response to the requests that I have received from the class, you can also use the lab any time between midday and 9pm on:

Since I will be hanging around campus specifically to keep the lab open, I'd appreciate it if you email me beforehand to let me know if you plan to use the lab during those hours.

There will also be two weekend sessions before the first project on:

and for the second project on: For the weekend sessions, go straight to the lab.

The lab is 5301 Ingersoll.

During the open hours, the laptop cart will be in the lab, and there will be robots to use.

If the currently scheduled times do not fit your schedule, let me know what does work and we will try to schedule more sessions.

[Lego Robots] [Sample Code] [Lab Hours] [First Project] [Second Project] [Challenge]

First Project

Using the Lego Mindstorms kit, you will have to build a robot which follows a line, detects obstacles (and backs up when it hits an obstacle) and can detect various coloured regions that the line passes through.

The course will look like:

The course is built on white foamcore, and the line is "drawn" with black electrical tape. There are figures "drawn" in green tape and aluminum foil. All of these elements give different readings on a light sensor.

A course which incorporates these elements will be provided for you to practice on with the robots. This will be placed in Ingersoll 5301 for you to use. We will set up a schedule of times that this room is open for you.

At the end of the project these robots will compete over this kind of course; the aim is to complete the course in the minimum time.

Doing badly in the competition will not hurt your grade for the project, but doing well in the competition may increase your grade for the project.

The robot control programs should be written in the "stimulus-response" style we discussed in Lecture 3.

Competition details

The following notes should be consulted in conjunction with the line following course.

They describe the procedure that will be followed during the competition.

Place the robot at the end of the black line where the line touches the edge of the board.

Let the robot start line-following and start timing.

At some point between the third and fourth corners place an object (for example a box).

When the robot touches the object, it should stop, back up slightly and wait

When the robot has stopped after backing up, remove the object.

When the robot reaches the green figures it should play a sound.

When the robot reaches the silver figures, stops, and plays a second sound (to show it recognises the silver patch) stop the clock.

NOTE:

What you have to hand in

Everyone has to submit a project report which is their own work (and we will be checking that group members have not just cut and pasted between reports).

Each report should be 2-3 pages long (standard letter paper, 10-12pt type, single spaced), and should describe the design of the code which controls the robot.

You must not only describe the design choices made, but also justify them.

In addition to the 2-3 pages of report, you must submit two other items:

  1. A listing of the code of the control program of the robot. This should be properly commented (I expect to be able to understand exactly what the code is doing from the comments).
  2. A single sheet which describes the contribution to the project of the author of the report. This should be signed by all the group members indicating that they agree that the description is an accurate picture of the author's contribution to the project.
[Lego Robots] [Sample Code] [Lab Hours] [First Project] [Second Project] [Challenge]

Second Project

The second project will be Robot Tag.

The tag course is as below:

The course will be built on a large piece of foamcore. About a third of this will be the sumo ring, marked by a rectangle of black electrical tape.

Each robot will have to follow a winding path to the ring from its start position. This path will be (almost) exactly the same for both robots.

The point at which the path meets the ring will be marked with a sqaure of aluminium foil; this gives a light reading above that of the white foamcore and is typically very easy to detect.

Each robot will have to carry a light source so that both robots can "see" each other.

The rules of the tag contest are as follows.

  1. Tag is a contest between two robots. One is denoted the "pursuer", the other is denoted the "evader".
  2. Both robots have to follow a line to reach the ring.
  3. Robots have two minutes to reach the ring. If one robot fails to reach the ring two minutes after the start of a contest, that robot loses the contest.
  4. If both robots fail to reach the ring within the two minute limit, the one that is closest to the ring when two minutes have passed will be deemed the winner.
  5. Once in the ring, the aim of the pursuer is to tag the evader. Tagging is achieved by the pursuer touching the evader and then stopping.
  6. Once in the ring, the aim of the evader is to avoid the pursuer from touching it.
  7. For the puruser to win, it must tag the evader within 4 minutes of the start of the contest (so the pursuer has, at minimum, 2 minutes to do the tagging).
  8. For the evader to win, it must avoidbeing tagged for 4 minutes from the start of the contest (so the evader has, at minimum, 2 minutes to do avoid being tagged) (since it must enter the ring within two minutes of the start in order not to lose).
  9. Any robot that completely (in the judgement of the referee) leaves the ring after entering it, loses.
  10. A tag competition will involve every robot playing both pursuer and evader with every other robot.

What you have to hand in

Everyone has to submit a project report which is their own work (and we will be checking that group members have not just cut and pasted between reports).

Each report should be 2-3 pages long (standard letter paper, 10-12pt type, single spaced), and should describe the design of the code which controls the robot.

You must not only describe the design choices made, but also justify them.

In addition to the 2-3 pages of report, you must submit two other items:

  1. A listing of the code of the control program of the robot. This should be properly commented (I expect to be able to understand exactly what the code is doing from the comments).
  2. A single sheet which describes the contribution to the project of the author of the report. This should be signed by all the group indicating that they agree that the description is an accurate picture of the author's contribution to the project.

[Lego Robots] [Sample Code] [Lab Hours] [First Project] [Second Project] [Challenge]

Challenge

For extra credit you can enter the challenge project.

This is to write code to play soccer against other teams working on Lego robots at Brooklyn College.

The challenge will be run during the day (club hours) on 16th May; if you are interested in taking part, let me know.