HomeIntroductionRobot DesignCommand ServerFirmwareSimple ClientSubmission

74.795-L02 Assignment 1

Due Date: 22nd January 2003

The global vision mobile robot environment in the Department of Computer Science at the University of Auckland consists of a variety of mobile robots. The robots are based on the Lego Mindstorms robotics invention kits and only have very limited intelligence. Therefore, driving commands for the robots are being transmitted via an infrared link to the robots. Most of the processing is performed by off-board computers (PCs) networked together via Ethernet. One PC on the network is connected to a Lego infrared tower which is used to transmit information to the robots.

The goal of this assignment is to investigate, analyze, and solve issues in the communication layer of the mobile robots environment. The goal of the assignment is to implement the necessary components for a tele-operated game of robotic soccer. This includes four components: robot design, command receiver, firmware, and simple client.

You should complete the mechanical design of the robot using the Lego Mindstorms kit.

Your robot should satisfy all rules and regulations of the RoboCup F180 league. In particular, the maximum diameter of the robot is limited to 18cm. The only exception is that you not need to complete the cardbox cover by the due date.

Your robot must be able to receive commands via the infrared receiver on the robot. Make sure that your infrared port is not obstructed by Lego blocks.

Command Server

The command server is a daemon running on one of the workstations in the Linux lab. The command receiver accepts commands via udp broadcast. The command receiver uses brickos' lnp protocol to communicate with the Lego Mindstorms tower.

The command server is started from the command line using the following command line options.

	[--port port]		port number to listen for commands on 
	[--robot robot=id] 	specify a mapping from robot name to ids. The ids must be between 0 and 7. 

The command server accepts commands from the clients using udp. The commands from the clients are described below. These angle and distance commands are converted into a single command byte for the robot.

The command byte uses the following encoding:

Clients may generate commands that can not be encoded given the scheme above. In this case, the command server should generate the best match to the desired command.

The directory rcom-lm contains a sample program that you can use to get you started.


Use the brickos and lnp to implement the firmware for the Lego Mindstorms robots.

Your robot needs to receive commands via the infrared port. The command server transmits a message which contains sychronization data, some error checking information, and new commands for all robots.

Each message

The command bytes for the robots are described in section Command Server .

The three error detection bits are the least significant three bits of the sum of all robot command bytes (Bytes[1..8]).

The directory RC02-Firmware contains sample code that you can use to get you started.

Simple Client

The simple client is the interface that a human user can use to control a robot in a game of soccer.

Startup and Command Line Arguments

Your client should accept two options when started via the command line.

	[--port	portnumber]	port to broadcast the commands
	[--robot	robotname ...]	name of a robot

Both options are optional. There may be more than one robot specification to allow the client to cycle through all available robots. A sample command to start the simple client is therefore simple_client --port 4567 --robot Astroboy --robot R2D2


The simple client program should receive commands from the user. It is up to you to decide if you want to accept key strokes, mouse input, or joystick commands. The user should also be able to cycle through all robot that were specified on the command line.

Command Transmission Language

The simple client should broadcast commands via udp. Each command consists of an ASCII string terminated by a newline. Each command contains the robot name, the angle to turn in radians (+ =turn to the right, -=turn to the left), and the distance to travel in millimeters (+=forward,-=backwards) as floating point numbers. The commands in the following form:

	... Robot1 turn 4.5 degrees to the right and go 10cm forward
	R2D2, 0.139,-50.00\n
	... R2D2 turn 8 degrees to the left and move 5cm backwards

A simple client called "simple_player" is available for you to get you started.


All your code must run on the computers in the Linux lab. The firmware for the robot must be implemented using brickos and lnpd. You can use any programming language you desire to implement your client.

Create a directory named "student-id_assignment1" (your student id), and with three subdirectories (firmware, command-server, and human-player) in this directory. Put the source code for the three parts of the assignment into the corresponding subdirectories. Create a standard textfile file README in each subdirectory giving a one page writeup of your solution.

In the one page writeup, briefly describe:

  1. technical details of your implementation,
  2. related work (that is information that you used to help you create your solution) that you found on the Internet, my lecture slides
  3. approximate percentage of work that each student has done on this part of the assignment,
  4. problems that you encountered and how you solved them

Create a compressed tar file of the directory "student-id_assignment1"and email it to