Menu

[ IVLE ]

[ Overview ]
[ Syllabus ]
[ Grading ]
[ Homework ]
  [ HW 1 ]
  [ >HW 2T ]
  [ HW 2I ]
[ Misc. ]

Homework #2: Localization using Lego Mindstorms

(Updated on Fri Apr 8 13:30:55 GMT-8 2005 )

Please see the group signup for more details on slots for the demo on 8 Apr 2005.

In this homework assignment, two students will work together to create a simple robotic agent that will perform localization on a known map. You will first check out kit a Mindstorms kit from the Graphics Laboratory (from Mr. Chong Peng Kong) and build a robot that will implement (at least) a forward motion of 1 foot and turning motions of 90 degrees. As input, you will be given a map of the space your robot will travel in. The map is at most most 5' x 5' and also indicates where it needs to go to meet its goal. Your agent will thus need to travel to the goal, as fast as possible.

This is an easy task when the agent knows where it is starting from. However, that is not the case here, as your agent will not know where it initially starts, nor which direction it faces. Your agent will start by localizing itself, that is, figuring where it is in the space. Your agent will start from one of 5 (x-axis) x 5(y-axis) x 4 (orientation) = 100 possible starting configurations. It will need to explore its space in order to ascertain its exact location, and then move to its goal position.

Technical Description

Input

The following three 5x5 maps will make up three of the test cases for the demo of your robot. A '|' or '-' indicates a wall. An 'X' indicates the goal position. A final, fourth test case will be given to you at demo time. You'll have five minutes to add this map and goal state to your agent's software.

Map 1Map 2Map 3
+---------+
|         |
+-------- |
|      X  |
+-------- |
|         |
+-------- |
|         |
+-------- |
|         |
+---------+
+---------+
|         |
| +-+ +---+
| | | |   |
| | | | | |
|   | |X| |
+---+ +-+ |
|   |     |
| --+---+ |
|         |
+---------+
+---------+
|         |
|         |
|      X  |
| |       |
| |       |
+-+       |
|         |
|         |
|         |
+---------+

To do this assignment, you will be provided with a Mindstorms kit. You will need to build some type of mobile agent. I suggest that you build the driver base as instructed in the instruction booklet and refine it so that in can traverse distances of 1 foot and turn 90 degrees as accurately as possible. The driver base will need to be equipped with at least one touch sensor in order to detect when a wall has been encountered.

Output

Your agent will first localize itself by exploring the space. Once your agent is certain of its location, it should emit a single 'beep'. Then it should proceed to the goal location and emit a two consecutive 'beep's when it has reached its goal location. Note that your agent can arrive in the goal location with any orientation; only the location matters; not the orientation.

Note that it is possible in some cases to know that you have reached a goal state before localization is certain. For example, take map 3 and a goal location of being in the middle of the 5x5 grid. For simplicity, you are to ignore this aspect for the assignment and concentrate on the problem two distinct problems of localization, followed by navigation.

Grading and submission formatting

You may code this assignment in any programming language you want but we advise that you use Lejos (see links at the bottom) as we have had success with this programming language in the past. Although you will need to submit your code and README for the assignment (as per the following instructions), the grading will mostly be done by demonstration. In the week following the homework due date, I will set up 20 minute appointments for you to demo your robot agents. At least one of your team members must be present for the demo.

Your code will need to be submitted with a README.txt file in plain text. The code and README (as per homework #1) should not contain your names, but just your matric number. You should submit it as a single zip (not RAR, GZ or BZ) file (without an included directory, as per homework #1) named submission-XXXXXX-YYYYYY.zip, where XXXXXX and YYYYYY are your matric numbers in CAPS.

Some advice

As you will find out, the above description is a nice abstraction of how robotic kits actually work in the real world. Sensor and actuators rarely work to move exactly one foot or turn 90 degrees. Memory on the RCX control module is limited to 32K (yes, you read correctly, that's kilobytes). There are interesting ways around each of these problems; I leave it up to you to figure out how. So it's up to your team to design the physical aspects of robot and the software that coordinate that minimize this error as much as possible. Battery life causes robots to move less far, tires grip differently on different surfaces, etc. These aspects of robotics are best anticipated and dealt with as soon as possible. IR communication between your IR tower and the RCX is difficult in bright light (you may have to make a shield to get the transmission working. If you have any questions, please ask me ahead of the deadline. If you are planning on doing this assignment, plan on having access to a laptop that you have administrative rights to, it will make your work much easier to handle. If you don't have this equipment and are still interested in this assignment, you should approach me. If you need spare parts from other RCX kits, you are welcomed to loan extra parts from the spare RCX kits that we have; approach Mr. Chong for this.

Important Links

  1. LEJOS: http://lejos.sourceforge.net/
  2. Local Lejos and Mindstorms set-up instructions from Huang Weihua, former TA of CS 3243
  3. LEGO Mindstorms Homepage: http://www.legomindstorms.com/
  4. LEGO Robotics resources: http://www.crynwr.com/lego-robotics/

Min-Yen Kan <kanmy@comp.nus.edu.sg> Mon Mar 7 15:29:26 2005 | Version: 1.0 | Last modified: Fri Apr 8 13:32:34 2005