[Documentation] [TitleIndex] [WordIndex

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Installation

Description: Installation instructions for TurtleBot Android applications.

Keywords: Android applications installation TurtleBot

Tutorial Level: BEGINNER

Next Tutorial: Create a New App

This tutorial shows you how to download, compile and test the TurtleBot Android applications plus the required ROS stacks.

Prepare your environment

Ensure you have followed the first section of android_core installation procedure: prerequisites.

Download the code

1. Choose where do you want to install, for example on ~/android

2. Get the source:

> rosws init ~/android /opt/ros/groovy 
> cd ~/android
> rosws merge https://raw.github.com/turtlebot/turtlebot_android/groovy-devel/turtlebot_android.rosinstall
> rosws update

3. Source the setup file that rosinstall created:

. setup.bash

Compile rosjava and android

1. Compile rosjava:

roscd rosjava_core
./gradlew install

2. Compile some libraries from android_core:

roscd android_core
# Note: you may need to adjust the argument to the `--target` option based
# which Android API version you're using.

# You may have to kill gradle if it's already running.

android update project --path ./android_gingerbread_mr1/ --target android-17
android update project --path ./android_honeycomb_mr2/ --target android-17
cd android_gingerbread_mr1
../gradlew debug
cd ../android_honeycomb_mr2
../gradlew debug

At this point, maybe is a good idea to test your installation by trying out the tutorials, explained on third section of android_core documentation.

Compile turtlebot apps

1. Go to the directory containing the applications

roscd turtlebot_android

3. If it's your first time using this working copy, generate the project.properties for each project using the configure script:

./configure.py

This script does a few thing:

* Sets the target version (can change the default with the --target option * Works out where your project's dependencies are (android libraries listed in the manifest.xml) and inserts these into each project.properties script

4. To build all the apps:

./gradlew debug

or alternatively do one by one by invoking the gradlew wrapper from within that directory, e.g.:

cd turtlebot_android_follower
../gradlew debug

Testing the apps

If all went ok, let's try one of the apps as an example.

1. Launch TurtleBot minimal configuration in a new terminal. Note that ROS_MASTER_URI and ROS_HOSTNAME/ROS_IP must contain an address identifiable from the local network; the default localhost is not a valid option. Assuming your robot's IP is 192.168.6.66, export ROS_MASTER_URI and ROS_IP accordingly:

export ROS_MASTER_URI=http://192.168.6.66:11311
export ROS_IP=192.168.6.66
roslaunch turtlebot_bringup minimal.launch --screen

2. Load the app onto your Android device. Don't forget to enable developer mode. We will use follower as an example:

roscd turtlebot_android_follower
adb -d install -r ./bin/FollowerActivity-debug.apk

3. Launch the app on your device. Set the ROS_MASTER_URI as http://192.168.6.66:11311. The follower app should start simultaneously on the robot. Verify it by by checking the log. The robot should now follow tirelessly anything in front of him, but the app allow you to start/stop this bothering behavior.

App chooser integration

Now that the follower app is on your device, you can start if from the ROS Application Chooser. If you try to execute an app not already installed, the app chooser will redirect you to the Play store.


2019-11-16 13:26