(!) 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 - ROS Development Environment

Description: Preparing a ros environment for development.

Keywords: android installation

Tutorial Level: BEGINNER

Next Tutorial: Creating Android Packages

Overview

This tutorial shows how to setup the usual ros environment for development. That is dependencies are installed via debs and a source workspace with multiple stacks containing catkin packages.

It is useful when building across multiple libraries (android .aars) and repositories and also for automated continuous integration builds.

Android Studio & SDK

RosJava

From debs on ubuntu

> sudo apt-get install ros-hydro-catkin ros-hydro-ros ros-hydro-rosjava python-wstool

You could also install the rosjava sources and chain that workspace to the ones below.

Sources

Fat Workspace

For the full suite of official repositories:

> mkdir -p ~/android
> wstool init -j4 ~/android/src https://raw.github.com/rosjava/rosjava/hydro/android_core.rosinstall
# or if you want the android_apps/android remocons repos as well:
# wstool init -j4 ~/android/src https://raw.github.com/rosjava/rosjava/hydro/android_apps.rosinstall
> source /opt/ros/hydro/setup.bash
> cd ~/android
> catkin_make

Diet Workspace

You don't need to compile all .aar's yourself - the official .aar's exist in our maven repo which will automatically download when they are listed as a gradle dependency of your project. In this case, you can just work on your own sources (saves a great deal of compilation time!).

> mkdir -p ~/android
> wstool init -j4 ~/android/src my_sources.rosinstall
> source /opt/ros/hydro/setup.bash
> cd ~/android
> catkin_make

Usage

You can now either continue to develop in one of three ways:

  • On the command line with catkin_make.

  • Source devel/setup.bash and just run gradle in each android package.

  • Import your packages into android studio and use the IDE.

Testing an App

Android

Install the android_tutorial_camera app via Android Studio to your device. Refer to the Android Studio notes for instructions on how to do this and other things that will mercilessly coerce Android Studio into aligning your evil plans. Feel free to add to these.

Launch the app and connect to a pc master configured in the following way.

PC

> source ~/android/devel/setup.bash
  • Start a roscore on your machine
  • Launch the app on your device and enter your machine's ip when prompted
  • Start the image viewer on your machine

> rosrun image_view image_view image:=camera/image _image_transport:=compressed

Creating an App

Make use rosjava_build_tools, it has a couple of catkin_create_xxx scripts which are useful.

Wiki: android/Tutorials/hydro/Installation - Ros Development Environment (last edited 2014-01-29 10:53:29 by DanielStonier)