-
Notifications
You must be signed in to change notification settings - Fork 38
Compiling and Updating Code
Now that you have your development computer and robot (or simulation environment) setup we can compile and run the code. This page will go over how to compile and update the code to use with each robot or simulation.
Grab our code from github
The UPennalizers/Lib
directory contains all of the library code that you will need to compile. This directory contains all of the platform specific libraries as well as the platform independent libraries. We provide a Makefile that will make compiling the code for your desired platform easy.
From the UPennalizers/Lib
directory you will need to run:
make <platform>
where <platform>
is the platform from the list below that you are using.
platform | description |
---|---|
setup_webots_nao | Compiles and sets up the code for the Nao Webots simulation |
setup_webots_op | Compiles and sets up the code for the DARwIn OP Webots simulation |
setup_nao | Compiles and sets up the code to run on the Nao V3.x robot |
setup_naov4 | Compiles and sets up the code to run on the Nao V4 robot |
setup_op | Compiles and sets up the code to run on the DARwIn OP robot |
For example, to compile the code to use with the Nao Webots simulator you would run:
make setup_webots_nao
The Makefile will compile all the necessary code for your platform and copy the resulting libraries into the UPennalizers/Player/Lib
directory so that they will be available to the main Lua program.
When developing for the actual robots you will need to copy any changes you make onto the robot. This is simply done by replacing the ~/Player
directory on the robot with your UPennalizers/Player
folder.
We recommend setting up a script using rsync to make pushing changes to your robot easier. Something similar to this:
rsync -avr --exclude=".*" UPennalizers/Player/* [email protected]:Player/
where you replace 'robot' with the name of the platform you are using (ie: 'nao', 'op').
If you are using the Nao robot then you will also have to compile our custom NaoQi module. Note: NaoQi and its preferences are copied onto the with the install script mentioned here.
- Download NaoQi Atom Cross-Compilation Toolchain from Aldebaran. /path/to/ctc will be used from now on as the path to the extracted cross compilation toolchain.
- Download and install qiBuild
- Create qiBuild toolchain for the Nao Atom
qitoolchain create cross-atom /path/to/ctc/toolchain.xml
- Configure the project
qibuild configure -c cross-atom
- Build the library
qibuild make -c cross-atom
- Compile NaoQi
cd UPennalizers/Lib/NaoQi_v1.12
make
- Copy the compiled libdcmlua.so file onto the Nao:
scp ./build-cross-atom/sdk/lib/naoqi/libdcmlua.so [email protected]:naoqi/lib/naoqi
- Change the
naoqi/preferences/autoload.ini
file on the Nao to be:
[core]
albase
[extra]
devicecommunicationmanager
dcmlua
[remote]
- Restart NaoQi:
nao stop
nao start
You should only need to do this once per robot as we only use NaoQi to provide the access to the actuators and sensors.
##Lua
Included in this release is the source code for the version of Lua used with our code. To compile Lua for the Nao:
cd UPennalizers/Lib/Lua/src
make -f Makefile.cmake
Then copy the './src/build/lua' and './src/build/liblua.so' files to '/usr/local/bin/lua' and '/usr/local/lib/liblua.so' on the Nao.
Note: This files are already copied onto the Nao using the install script discussed here.