General information

Project of Fall 2012: "Mini soccer"

Mindstorms NXT(TM) robots are robots made of a main unit and a set of sensors and actuators. They are sold by Lego for a few years now. Many very tricky things have been made using the standard kit (see for example "Mindstorms: Not just a kid's toy"). You may also visualize interesting videos on youtube, and for example a marble conveyor, a car factory, a walking dog, a scorpion, a forklift truck, the "holononic drive", and a rubik's cube solver. You can also find some other nice systems on battlebricks.

The project you ought to do is not as complex as some aforementioned systems, but yet, it requires to spend quite a lot of programming / exploration time on the robot and its interfaces (sensors, actuators).

Project objectives

The robot you have to build shall be the winner of a soccer-like competition. One competition round lasts 5 minutes, and is as follows:
  • Two robots are placed in an arena. The arena is 1.2 meters large and 2 meters long, and protected on all sides with a fence high of 10 cm. Each side contains a robot starting zone delimited with a black line. The middle line of the arena is also black.

  • this is a PNG

  • Four balls are first placed in the arena. Each side gets two balls located at 20cm of the middle line: one at 20 cm of the left fence, and the other at 20cm of the right fence.

  • A robot shall never get in the other's robot camp. That is, each time one of his wheel touches the middle line, the other robot is given 1 point. If the robot completely go through the middle line, the other robot gets 5 points.

  • 3 points is given to a robot throwing a ball located in its camp to the opposite camp back fence. The 3 points are given only for a direct shot, i.e., bouncing on lateral fences is not allowed to get the three points.

  • At the end of a competition, each robot gets a number of points equal to the number of balls located in the other's robot camp. Then, the winning robot is the one with the highest score.
Tournaments will be organized: with only two robots in the arena (on robot in each camp), and then with two robots in each camp. Medals will be finally given to robots (gold, silver and bronze medals)

Specification of the robot

  • The robot must be contained in a cube of 30 cm maximum on each dimension, apart from the height, to support the compass sensor, and apart from the ball.

  • It may change its shape (by deploying elements, or withdrawing some) during game phases, but it must remain all the time in the aforementioned dimensions.

  • Your robot is allowed to lose parts on purpose - or not ;-) - during the game.

  • It is forbidden to send orders - remotely or not - to your robot while it is playing: it must be autonomous as soon as the game starts, and until it ends.

Deadlines and reports

There are two deadlines:
  1. The 7th of December, 2011, before the lecture on OS starts: you shall have started to make a website on your robot, and a first version of your robot shall be operational.
  2. We'll first test each robot alone. Each robot - alone in the arena - shall be able to:
    • Navigate within its own camp, without entering the opposide camp.
    • Throw a ball to the other camp, with the ball located in the initial ball positions.
    • Throw a ball to the other camp, with the ball located at a random position of the camp.
    Thus, we'll first evaluate, for each robot, the three aforementioned points. Then, we'll make real competitions if the robots are able to do it.

  3. The 25th of January and 13th of February, 2013: intermediate and final competition. For the final competition, the website must be fully completed. Also, during the final competition, I will interview each member of the group, so as to understand the contribution of each group member.

Your report consists in a website. The web site shall contain the following information:
  • Description of the architecture of the robot: sensors and actuators, etc. Pictures of your robot on the web site would be appreciated.

  • Algorithms used for the two game stages. Don't provide a source code here, just try to describe the algorithms using a pseudo C language. Also, do comment those algorithms, and explain why you think they are efficient.

  • Source code, and instructions on how to use that source code: how to compile it, how to download it on the robot, and how to start the robot.

  • Videos / pictures of your robot in action [we may provide you with cameras and video recorders if necessary].

  • How you have worked in the group, i.e., who made what. Be clear about that. Each member of groups will get an *individual* grade.


  1. Arkya: Rémi Marchand, Matthieu Andolfatto, Yinying Pan, Vincent Grevendonk

  2. Proxy Lady: Ettore Barattelli, Alberto Caputo, Tino Fuhrmann, Alberto Guasco

  3. Sylane: Adrien Canuel, Elsa Mpondo-Dika, Tuan Truong Ngoc

  4. Optimus KAD: Kamel Dridi, Alain Du Pierre, Quynh-Giang Dam

The NXT box, and batteries

  • Robots may be borrowed from Frank Heurtematte, at the IT Department. Please, take care not to loose parts, especially cables and sensors. A battery charger as well as 6 batteries are provied with the robot.

Working with NXC (Not eXactly C)

A good way to program your robot is to use the C language, and more specifically the NXC environment. That environment provides a compiler for programs written in NXC, and an uploader to upload to resulting program to the NXT robot. Good points about NXC is that:
  • It is free

  • You don't need to change the firmware of the NXT robot, i.e., nothing has to be changed on the robot to be able to use NXC.

  • NXC is a language which is very close to the C language: you don't need to learn a new language. There are several tutorials on the web site, as well as a reference guide.

I have tested it on my Mac under MacOS X 10.7 (Lion).
Here is how I have made on my Mac (it should work quite the same on a PC running Windows, very good intructions are provided on the NXC environment web site):
  1. First, I have first dowmloaded the NXC package. I have uncompressed it, and installed it in e.g., /Applications/nxt
  2. I have also downloaded and installed the Phantom Drivers from Lego

  3. I have modified my .bashrc file so as to be able to execute NXC applications from a shell. More precisely, I have added the following line to my .bashrc file:
  4. export PATH= $PATH:/Applications/nxt

  5. I have downloaded the tutorial samples code, and I have unzipped it, let say in /Users/ludovic.apvrille/code

  6. I have compiled the "5_light.nxc" code as follows, from a terminal:
  7. $ cd /Users/ludovic.apvrille/code
    $ nbc -O=program.rxe 5_light.nxc

  8. I have plugged my NXT robot on a USB port, and switched it on. Then, I have run the following command on my Mac:
  9. $nxtcom program.rxe
This last command uploads the program on the NXT robot. Then, from the NXT robot, you may run that program, by selecting it using menus of the NXT.

Competitions results

First tests, the 7th of December, 2012

this is PNG

this is a PNG

Second tests, January the 18th, 2013

this is a PNG

Competition, Janauray the 25th, 2013

In one-vs-one competition, robot #2 xas first, robots #3 and #4 were second, and robot #1 was last.

In two-vs-two competition, robot #2 was again first, and all others were second with the same number of points.

this is a PNG

this is a PNG
A few pictures from the competition:
this is a JPG
this is a JPG
this is a JPG