AntBot: Setting up the Development Environment
This guide expects you to have basic familiarity with Eclipse.
Download the project from GitHub
Download Android Studio, Eclipse & Arduino IDE
To begin with, download Android Studio and follow the instructions on the site – on Linux you may need to install extra packages so this is particularly important.
To compile the AntBotServer code you will also need Eclipse – specifically the ‘Eclipse IDE for Java Developers’.
After Downloading both, run them for the first time – Android Studio particularly may need to set up Android SDKs (for reference, AntBot is built for Android 4.4 and higher).
It should be noted that whenever I use the term ‘workspace’ within this guide it can refer to a space both programs use or separate ones.
The Ardunio IDE can be found here. Like the above, it will use a ‘workspace’ folder which it calls ‘sketches’. Arduino IDE requires no further setup outside of installation.
There are two libraries the AntBot app and AntBotServer depend on: USBSerialForAndroid (this is actually included in the source code) and OpenCV – both the desktop and android versions.
The Arduino code requires a library to monitor the wheel encoders called Encoder.
Set up OpenCV
Compiling OpenCV (hopefully optional)
Unless you are using Windows, this is required for the desktop version – I have included a compiled version of the library for linux which can be found under AntBotServer/opencv3.0.0/ubuntu-14.04. Hopefully this will work, if not or if you want to compile it yourself this guide will demonstrate how to compile it. If it does, skip to setting OpenCV up as a user library.
You will need the OpenCV source (from the above link) and cmake. Once you finish the ‘Build’ section of the guide, the desired files will be opencv-3.0.0/bin/opencv-300.jar and opencv-3.0.0/lib/libopencv_java300.so.
Now that there is a compiled version of OpenCV you can set it up as a user library in eclipse with this guide. It should be noted that in the section of the guide that tells you to set the native path to ‘OpenCV-2.4.6/build/java/x64’ should actually say ‘OpenCV-2.4.6/lib’.
Installing OpenCV on the Android Device (hopefully optional)
Assuming you are testing with an Android device, you will need to load the OpenCV library onto it. Within the OpenCV Android zip there will be a folder called ‘apk’ – take the contents and follow this guide.
Importing OpenCV as an Android Module
Before you use the OpenCV Android library you will need to have it set up as a project in your workspace. Doing this is relatively simple – just place the OpenCV Android library in your workspace folder and perform either File -> Import Project or from the splash screen do Import Project and select the OpenCV-android-sdk folder from your workspace.
Now that the requirements are in place, simply import AntBot into Android Studio and AntBotServer into Eclipse using the same method as above. Android Studio may need to download a different version of the Android SDK to run – allow it to do so. Eclipse will require you to add the OpenCV user library to AntBotServer.
Allow USB Debugging
If you are just getting started or are doing this on a new computer, you will need to authorise USB debugging on your computer – when plugging in the Android Device this should automatically come as a pop up. If not, follow this guide.
Now it’s time to set up the app!