Skip to content

Getting Started with Tango and ROS

mbrandonhurd edited this page Sep 4, 2014 · 3 revisions

This page tells how to setup a workspace to build ROSJava for use with the Project Tango Phone or Tablet:

Install ROS Hydro on Ubuntu

If you need to make a new installation of ROS Hydro, follow the instructions here: http://wiki.ros.org/hydro/Installation/Ubuntu

Otherwise, make sure you have the latest release of Hydro on your system.

Install Supporting Tools

You'll need catkin, ros (for the setup.bash variables), and a few message packages to ensure it all compiles. Ensure you include any other msg packages you are likely to use in your android applications.

> sudo apt-get install ros-hydro-catkin ros-hydro-ros ros-hydro-common-msgs

You will also need wstool:

> sudo apt-get install python-wstool

If that is not possible, fall back to pip:

> sudo pip install -U wstool

Install and Configure Android Studio

Follow instructions here: http://wiki.ros.org/sig/Rosjava/Android%20Studio/Download

When you launch Android Studio for the first time, make sure you check for upgrades, and have the latest Canary release. Version 0.5.2 will NOT work properly. At the time of this writing it is 0.6.1 is the latest version. Do the online update and restart. You must download version 0.6.1; older or newer versions will not work. (Issue #2)

Make sure you have the following SDK pieces for Android installed:

  • Android Tools - Android SDK Build-tools 19.1
  • Android Tools - Android SDK Build-tools 19.0.2
  • Android 4.3 (API 18) - SDK Platform
  • Android 3.2 (API 13) - SDK Platform
  • Android 2.3.3 (API 10) - SDK Platform
  • Android Support Repository
  • Android Support Library

Android Studio will attempt to put an entire copy of the Android SDK in a sub-directory of wherever you install Android Studio. If you already have been using Eclipse for Android development, and perhaps already have the Android SDK installed, you don't need to go through the huge download hassle of having two copies of the SDK. When you launch Android Studio for the first time without a project open, you have the option of configuring Android Studio to use a pre-determined SDK location.

Add android-studio to your $PATH in your .bashrc

Make SURE your $ANDROID_HOME is the location of your SDK in your .bashrc

Launch AndroidStudio:

> studio.sh

Change the following via the startup menu items: Configure->Project Defaults->Project Structure Change your Android SDK Location and the JDK location to point to the SDK, and also your jvm location. I like to use Java 1.6.0_45 (Java HotSpot(TM) 64-Bit Server VM located in /usr/lib/jvm/default-java).

Install ROSJava and set up ROSJava Android

> mkdir -p ~/rosjava
> wstool init -j4 ~/rosjava/src https://raw.github.com/rosjava/rosjava/hydro/rosjava.rosinstall
> source /opt/ros/hydro/setup.bash
> cd ~/rosjava
> catkin_make

Now install the ROS Java Android workspace:

> mkdir -p ~/rjandroid
> wstool init -j4 ~/rjandroid/src https://raw.github.com/rosjava/rosjava/hydro/android_core.rosinstall
> source ~/rosjava/devel/setup.bash
> cd ~/rjandroid
> catkin_make

Test out your new workspace by loading a sample project into Android Studio. Launch Android Studio:

> studio.sh

Import project ~/rjandroid/src/android_core

It will import all the sample projects into Android Studio. If it throws any errors about SDK's missing, then you forgot to bring in all the SDK's from earlier in this documentation. Go back into the SDK manager and load the missing ones.

If everything goes correctly, it should build all the sample projects, and report a clean, complete build.

Some documentation is at:

  • ~/rjandroid/src/android_core/docs/build/html/index.html
  • ~/rjandroid/src/android_core/docs/build/html/javadoc/index.html

Building a ROSJava Android Package and Project

> source ~/rjandroid/devel/setup.bash
> mkdir -p android/src
> cd android/src
> catkin_create_android_pkg android_foo android_apps android_extras rosjava_core
> cd android_foo
> catkin_create_android_project -t 10 -p com.github.ros_java.android_foo.dude dude
> catkin_create_android_library_project -s 13 -p com.github.ros_java.android_foo.dudette dudette
> cd ../..
> catkin_make

Now you are ready to go! Import your new project into Android Studio and voila! You are ready to write some ROS nodes!

Now you are also ready to proceed to building the ROSTango application and libraries, and start fooling around with publishing VIO to ROS. ROSTango Instructions