Skip to content

Latest commit

 

History

History
163 lines (132 loc) · 7.18 KB

README.md

File metadata and controls

163 lines (132 loc) · 7.18 KB

Introduction

This repository hosts the code of the Tango Ros Streamer application.
It is an Android application for Tango-enabled devices. Its main purpose is to provide Tango sensor data to the ROS ecosystem in order to easily use the Tango functionalities on robots.
Please read our ROS wiki for more information.

This work is developed by Intermodalics in collaboration with Ekumen and Google Tango.
Do not hesitate to give us feedback if something is broken or if you think it lacks some features. The best way to do this is by adding issues to this repository.

Known projects using TangoRosStreamer

Kickstart

The app is available in Google's Play Store: https://play.google.com/store/apps/details?id=eu.intermodalics.tango_ros_streamer
It can be installed on any Tango-enabled device. Note that the minimum Tango version required to run Tango Ros Streamer is Yildun (you will find the Tango release history here). To check the Tango version of your device go to Settings->Apps->Tango Core.
Please read our ROS tutorial for help when running the app.

Installation from source

For this guide, we assume that you have a clean installation of Ubuntu 14.04 and we will use ROS Indigo. However, the app should also work on Ubuntu 16.04 in combination with ROS Kinetic.

Install ROS

Follow this the guide for Indigo (14.04) or Kinetic (16.04) and go for the Desktop -- Full Install:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-indigo-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install ros-indigo-rosjava-build-tools
sudo apt-get install ros-indigo-genjava

Replace indigo by kinetic if you are using Ubuntu 16.04.

Building roscpp_android

Next, we need to build roscpp_android. A more detailed guide is available here.

sudo apt-get update
sudo apt-get install curl git
curl -sSL https://get.docker.com/ | sudo sh
mkdir ~/ros-android-ndk
cd ~/ros-android-ndk
git clone https://github.com/ekumenlabs/roscpp_android.git
cd roscpp_android
./do_docker.sh --portable

Note that the last command will take long time to complete.

Building the app

First clone the repository at the correct location:

mkdir -p ~/tango_ros_ws/src
cd ~/tango_ros_ws/src
git clone --recursive git@github.com:Intermodalics/tango_ros.git
cd ~/tango_ros_ws

Copy the the content of the output roscpp_android_ndk folder into tango_ros/third_party/roscpp_android_ndk/, except the Android.mk file and the share folder.

cp -r ~/ros-android-ndk/roscpp_android/output/roscpp_android_ndk/lib/ ~/tango_ros_ws/src/tango_ros/third_party/roscpp_android_ndk/
cp -r ~/ros-android-ndk/roscpp_android/output/roscpp_android_ndk/include/ ~/tango_ros_ws/src/tango_ros/third_party/roscpp_android_ndk/
cp ~/ros-android-ndk/roscpp_android/output/roscpp_android_ndk/Application.mk ~/tango_ros_ws/src/tango_ros/third_party/roscpp_android_ndk/

Create a local.properties file

touch ~/tango_ros_ws/src/tango_ros/TangoRosStreamer/local.properties

In this file, write the path to your Android SDK and NDK in the following way e.g.:

ndk.dir=/opt/android-ndk-r10b
sdk.dir=/opt/android-sdk-linux

If you haven't installed the SDK and NDK already, follow the instructions in section Developing with Android Studio.

Install catkin tools if necessary.

sudo apt-get install python-catkin-tools

Build the app and generate its .apk file.

catkin build --no-jobserver

Plug your device to your desktop and install the app on your device using adb.

adb install -r -d ~/tango_ros_ws/src/tango_ros/TangoRosStreamer/app/build/outputs/apk/app-debug.apk

Developing with Android Studio

We recommend using Android Studio as a development tool.

Installation of Android Studio

The steps detailed below are based on this installation guide.

For Android Studio we need Java, so let's install this first. On Ubuntu 14.04, we need to install openjdk-7-jdk, while on Ubuntu 16.04 we recommend to use openjdk-8-jdk instead.

sudo apt-get update
sudo apt-get install openjdk-7-jdk
echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/" >> ~/.bashrc

In case the build insists of using Java 8 when using Ubuntu 14.04, check and point to the version installed by android-studio:

cat /opt/android-studio/jre/release
echo "export JAVA_HOME=/opt/android-studio/jre/" >> ~/.bashrc

Subsequently, download Android Studio from here and unzip (for example) to /opt/android-studio:

cd /opt
sudo unzip ~/Downloads/android-studio-ide-145.3537739-linux.zip

Let's add it to the path for convenience:

echo export PATH=\${PATH}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-studio/bin >> ~/.bashrc

Pick a directory where to store the Android SDK, for example here:

sudo mkdir /opt/android-sdk
sudo chown $(whoami) /opt/android-sdk
echo export ANDROID_HOME=/opt/android-sdk >> ~/.bashrc

Building the app with Android Studio

Launch Android Studio:

source ~/.bashrc
source ~/tango_ros_ws/devel/setup.bash
studio.sh

After launch, open the Configure -- SDK Manager. From SDK Platforms, install Android 4.4 and 5.1 (API level 19 + 22). From SDK Tools, install NDK and Android SDK Build-Tools 21.1.2 + 25.0.2 + 25.0.3.

Now extend your PATH variable so that ndk-build can be executed:

echo "export PATH=\{$ANDROID_HOME}/ndk-bundle:\${PATH}" >> ~/.bashrc
source ~/.bashrc

In Android Studio, choose "Import project" and select the app folder (~/tango_ros_ws/src/tango_ros/TangoRosStreamer).

In your local.properties file check that the paths to your Android SDK and NDK are set properly. The Gradle set-up relies on the following variables that need to set up. This can be done using the auto-generated local.properties file or gradle properties in the HOME folder (~/.gradle/gradle.properties).
Example:

ndk.dir=/opt/android-ndk-r10b
sdk.dir=/opt/android-sdk-linux

Plug your device to your desktop and press the green arrow in Android Studio. It will build and install the app on the device.