OS
Operating
Systems
and
Real
Time
Operating
Systems
General information

Project of Fall 2013: "Mini volleyball"

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 architecture and programming time on the robot and its interfaces (sensors, actuators).

Project objectives

The robot you have to build shall be the winner of a volleyball-like competition. One competition round lasts 4 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 7 cm. Each side contains a robot starting zone delimited with a black line. The arena is cut into two equal parts with a ping-pong net (height=more or less 17cm) fixed with one pillar on each side. Also, so as to be able to better detect the net, a black line will be placed on the ground a 5 centimeters before the net.


  • this is a PNG


  • You are free to use the sensors you want to among the following ones: touch sensor, light sensor, color sensor, ultrasonic sensor (i.e., distance sensor), compass sensor.

  • Each side gets two balls placed at 20cm of the middle line, and 20cm from the fence. Each robot may also contain 2 balls when the game begins. If the robot does not contain any balls, then the team of this robot has the right to put two extra balls at its desired location in its side of the arena.

  • Before a round starts, the two competiting robots are placed in the middle of their black starting zone.

  • A robot shall never touch the net. That is, each time it touches the net, the other robot is given 1 point. Yet, having parts of a robot deployed over the net is authorized, as long as the robot does not touch the net.

  • 2 points is given to a robot throwing a ball to the opposite camp without that ball getting out of the arena.

  • Robots are allowed to throw things - other than balls - in the other robot's camp, but they don't score points for this. Thrown "things" must not be harmful for robots (no water, explosives, or whatever!), but they can be - of course - annoying.

  • At the end of a round, the winning robot is the one with the highest score.
Tournaments will be organized, and medals (master, diamond, platinum, gold, silver and bronze medals) will be given to robots according to their ranking. The ranking is first determined with the number of victories, and then with the number of accumulated points.

Specification of the robot

  • The robot must be contained in a cube of 40 cm maximum on each dimension at start-up.

  • It may change its shape (by deploying elements, or withdrawing some) during game phases.

  • Your robot is allowed to lose/throw 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 16th of December, 2013, 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 touching the net.
    • Throw a ball over the net, to the other camp, with a ball located at a location selected by the team.
    • 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 20th of January: 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 most important points: moving in the robot's camp, and managing balls. 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. Jarvis/Group #1: Matthieu Andolfatto, Tuong Nguyen, Florian Lugou, François Ky

  2. Joker/Group #2: Quoc-Minh Bui, Hoang-An Le, Cu Khoi-Nguyen Mac

  3. RobotEyes/Group #3: Tiago Butzke, Radhwane Chebaane, Simone Montanaro, Suzanne Shoaraee

  4. Robert Paulson/Group #4: Kjell Braden, Damien Roeder, Tarjei Husøy

  5. Group #5: Nicolas Gotchac, Corentin Lacroix, Robin Jollans

  6. Group #6: Dian Yu, Kehe Cai, Pierre-Emmanuel Wulfman

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 provided 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:
  • The compiler is available under the Mozilla Public License.

  • 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 Fantom Drivers from Lego. (If there are not available anymore for download, I've got a copy of them, for both Pc and Mac).

  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 16th of December, 2013




Final competition, the 20th of January, 2014


The ranking is made according to (1) the number of victories, and in case of equality, with (2) the number of points. Note that with this competition, the ranking is the same with the number of victories or the number of points
  1. "Master" medal: Group 3
  2. "Diamond" medal: Group 2
  3. "Platinium" medal: Group 1
  4. "Gold" medal: Group 4
  5. "Silver" medal: Group 5
  6. "Bronze" medal: Group 6