Read Me
----------------------------------------------
| Space docking game for the Parrot AR.Drone |
----------------------------------------------
CONTENT
1.0 Compiling
1.1 Build flags
1.1.1 Make flags
1.1.2 C++ flags
1.2 Information for specific systems
1.2.1 iPhone
1.2.2 linux
1.2.3 Windows (x86)
1.2.4 Android
2.0 Changelog
3.0 TODOs
4.0 Contributors
4.1 Third party libraries
Project is in alpha state... no version or changelog yet
1.0 Compiling
The buildsystem used for building this program consists of a single
Makefile. This quite simplistic approach makes it probable that you will have
to tune the Makefile to work with your specific system configuration. Below
you find information about availble compiler flags and hints on how to do
so for the all supported operating systems.
1.1 Build flags
There are several flags that can/must be set to modify the building process of
the space docking app. There are two categories: make-flags and c++-flags. If
changing either of the two types of flags the whole project needs to be rebuilt
after a manual clean!
1.1.1 Make flags
Make flags can be set on the command line or by exporting them as environment
variables:
> make AUTHENTICATION_KEY_FILE=keyfile
or
> export AUTHENTICATION_KEY_FILE=keyfile
> make
There are two required flags that need to be set for succesfully building
the space docking app:
AUTHENTICATION_KEY_FILE
Must be a path to the keyfile that is used by the program to authenticate
itself for the webserver (the keyfile is a binary string of data).
PROGRAM_KEY_FILE
Must be a path to a keyfile that will be used by the program to sign
configuration files on the iphone to harden them against data manipulation
to prevent sending of fake scores by the program (also this keyfile is a
binary string of data)
Furthermore, there are the following optional make flags:
FLAGS
Additional flags that are used to invoke all compilers (c, c++, objective-c)
FLAGS
Additional flags that are used to invoke the linker
1.1.2 Compiler flags
Compiler flags can be set using the FLAGS-flag of the Make flags, e.g.:
> export 'FLAGS=-Wall -O0 -g -DHIGHSCORE_SERVER_URL="\"127.0.0.1\""'
Except for the standard compiler flags the following extra flags are supported:
-DNDEBUG
Just as a reminder to set this for the release build as it will not only
disable asserts, but also disable some testing code that otherwise will be
compiled too and reduce performance of the application at several places.
-DLOG_LEVEL=2
Sets log level of reported log messages. There are four levels that can be
set. Higher levels include all lower levels:
0: No logging at all
1: Error messages are logged
2: Warnings are logged
4: Info messages are logged
5: Verbose messages are logged
Logged messages are piped to different targets, depending on the deployment
target. For linux/windows machines this is stderr.
-DNODRONE
Will disable the drone interface. Instead of the drone, a simulator is used
to simulate drone movements in the game. If USE_SIMULATOR_DEBUG_IMAGE is
not set, a simple 160x120 image of red-green-blue-white stripes is generated
used for feature extraction. The feature source is replaced by
"Debug Simulator" to prevent mixing of simulated data with real data in the
production database.
-DUSE_SIMULATOR_DEBUG_IMAGE
Will replace the red-green-blue-white striped image that is used if
-DNODORNE is specified by an image encoded in the file 'DebugImage.cpp.inc'.
At the moment this is an image of a christmas tree encoded in raw RGBA
values.
-DHIGHSCORE_SERVER_URL="\"127.0.0.1/spacedocking\""
Allows to specify a different highscore and feature server url for testing
purposes. Be careful with the number of qotes that are put around the
address. The inner quotes are escaped, because the URL is a string value in
cpp, so the quotes need to be included and quoted for the command line
interface. The url must not include the protocol ('http://') part, but may
specify subdirectories on the webserver (like shown in the example above).
The value defaults to the project's real server URL.
1.2.1 iPhone
Note:
The project avoids the use of Xcode itself as much as possible in order to
achieve platform independence. The is a single Xcode project in the
systems/iphone/SystemBackend/SystemBackend directory which does NOT compile
and is only used for editing .xib files and making use of programming tools like
autocompletion for the GUI development. Don't expect that project to build the
game!
To compile the game for iPhone OS you need to have Xcode installed on your
Mac OS-X machine. Furthermore, you will need the iPhone SDK for iOS at least
version 4.0, though the "buildsystem" has only been tested and used with a
iPhone SDK for version 5.0. Should you use a different iOS SDK version than 5.0
you will need to adapt the settings of the variable $(IOS_SDK_BASE_DIR) in the
Makefile to point to the correct SDK version.
Additionally, you will need the program fruitstrap
(see https://github.com/ghughes/fruitstrap/) and a valid Apple developer
certificate in your key chain to deploy the game on your iPhone (or deploy the
by the Makefile created .app directory by other meanson your iPhone e.g. if you
have a jailbroken iPhone). If you want to run the program on the iPhone
simulator, I suggest that you use the program ios-sim
(see e.g. https://github.com/Fingertips/ios-sim/) to run it.
As first step you will need to build the adapted Parrot AR.Drone Control
Libraries. For this open the xcode project systems/iphone/frameworks/
ParrotARDrone/ControlEngine/iPhone/ARDroneEngine.xcodeproj and build it for your
target system (iOS device or iPhone/iPad simulator).
Unpack OpenCV.
Then, after you changed $(IOS_SDK_BASE_DIR) if required, invoke
make iphone
to build the game for the iphone simulator or
make iphone device
to build the game for a real iOS device. The Makefile is 'multijob'-compatible
so you may combine use 'make -j' to speed up the building process. Note that the
adapted ARDrone SDK needs to be built for the same platform as set here,
otherwise the compilation will fail at the linker stage.
If you want to deploy the game on you iPhone you will now need to sign the game
with your developer certificate. To do so invoke
codesign --sign "[Your developer certificate name]" SpaceDockingApp.app
You find "[Your developer certificate name]" if you previously imported the
certificate on your development machine, by searching your Key Chain using
Applications->Uitilties->Keychain Access of Mac OS-X.
To deploy the game on your iPhone use fruitstrap as follows:
fruitstrap -b SpaceDockingApp.app
If you just want to run the game in the iPhone simulator you can skip the code
signing step. Given you have installed ios-sim you can invoke
ios-sim launch SpaceDockingApp.app
to start the game in your iPhone simulator.
1.2.2 Linux
Note:
Since the AR.Drone SDK of Parrot is severly unstable for non 32bit systems, the
game does not support control of the drone if compiled for linux. Only the game
engine is compiled together with the game logics.
To compile the game under linux you will need the following libraries installed
on your system:
OpenGL development libs, SDL 1.2, SDL-mixer, DevIL
It is probable that the Makefile does not use the correct header and library
search paths. You can add additional search paths by exporting whitespace
separated direecroties through environment variables:
For include search paths: CINCLUDES
For library search paths: LIBPATHS
If you need to alter the flags for the c-compiler or c++-compiler set and export
the environment variables CFLAGS or CXXFLAGS respectively.
After all parameters have correctly been set, simply invoke
make
You may also use 'make -j' to speed up the build process (the Makefile is
'multijob'-capable).
After the build completed you can start the game(-engine) using
./game
1.2.3 Windows (x86)
To compile the game under windows please install MinGW with MSYS. Furhtermore,
you will need the development files (includes + binaries) of the following
libraries:
boost, OpenGL, SDL 1.2, SDL-mixer, DevIL
You can install/unpack the library development files directly in the
apropriate places of the directory systems/win/libs
For include search paths: CINCLUDES
For library search paths: LIBPATHS
If you need to alter the flags for the c-compiler or c++-compiler set and export
the environment variables CFLAGS or CXXFLAGS respectively.
After all parameters have correctly been set, simply invoke
make
You may also use 'make -j' to speed up the build process (the Makefile is
'multijob'-capable).
After the build completed you can start the game(-engine) using
./game
1.2.4 Android
To compile the game for Android, the Android Software Development Kit (SDK) and
Native Development Kit (NDK) must be installed and configured correctly. A manual
for this can be found on the Android Developers website:
http://developer.android.com/sdk/installing/bundle.html and
http://developer.android.com/tools/sdk/ndk/index.html
(SDK version 22.2 and NDK version r8e were used, so it is recommended to use
those versions, especially the NDK version)
As the game uses Boost libraries, these must be compiled using the androideabi
toolchain for usage on Android devices. Although a method to compile Boost for
Android can be found here:
http://www.codexperiments.com/android/2011/05/tips-tricks-building-boost-with-ndk-r5/
It is simpler to download the precompiled package from the archive here:
https://docs.google.com/file/d/0B0b4cc6rR_t3MWV5UnFkTFgtdEE/edit?usp=sharing
This precompiled package also contains prebuilt shared FFMPEG-2.0.2 libraries used
for video-stream decoding. As another option manual installation might be
performed as well using the instructions on:
http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
Extract this archive so that in the "/sources"-folder of the NDK, such that you
have <ANDROID_NDK>/sources/boost/ .
Also, make make sure the correct (converted) authentication key files are present
in spacedockingapp-code/systems/android/jni/security .
To compile the project, open a terminal in spacedockingapp-code/systems/android/
Now the C++ part of the game can be compiled by invoking
./AndroidBuild.sh
Then open Eclipse and choose New -> Android Project from existing code. Browse to
the spacedocinkgapp-code/systems/android/ folder and click next/finish. When the
project is loaded, the app can be run on an device or emulator by right-clicking
the project folder and choosing Run -> As Android Application. It is highly
recommended to run the app on a real device, as compatability with android virtual
devices is questionable.
2.0 Changelog
Version 1.0 (February 8, 2013)
- First release
Version 1.1 (March 12, 2013)
- Font changes
- Text changes on about screen
Version 1.2 (March 21, 2013)
- Added error message when failing to connect to highscore server
- Fixed app rotation bug
- Fixed minimum iphone version
- Added contributors to about screen
Version 1.3 (???)
- Not synchronized scores are now always displayed in highscore
- Resized About button to a smaller info-button in the lower right
area of the start screen
- Fixed behavior of highscore table after not showing up after
initial query (refresh issue)
- Added send research data screen
- Added server side script to remove duplicate visual data samples,
created by a data duplication bug based on a timeout in
DatabaseConnection.cpp. Duplicates are removed on the basis of
sha1 hashes
Version 2.0
- Added second level: Rosetta Lander Mission
- AstroDrone now works on Android
- Changed image features extraction types: image patches and power spectrum
- Changes instructions format to slides instead of video
3.0 TODOs
- Make sound engine work on the iPhone
4.0 Contributors
Programming and Design:
Paul Konstantin Gerke
Guido de Croon
Supervision:
Guido de Croon
4.1 Third party resources and libraries
Libraries
glm
OpenGL Mathematics Library, MIT Licensed by G-Truc Creation (2005-2012)
downloaded from http://glm.g-truc.net/
half
Half float library (http://half.sourceforge.net/), MIT License
Copyright (c) 2012 Christian Rau
xz
Using only liblzma, which is in public domain and part of xz utils.
See accompanying license text in gameimp/xz-5.0.4
libcurl
Custom, permissive license by Daniel Stenberg (2011)
downloaded from http://curl.haxx.se/libcurl/
JsonCpp
Released into public domain and under the X11/MIT License by Baptiste Lepilleur (2010)
downloaded from http://jsoncpp.sourceforge.net/
base64
Permissive copyright by René Nyffenegger (2004-2008)
http://www.adp-gmbh.ch/cpp/common/base64.html
iphone-glu
SGI Free Software License by SGI? (2008)
http://code.google.com/p/iphone-glu/
AR Drone API
Custom, restrictive license by Parrot
Copyright (C) 2007-2011, PARROT SA, all rights reserved
GPL-breaking part:
Article 5-iii
[It's forbidden...]
To use the PARROT SDK and APIs to develop an application other than a Game for
AR.Drone. The Game for AR.Drone shall have for sole purpose to be used by a
User for entertaining, game, leisure or training. The creation of applications
for the use of the PARROT AR.Drone for professional use or use such as but not
limited to military, and, without limitation, security, watching, spying,
defence, cartography, is strictly forbidden.
Adapted version of the whirlpool hash algorithm reference implementation
Public domain
by Vincent Rijmen and Paulo S. L. M. Barreto
http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html
SHA-1 implementation in JavaScript
(c) Chris Veness 2002-2010
http://www.movable-type.co.uk/scripts/sha1.html
Textures
Star map (tycho-equatorial.png)
Creative commons by Nathan Bergey (nathan.bergey@gmail.com)
downloaded from http://mechanicalintegrator.com/2010/maps-of-the-sky/
Earth textures used by this program (color + bump map)
http://planetpixelemporium.com/planets.html
Copyright (c) 2012 by James Hastings-Trew
Meshes
Basemodel for ISS by Orion_Nebula (converted and adapted)
http://www.celestiamotherlode.net/catalog/show_creator_details.php?creator_id=43
Fonts
lost-in-future: http://www.fontspace.com/rayhan/lost-in-future
Fonts under OFL-license
Resagnicto: http://www.fontspace.com/glukfonty/resagnicto
Copyright (c) 2010, gluk (gluksza@wp.pl),
with Reserved Font Name "Resagnicto"
Sertig: http://typethefont.com/post/550992450/sertig-free-font
Copyright (c) 20??, info@dannci.com
with Reserved Font Name "Sertig"
Gabo: http://typethefont.com/post/463554113/gabo-drive-free-font
Copyright (c) 20??, info@dannci.com
with Reserved Font Name "Gabo Drive"
Allerta: http://pixelspread.com/allerta/
Copyright (c) 2010, Matt McInerney
with Reserved Font Name "Allerta"