-
Notifications
You must be signed in to change notification settings - Fork 0
How to run the code on a NAO
The framework can be ran through Pepsi. Pepsi is a tool that can be used to configure, set up, and deploy NAO robots. The --help flag can be used to get an overview of Pepsi's capabilities, which includes the sub-commands for tasks such as connecting to a NAO shell via ssh, controlling the hulk framework, and configuring the wireless network on the NAO.
./pepsi help
First, we need to compile the code. The code needs to compiled with the --target nao flag, because it uses a different computer architecture and needs some special configuration. To compile for simulation, you can leave this flag out.
./pepsi build --target nao
After compilation has succeeded, the code needs to be uploaded to the robot. You can refer to a robot by their number (ex. 22 for wired, 22w for wireless, robot number is 22) or their IP. The NAO will automatically connect to the wireless network in the Robolab, so it is easiest to use 20w if you want to connect to robot number 20. The robot number can be found on the sticker on their head.
./pepsi upload <number>
The robot should now be ready for play.
When bringing this into practice there have been found some issues with WSL.
When having an error about LD_LIBRARY_PATH, you can get past the error using the following command.
unset LD_LIBRARY_PATH
Create a /etc/wsl.conf file, add these lines:
[interop]
appendWindowsPath=false
https://github.com/microsoft/WSL/issues/5208
To get the robots ready for a game, you use the ./pepsi pregame command. Use the pregame command to set the location, network and player number (assignments) of the robots.
Usage of the pregame command is as follows:
./pepsi pregame [OPTIONS] <LOCATION> <NETWORK> <ASSIGNMENTS>...
-
to check the available locations use:
./pepsi location list -
to check the available networks use:
./pepsi network list -
to check the robot assignments use:
./pepsi playernumber --help
You see that the assignment is as follows: robotnumer:playernumber. Player numbers start at 1.
So if we want to play a match with Momo, robot number 24, on our lab field while connected to SPL_A as player number 4 we would type:
./pepsi pregame robo_cup_2022_a SPL_A 24w:4
the 'w' after the robot number is to indicate it's done wireless, when connected with a cable leave out the 'w'
!!! IMPORTANT THAT YOUR LAPTOP IS ALSO CONNECTED TO SPL_A !!!
Known errors:
rsync: --mkpath: unknown option
rsync error: syntax or usage error (code 1) at main.c(1596) [client=3.1.3]
Failed to power 10.0.24.22 off
Caused by:
rsync command exited with exit status: 1
Error: Failed to execute pre_game command
fix:
sudo apt-add-repository ppa:savoury1/utilities
sudo apt-get update
sudo apt-get install rsync