![](https://csdnimg.cn/release/download_crawler_static/10288704/bg13.jpg)
2.5. COPYING THE COMPILED CODE B-Human 2013
installations
6
can be handled using the installRobot script, which works quite similar to the
installRobot.usb script, but without the necessity of an USB flash drive. Note: Installing the
B-Human basic system the first time after flashing the robot should always be executed using
the installRobot.usb script.
For example, to update an already installed NAO, run:
./ ins tallR obo t Penny 169 .25 4.2 20. 18
2.5 Copying the Compiled Code
The tool copyfiles is used to copy compiled code and configuration files to the NAO. Although
copyfiles allows specifying the team number, it is usually better to configure the team number
and the UDP port used for team communication permanently in the file Config/settings.cfg.
On Windows as well as on OS X you can use your IDE to use copyfiles. In Visual Studio you
can run the script by “building” the tool copyfiles, which can be built in all configurations. If
the code is not up-to-date in the desired configuration, it will be built. After a successful build,
you will be prompted to enter the parameters described below. On the Mac, a successful build
for the NAO always ends with a dialog asking for copyfiles’ command line options.
You can also execute the script at the command prompt, which is the only option for Linux
users. The script is located in the folder Make/<OS/IDE>.
copyfiles requires two mandatory parameters. First, the configuration the code was compiled
with (Debug, Develop or Release)
7
, and second, the IP address of the robot. To adjust the
desired settings, it is possible to set the following optional parameters:
Option Description
-l <location> Sets the location, replacing the value in the settings.cfg.
-t <color> Sets the team color to blue or red, replacing the value in the settings.cfg.
-p <number> Sets the player number, replacing the value in the settings.cfg.
-n <number> Sets team number, replacing the value in the settings.cfg.
-r Restarts bhuman and if necessary naoqi.
-rr Restarts bhuman and naoqi.
-m n <ip> Copies to IP address <ip> and sets the player number to n. This option
can be specified more than ones to deploy to multiple robots.
-wc Compiles also under Windows if the binaries are outdated.
-nc Never compiles, even if binaries are outdated. Default on Windows/OS X.
-d Removes all log files from the robot’s /home/nao/logs directory before
copying files.
-h | --help Prints the help.
Possible calls could be:
./ co py files Develo p 134 .10 2.2 0 4.2 29 -n 5 -t blue -p 3 -r
./ co py files Releas e -m 1 10.0.0.1 -m 3 10.0.0.2
The destination directory on the robot is /home/nao/Config. Alternatively the B-Human User
Shell (cf. Sect. 8.2) can be used to copy the compiled code to several robots at once.
6
Re-installation might be useful when updating scripts etc.
7
This parameter is automatically passed to the script when using IDE-based deployment.
19