Real pods under your camera
With a camera over a table and real pods, your laptop is the link: it watches the table, drives the pods over Bluetooth and sends everything to your room's arena. There are no corner markers. One pod drives a small circle to measure the table, and then you draw the arena on the camera's picture.
What the laptop needs
- Docker, and a copy of the Plato Pod folder. The camera program runs in the platform's container, so nothing else is installed; the first start fetches the container, about 5 GB.
- Linux, for the camera and Bluetooth inside the container.
- The pods' settings. Pods built differently drive differently. Copy
config/agent/pods.example.yamlto.platopod/pods.yamlin your home folder and keep the pods you have: each pod is listed by its tag, with its own motors and wheels. A pod not listed takes the blue pod's settings.
Before the class
- Make a room (see Run your own room) and open its console on the laptop with the camera.
- Fix the camera so it cannot move, looking down at the table. It can be tilted. If the camera or the table moves later, the arena has to be measured again.
- Switch the pods on, and put one near the middle of the picture with room around it.
- Start the camera program on the laptop, in a terminal, from the Plato Pod folder. The room's page has the command for each arena: open camera laptop under the arena and press Copy. It looks like this:
tools/agent.sh --server https://a.arena.platopod.com --pin <PIN> --camera "Global Shutter" --pods 6 --radio ble--serveris your arena's address, the one the console opens on.--pinis the room's teacher PIN, shown on the room's page.--cameratakes the camera's name, or part of it ("Global Shutter"for the IR camera), or its number (0).--podslists the tag number on each pod, for example--pods 5 6.- Stop it with Ctrl+C.
- In the console, the top bar says No arena yet, and the pods appear where the camera sees them.
Measure the table
- Open the Arena sheet. It says The table has not been measured.
- Press Calibrate. The pod drives a small circle. The sheet shows Measuring the table… and how far it has got.
- When it finishes, the sheet says Table measured.
The lap also fits the camera's lens to the pod's wheels, so the measurements get better each time.
Draw the arena
- In the Arena sheet, press Draw the arena. In 3D, the camera's picture is laid on the table seen from above.
- Choose Rectangle and click two opposite corners, or Any shape and click each corner in turn, then Close.
- Every corner must stay inside the dashed outline: that is what the camera sees. A rectangle turns red when a corner leaves it.
- Press Confirm. The top bar shows the arena's size, and the pods are kept inside it.
To start again, press Draw a new arena. This removes the arena and stops the pods until you draw the new one.
The next time
The laptop keeps the table's measurement and the arena in the .platopod folder in your home folder. At the next start, the Arena sheet asks Use the previous arena?:
- Use it only if the camera and the table have not moved. It is checked as soon as a pod's tag is seen.
- Discard it and press Calibrate if anything has moved.
Leave out --calibration when you start the camera program: a different calibration file given there takes over from the one the last lap kept.
Light
A dark table hides the tags. In the Layers sheet, set Camera brightness to Set by hand:
- Exposure: shorter keeps moving pods sharp.
- Gain: in a dim room, raise the gain rather than the exposure.
You can also give the light at the start, with --exposure and --gain.
When it goes wrong
| Problem | Fix |
|---|---|
| The top bar says Camera lost: check its cable | The laptop has had no picture for 2 seconds, and the pods' places are withdrawn. Plug the camera back in, in any port: the program finds it by name within a few seconds. |
| The top bar says Camera laptop off the line | The laptop changed network, or the Wi-Fi dropped. Wait: the program reconnects by itself within about 15 seconds. |
| Calibration failed: lost sight of the pod | Keep the pod in the picture and nothing over it, then press Calibrate again. |
| Calibration failed: the pod drives the wrong way from its tag | The lid is on the wrong way round. Turn it, then press Calibrate again. |
| Calibration failed: another pod moved, or the pod is not moving | Check each pod's tag matches the number in --pods, that it is switched on, and that pods.yaml lists its settings. |
| A pod drives the wrong way, or curves | Its settings are another pod's: list it in pods.yaml under its tag. |
| Arena stopped: the camera or table may have moved | Look at the picture. If the dashed outline is still on the table, press It is still right; otherwise Measure again. |
| A pod is not seen | Make the table brighter (see Light), and keep the tag flat and in view. |
| The arena sits a little off the table | Raised things lean away from a tilted camera. Draw the corners where the table's edge is in the picture. |
| No Bluetooth on Linux | Run rfkill unblock bluetooth and start the program again. |