This guide details the steps required to set up the robot for RoboCup games. It assumes you are familiar with the normal codebase and robot set up, as per the Getting Started page. The main way to set up the robot involves using the RoboCup configuration tool in the main codebase. Manual set up is also detailed on this page.
RoboCup Configuration Tool
The RoboCup configuration tool involves an ncurses interface for easy set up of the robot in a game. It contains sections for network settings and general game configuration.
To run the RoboCup configuration tool, run ./b configure -i
and turn on ROLE_robocupconfiguration
. Press c
to configure and g
to generate. Run ./b build
to build the binary.
It is possible to run ./b run robocupconfiguration
locally to see the tool, but it is best used on a robot.
Install the files to robot number X
with ./b install -co nX
. Alternatively, ./b install -co -u nubots <robot's IP address>
if X
is unknown.
On the robot, run sudo ./robocupconfiguration
. sudo
is required if changing any network settings.
The following code snippit shows what the ncurses terminal interface used in the RoboCup configuration tool looks like.
┌─────────────────────────────────────── RoboCup Configuration ──────────────────────────────────────┐│ ││ Networking Game Configuration ││ ││ Hostname : nugus4 ││ Robot Name : frankie Player ID: 4 ││ Wifi Interface : wlp4s0 Team ID : 1 ││ IP Address : 10.1.1.4 Position : DYNAMIC ││ SSID : epsilon-x ││ Password : ││ ││ ││ Commands ││ ENTER Edit F Refresh C Configure S Start RoboCup E Enable Wifi X Shutdown ││ SPACE Toggle R Reset N Network D Stop RoboCup W Disable Wifi ││ │└────────────────────────────────────────────────────────────────────────────────────────────────────┘
Entry | Description |
---|---|
Hostname | This is non-configurable and displays the hostname of the system. |
Robot name | Displays the robot name according to the system. The space bar can be used to toggle through known robot names. The robot name is important for loading in the correct configuration. |
Wifi interface | This is automatically detected and shouldn't be changed. |
IP Address | The current IP address of the robot/computer. It can be toggled with space bar through different common IPs, using the player ID as the last number. For RoboCup, this should be set to 192.168.1.X for normal games, 192.168.31.X for drop-in games where we are on Team A, and 192.168.32.X for drop-in games where we are on Team B. |
SSID | This is the name of the wifi we are connected to. This field can be toggled with the space bar to go through each RoboCup field SSID, and automatically add in the associated password for that field. RobocupConfiguration.yaml contains the list of SSIDs and passwords, to be updated at the competition. |
Password | This should be set before configuring the network and is the password for the wifi. |
Player ID | This is the ID of the robot, and should correspond to the number displayed on the front of the robot. It is important that there are no duplicate IDs, as this information is used in robot-to-robot communication to identify robots. The player ID should be the last number in the IP address. |
Team ID | The team ID must correspond to the ID specified in the GameController configuration for NUbots. In drop-in games this is 31 for Team A and 32 for Team B. The third number in the IP address must correspond to the team ID. |
Position | The soccer position of the robot when it plays. This can be toggled through striker, defender, goalie and dynamic. Typically, field players are dynamic and goalies are manually set. |
Command | Key | Functionality |
---|---|---|
Edit | ENTER | Edit the field currently highlighted. Press ENTER again when finished. |
Toggle | SPACE | Toggle between pre-determined fields, where applicable. |
Refresh | F | Refreshes the ncurses UI. |
Reset | R | Resets to the current values on the system. Useful if you haven't saved yet and want to start over. |
Configure | C | Writes to the configuration files. |
Network | N | Writes to the configuration files and restarts the network services. |
Start RoboCup | S | Starts the RoboCup service, which runs the robocup binary, including on restart. |
Stop RoboCup | D | Stops the RoboCup service, and should be done when a robot is finished with a game. If this is not done then the next time someone uses the robot it will move. This can also cause robots out of the game to interfere with other robots behaviour due to robot-to-robot communication. |
Enable Wifi | E | Enables the wifi service, allowing a robot to connect to a RoboCup field. |
Disable Wifi | W | Disables the wifi service, to prevent a robot connecting to a RoboCup field. |
Shutdown | X | Shuts down the RoboCup configuration tool. |
During RoboCup set up days check that the entries in RobocupConfiguration.yaml
match the information provided by the TC/OC of the league.
- Set up the SSID and password entries for easy toggle of each field.
- If our team ID changes, both the team ID in
GlobalConfig.yaml
and the IP addresses inRobocupConfiguration.yaml
must be updated.
The IP addresses should follow the schema 192.168.<team_id>.<robot_id>
. In the configuration file, X
is used to represent the robot number, so that it can be dynamically set.
When setting up for a game:
- Connect to the robot using the portable monitor and keyboard and run
sudo ./robocupconfiguration
. - Check that the robot name and player ID match what is on the front of the robot. For drop-in games, the player ID is given by the TC/OC.
- If the player should be a goalie, toggle the position field to goalie.
- Toggle the IP address to either
192.168.1.X
for a normal game,192.168.31.X
for a drop-in on Team A, and192.168.32.X
for a drop-in on Team B. - Toggle the SSID to the correct field, usually denoted by A, B, C or D.
- Configure (C) and set up the network (N).
- This should work without a reboot. Check using
wpa_cli status
in the command line to check connectivity to the correct wifi network. - Use the
gamecontroller
program to check if the robot connects to GameController. - Start the RoboCup service. At the end of a game, stop it.
Manual Method
The manual method without the tool is detailed here in case a more in depth understanding is needed.
Networking
The networking on the robot needs to be changed from the default NUbots laboratory network to the RoboCup field network, or to a secondary router in the laboratory for practise games. These steps involve changing configuration files locally on a computer and then installing them to to the robot and running the systemconfiguration
program.
Checkout the RoboCup branch and open
modules/tools/SystemConfiguration/data/system
. If there is no RoboCup branch yet then you will need to create one. If you are running a practise game in the laboratory, you can make the changes locally or in a practise game branch.Rename
default/etc/systemd/30-wlp58s0.network
todefault/etc/systemd/40-wlp58s0-robocup.network
. Note that this is locally within the codebase, not on the robot.Open
default/etc/wpa_supplicant/wpa_supplicant-wlp58s0.conf
and add the following block to the end of the file:network={ssid="SSID"psk="PASSWORD"priority=3}SSID
is the name of the wireless network andPASSWORD
is the password for the network.priority
should be the highest number priority in the file.For each robot
X
do:Rename
nugusX/etc/systemd/network/40-wlp58s0-robocup.network
tonugusX/etc/systemd/network/30-wlp58s0.network
.Edit this to match the network information for the secondary router. At RoboCup, you will need to edit this to match the networking information given to you by the Technical Committee.
Address
is the address of the robot. When SSHing to the robot, this is the address you will use. It is defined by the subnet, the team number, and the robot number. Usually the subnet mask is255.255.0.0
, which indicates that the first two numbers define the subnet. The full address will be192.168.TEAM_NUMBER.ROBOT_NUMBER
or10.1.TEAM_NUMBER.ROBOT_NUMBER
.Normally,
Gateway
andDNS
are not needed for RoboCup so you can remove them from the file.Copy the settings under
[Network]
from the file in the previous step and replace them innugusX/etc/systemd/network/10-bond0.network
. This is important if thebond0
network isUP
on the robot.In a terminal in the root of the NUbots repo, build and install the configuration files with
./b configure && ./b build && ./b install -co <ADDRESS>Where
<ADDRESS>
is the robot address from the previous step.ssh
onto the robot usingssh nubots@<ADDRESS>
.When running via
ssh
make sure that you have a monitor and keyboard nearby to handle any mistakes.Run
sudo ./systemconfiguration
on the robot.Restart the network services on the robot:
sudo systemctl daemon-reloadsudo systemctl restart systemd-networkd wpa_supplicant@wlp58s0
To change back to the NUbots laboratory network:
Reset the configuration files locally to the same as the main branch.
Run
./b build
.For each robot, run
./b install -co <ADDRESS>
.On each robot, run
sudo ./systemconfiguration
and restart the network services.sudo systemctl daemon-reloadsudo systemctl restart systemd-networkd wpa_supplicant@wlp58s0
Troubleshooting
If you are experiencing problems, it may be beneficial to reset any changes and start again. If you cannot connect to the robot wirelessly, you can connect to the robot via ethernet. If you cannot connect to the robot via ethernet, you can plug in a monitor and keyboard to directly run commands on the robot.
The following general information may be useful in understanding the networking set up if anything goes wrong.
The robot will default to using the first alphanumeric network configuration file. If you have multiple network configuration files, you can change the priority of the network configuration files by changing the number in the filename. For example, 30-wlp58s0.network
will be used before 40-wlp58s0.network
.
eno1
refers to ethernet. wlp58s0
refers to wireless. bond0
refers to the bonded network interface. This abstracts the ethernet and wireless configurations so it is easier to switch between them.
The network configuration files on the robot are found in /etc/systemd/network
. The wireless network settings are found in /etc/wpa_supplicant/wpa_supplicant-wlp58s0.conf
.