Coder Social home page Coder Social logo

hungbui-io / tango_ros Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intermodalics/tango_ros

0.0 2.0 0.0 7.93 MB

ROS related software for Tango

License: Apache License 2.0

CMake 2.43% Java 49.63% Makefile 1.59% C++ 45.34% Shell 0.72% Python 0.29%

tango_ros's Introduction

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.
You can read the ROS wiki here.

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.

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.

Running the app

  • Launch a roscore on your desktop.

  • On the first run, the app will ask you to set some settings. Press DONE once the set-up is completed. screenshot_2017-01-19-16-41-47

  • You can enable/disable published data at runtime via the app switch buttons located in a right drawer. screenshot_2017-01-19-14-20-37

  • You can run rviz with the config file located at tango_ros/TangoRosStreamer/tango_ros.rviz to visualize Tango data (device pose, pointcloud, images,...).

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

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. Once this has ended, 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/

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 [email protected]:Intermodalics/tango_ros.git
cd ~/tango_ros_ws

Then, you can build the app either with catkin or with Android Studio. Follow the instructions below corresponding to your prefered way.

Using catkin

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:

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

Build the app and generate its .apk file.

sudo apt-get install git python-catkin-tools
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

Using Android Studio

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

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

Finally, launch Android Studio:

source ~/.bashrc
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.

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

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

Building the app

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.

tango_ros's People

Contributors

mcopejans avatar juergensturm avatar adolfo-rt avatar

Watchers

James Cloos avatar Hung Bui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.