OS
Operating
Systems
and
Real
Time
Operating
Systems
General information

Project of Fall 2011: "Mini basket-ball game"

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 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 mini-basket-like competition. The competition lasts 5 minutes, and is as follows:
  • One, two or even more 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. This arena is divided in two squares of equal size defining starting locations of robots. At each side of the arena is located a basket aimed to receive either red or blue balls.


  • this is a PNG


  • Four balls are first placed in the arena: two blue balls, two red ones. Balls are placed on the middle line.
  • Robots must grab the balls, and bring them to the baskets. 1 point is given when a robot manages to grab a ball. 1 point is given to a robot when it manages to bring it into a basket. And two additional points are given to this robot if the color of the basket and of the ball are the same.

  • At the end of a competition, the winning robot is the one with the highest score.
Tournaments will be organized: with only one robot in the arena, and then with two or more robots at the same time in the arena, so as to select winners (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 12th 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:
    • grab a ball located right in the middle of the arena.
    • grab a ball located in the middle line.
    • grab a ball located at a random position of the arena.
    Thus, we'll first evaluate, for each robot, the three aforementioned points. Then, we'll make competitions, i.e., several robots at the same time trying to grab the balls. If your robot can already bring the ball to the side of the arena and throw it away, you'll try to demonstrate this as well.

  3. The 15th of February, 2012: final competition. For this competition, the website must be fully completed. Also, during the competition, I will interview each member of the group, so as to understand the contribution of each member. Robots must be able to grab balls, and bring them to the right backet.

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.

Groups

  1. Group #1(Alaboardage): Nicolas Bonopera, Florian Frick, Marouane Amamou, Emilien Kofman

  2. Group #2 (Dunking Ratus): Amaury Heckmann, Alexandre Lacheze, Pierre Guilleminot

  3. Group #3: Sylvain Monne, Lorenzo Rande, Jordan Pitier, Jean-Remy Bancel

  4. Group #4 (YuYu): Anthony Pierotti, Yuxin Zhang, Yue Zheng

The NXT box, and batteries

  • Robots may be borrowed from Marie-Laure Victorin, at the IT Department's (First office on the left, in the corridor starting from the Forum, West direction). Please, take care not to loose parts, especially cables and sensors.

  • Batteries may be borrowed from Frank Heurtematte (IT department). When they are discharged, you may pick up a new set of charged batteries from his office.

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.5, it works fine. But apprently, it does not work with 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

  2. Then, I have uncompressed it, installed it in /Applications/nxt

  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:
  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 competition

Lab session before competition

Final competition