Tutorial: running openSDK with USARSim simulator

Here we describe the steps to run openSDK and USARSim along. You'll need two separate computers for the job (or a virtual machine): one with linux to run openSDK and another with Windows to run USARSim. They should also have a fast network connection between them, to allow a more realistic simulation environment.

1. Compiling the Source Code

The first thing to do after installing openSDK and USARSim is to compile your own source code using the openSDK toolchain. This is a simple process and shouldn't require any change to the build process other than. changing the OPEN-R SDK root. If you are using the Sony style makefiles, you just need to run 'make clean' and then run 'make OPENRSDK_ROOT=/path/to/openSDK/root install'.

In the unlikely case you need to write specific code for openSDK, it automatically defines the OPENSDK constant (that can be tested with '#ifdef OPENSDK').

2. Starting the Simulator

The second thing to care about is the USARSim simulator. It runs on top of Unreal Tournament 2004, so you'll need a license to run the simulator. To launch the simulator go to the Start menu then Programs -> USARSim -> Maps -> DM-spqrSoccer2006 (for example) -> Run-Server. It will open a console, which you can minimize.

3. The Image Server

One of the openSDK+USARSim integration features is live image feeding from the simulator. For using this feature you need to download the Image Server for USARSim-Aibo edition. After downloading the zip file from here, extract its contents to a folder. No installation is necessary.

To run the image server, just launch the 'Release\ImageSrv.exe' program and click on Start. However this is not enough. Then you need to click on the 'Show UT' button. This will show you a little window with the image that the robot will see. When the robot appears (after you launch your program) you'll need to click on the window with the left button of the mouse until it appears the image from the robot camera. Example:

4. The openSDK/USARSim connector

Now turn back to the linux computer and open a console. then run:

cd /path/to/openSDK/servers/usarsim

# if you haven't build it already
make

# see the available options
./USARSimServer --help

# typical run
./USARSimServer --usarsim-host=ip-of-the-usarsim-machine /path/to/the/MS/dir

5. Launching your Program

Finally you are ready to launch your program! To launch it, open another console and type something like:

cd /path/to/openSDK

./OPENRloader /path/to/the/MS/dir

After pressing enter it should start your program. If it is the first time you are running it in other platform than AIBO, it is very probable that the program will crash, due to some hidden bug your program might have that was uncovered by some CPU/OS pikiness. In the case you think it's a bug in openSDK, please report it in our Bug Tracker.

To stop the program just hit Ctrl-C and it will start the shutdown procedures. The openSDK/USARSim connector will be also shutdown. You'll have to start it again in the case you want to run your program again (and before you start the OPENRloader).

 

AIBO and OPEN-R are a trademark or a registered trademark of Sony Corporation.