Installing Code to a Robot - northern-bites/nbites GitHub Wiki

1. Connect to a Robot

Turn on the robot you want to use and make sure you can connect to it. See Connecting to a Robot for more. However, we’re not going to start here connected to a robot, so if you’ve connected, type logout.

2. Compile your code

cd into nbites/src/man and type make cross. Most of the fields are correct already, but some need to be changed. Specifically,

@PYTHON_PLAYER@: 'pBrunswick' is our normal field player and is probably what you're looking for. However, we have a few other useful players:

  • 'pSnapshot' is the player we use for taking logs; in playing state, the robot will stand still and pan
  • 'pKicker' is the player we use for testing single SweetMove motions
  • 'pGoalie' is our goalie player, which runs completely different code from our other field players
  • 'pWalker' is used for taking walking logs; in playing, the robot will alternate walking around and panning

@REMOTE_ADDRESS@: <robot name> if you are using a wireless connection (e.g. mal) or <robot name>.local if you are using a wired connection (e.g. mal.local)

@ROBOT_PLAYER_NUMBER@ Usually doesn't matter for testing code, except if you are using pBrunswick, in which case:

  • 1 is goalie
  • 2 and 3 are defensive players if you're using pBrunswick
  • 4 and 5 are offensive players if you're using pBrunswick; 4 will always chase the ball

BUILD_PROTOBUF: off

CMAKE_BUILD_TYPE: release

COLOR_TABLE: <path to your color table file> (usually in ../../data/tables) (Typically whatever is in here already is fine.)

USE_LOGGING: Turn on logging to enable logging! This will let you connect to the robot through our tool, which is super handy even if you aren't logging.

V5_ROBOT: Turn on if you are using a v5 robot (superhero name); turn off if you are using a v4 robot (Firefly character name)

After you've set all of the compile options type c to configure and g to exit and generate the make files which will govern the compilation of our code.

3. Install on to the robot

Run make install. Usually you will want to add -j to make it go faster (or -j<number of threads>). This will take a while the first time you run it, but subsequent installs will be faster. If you are experiencing problems, try running make clean to delete the saved settings.

4. SSH into the robot

Open a secure shell on the robot by running ssh nao@<robot address> (e.g. ssh nao@mal).

5. Restart the robot to run the code

In the shell, run man restart. The robot will do a soft reset, which will take about ten seconds, then the robot will stand up.

Remember that when you first start the robot, it will be in initial state (and probably not doing anything). Single chest button presses switch the states. The order is: Initial -> Ready -> Set -> Playing <-> Penalized (any button presses after the robot is in playing will just switch the robot between penalized and playing; to return to initial do four button presses)

So to get to playing press the chest button three times! It should say 'GAME_PLAYING' when it is in the correct state. The chest button should be green.

Our robots get tired quickly so make sure you kill stiffnesses by tapping the chest button twice when you are not actively running the robot around. To reenable stiffnesses when you are ready press the chest button three times.

Turning off the robot

Remember to turn off the robot when you're done! Two chest button presses remove stiffnesses. Then, hold the chest button down until the robot’s lights turn off. Don’t release the chest button once the noise plays! The noise will fool you - the robot is only off once the lights are off.