README.md 2.64 KB
Newer Older
Tom Pillot's avatar
Tom Pillot committed
1
# Thymio Game
Tom Pillot's avatar
Tom Pillot committed
2
3
4

A competitive game in groups with Thymio.

Tom Pillot's avatar
Tom Pillot committed
5
6
7
The teams have to create a program to reach the goal as fast as possible while 
avoiding obstacles. 

Tom Pillot's avatar
Tom Pillot committed
8
## Running the game
Tom Pillot's avatar
Tom Pillot committed
9
10
11

The game needs at least Python 3.6.

Tom Pillot's avatar
Tom Pillot committed
12
13
Install it by running these commands (the project depends on pyqt5 so installing 
the requirements can be quite long):
Tom Pillot's avatar
Tom Pillot committed
14
15
16
```bash
git clone https://gitlab.laas.fr/tpillot/thymio-game.git
cd thymio-game
Tom Pillot's avatar
Tom Pillot committed
17
python -m venv venv
Tom Pillot's avatar
Tom Pillot committed
18
19
. venv/bin/activate
pip install -r requirements.txt
Tom Pillot's avatar
Tom Pillot committed
20
21
22
23
```

And run it with:
```bash
Tom Pillot's avatar
Tom Pillot committed
24
python main.py
Tom Pillot's avatar
Tom Pillot committed
25
26
27
28
29
30
31
32
```

## Preparation

Print the tags provided in [apriltags.pdf](apriltags.pdf) and put a tag on each
Thymio with the corresponding color. The activity is meant to be used with VPL,
or the automated start won't work.

Tom Pillot's avatar
Tom Pillot committed
33
34
35
36
It is also necessary to prepare the ground for the race, the ideal would be to have
a start line where the Thymios can be positioned, a finish line, and a path with 
curves and obstacles in between.

Tom Pillot's avatar
Tom Pillot committed
37
38
39
40
41
42
43
44
45
## Choosing a webcam

The first window opened gives you the ability to choose one of your available
webcams. The webcam you choose will be used to scan the tags to register the teams
and to detect when a team has reached the goal. When you are happy with the selected 
webcam, click the validate button.

![](images/webcam_chooser.png)

Tom Pillot's avatar
Tom Pillot committed
46
47
## Register the teams

Tom Pillot's avatar
Tom Pillot committed
48
You will then be able to register the teams before starting the activity,
Tom Pillot's avatar
Tom Pillot committed
49
50
51
52
each team needs to put its name and scan the tag on its Thymio. Then you can
choose an activity and the time of the activity, and press the start button to show
the scoreboard.

Tom Pillot's avatar
Tom Pillot committed
53
54
![](images/team_chooser.png)

Tom Pillot's avatar
Tom Pillot committed
55
56
57
## Scoreboard

The scoreboard window has a timer, an event history, and a webcam highlighting
Tom Pillot's avatar
Tom Pillot committed
58
59
detected tags in real time. The webcam should be placed so that it films the place
the Thymios have to reach in order to win points.
Tom Pillot's avatar
Tom Pillot committed
60
61
62
63
64

To start the scoreboard and all Thymios at the same 
time, you first need to press the blue start button to allow the teams to join the
automated start.

Tom Pillot's avatar
Tom Pillot committed
65
66
![](images/scoreboard.png)

Tom Pillot's avatar
Tom Pillot committed
67
68
At this point, all teams have to click on the **Join activity** button on VPL 
which will first ask them to save their work.
Tom Pillot's avatar
Tom Pillot committed
69

Tom Pillot's avatar
Tom Pillot committed
70
71
![](images/vpl.png)

Tom Pillot's avatar
Tom Pillot committed
72
73
Then VPL should display a message saying that the program is waiting for the activity 
to start. VPL will be unresponsive until the activity is started.
Tom Pillot's avatar
Tom Pillot committed
74

Tom Pillot's avatar
Tom Pillot committed
75
76
77

![](images/vpl2.png)

Tom Pillot's avatar
Tom Pillot committed
78
79
When all the teams have this message, you can start running all Thymios at the same
time by pressing the green start button.
Tom Pillot's avatar
Tom Pillot committed
80
81

![](images/scoreboard2.png)
Tom Pillot's avatar
Tom Pillot committed
82
83
84
85

When the Thymios and the timer start running, the scoreboard is active and each
time the webcam detects a tag, the corresponding team will win points. The amount
of points won depends on the time taken to complete the race.