INSTALLING ANDROID STUDIO + SDK AND ROSJAVA ENVIRONMENT



Installing Android Studio + SDK and ROSJava Environment:

ROSJava is an opensource project in pure Java for inegrating ROS with Android Development Environment.

*All the instructions provided below have been tested on Ubuntu 12.04 LTS. They might change for other Linux distributions. For example, the same installation procedure will not work on Linux Mint. That would require building from the source (a method which the ROS website does not recommend).Installation in Ubuntu 12.04 is fairly easy due to the availability of precompiled debs (debian files)*

  1. Android Studio and SDK

    The new android development (hydro and beyond) is based on google's Android Gradle Plugin & 
    Android Studio which will be replacing the ADT & Eclipse. It is available for download on
    Windows, Linux and MacOSX. The following steps cover the installation procedure in Linux Ubuntu:

     

    1. Prerequisites:

      You will need a Java development. There are two available kits; openjdk and Oracle Java
      Development Kit
      . Android Studio will give you a warning on start up if you use
      openjdk, but we just ignore it right now. Read below if you want more information
      on which jdk to use.

      To install openjdk:

      $ sudo apt-get install openjdk-6-jdk

      Why we might need an Oracle JDK:
      According to the ROS website:
      Android studio shows you a healthily fat warning when you start it that recommends you use oracle's jdk, or else it will be all doom and gloom. We haven't had major issues with the openjdk yet, although anecdotal evidence suggests that if you are short on memory the Oracle JDK is better.”

      If you do want to install oracle's jdk on ubuntu:

      $ sudo add-apt-repository ppa:webupd8team/java -y
      $ sudo apt-get update
      $ sudo apt-get install oracle-java6-installer
      # Switch back to openjdk anytime with sudo update-alternatives --config java
      
    2. Installation:

    • If you're using a 64 bit machine, the ia-32 libs have to be installed.

      $ sudo apt-get install ia32-libs
    • Download android studio and untar it under /opt/android-studio (recommended). Add to your pathIf you put the files anywhere other than /opt/android-studio you will have to tweak the following command to suit: 
       

      $ echo export PATH=\${PATH}:/opt/android-studio/sdk/tools:/opt/android-studio
      /sdk/platform-tools:/opt/android-studio/bin >> ~/.bashrc
      
      $ echo export ANDROID_HOME=/opt/android-studio/sdk >> ~/.bashrc
    • Open up the Android SDK Manager with the command:

      $ android
    • In the SDK Manager make sure you have installed

    Under Tools:

    1. Android SDK build tools 19.0.1

    Android API 19 / 18 / 17 / 16 /15 / 13 / 10 / 7

    (Unclick the TV addons from API 13)

     

    • SDK versions Android 2.3.3 (API 10), Android 3.2(API 13) and Android 4.2.2 (API 17). It's not a whim to install three different versions: we use API 10 for Gingerbread compatible libraries, API 13 for Honeycomb libraries (that cannot work on Gingerbread) and API 17 because is the latest at the time of this writing. You can open Android Studio with the command:

      $ studio.sh

      Now we are equipped with Android Studio and SDK and now we can start installing the ROS debian packages and libraries

  2. Installing ROS & ROSJava Debians

  1. Debian Installation
    There are pre-compiled debians available for a lot of packages for Ubuntu which makes the installation extremely easy. We'll need catkin, ros (for the setup.bash variables) and a few message packages to ensure it all compiles. There are several other packages which we might need during the course of the project. Those packages can be installed later as and when we need them.
     

    > sudo apt-get install ros-hydro-catkin ros-hydro-ros ros-hydro-common-msgs
  2. Wstool:
     

    > sudo apt-get install python-wstool


    When this is not possible, fall back to pip:
     

    > sudo pip install -U wstool
  3. Set up some chained catkin workspaces to modularise the builds and save some compile times.
     

    > 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
  4. Now the source android workspace:
     

    > 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 ~/rosjava/devel/setup.bash //这个东西很重要导入rosjava 资源
    > cd ~/android
    > catkin_make


     

  1. Now we have a fully fuctional Android Studio integrated and SDK integrated with the ROSJava development environment. The next post shall cover integrating the ROS Sensors Driver with the smartphone, running the ROS master node on the laptop and reading the sensor values from the smartphone. 



1 $ export ROS_IP=http://IP_OF_THE_ROBOT:11311
2 $ export ROS_MASTER_URI=http://IP_OF_THE_ROBOT:11311

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值