在ROS下安装AndroidStudio

在公司怎么装都装不上去,后面索性把系统重装后,一切重来。后面终于安装成功了。

首先你一定要到一个网络特别好的环境下,其次要准备点吃的,最后要有耐心。因为此次安装需要花费太多的时间。

参考的网址https://github.com/erkihindo/controller/wiki/Full-installation-guide点击打开链接

                  http://blog.csdn.net/q1302182594/article/details/52980143

第一个网址:上描述了整个安装的过程,但在安装到

             sudo apt-add-repository ppa:paolorotolo/android-studio
             sudo apt-get update
             sudo apt-get install android-studio

     时,发现总是出错,后面还是选择了离线安装android studio好了。该部分安装参考的时第二个网址

安装方法二

1)到http://www.androiddevtools.cn/下载android-studio-ide-145.3360264-Linux.zip

2)解压到目录android-studio,目录结构如下图所示:

    在ROS下安装AndroidStudio

3)进入上图的bin目录:

  1. cd bin  
    bin目录结构如下:

在ROS下安装AndroidStudio
4)运行bin目录中的studio.sh脚本

  1. sdudio.sh  

    执行上述脚本后,弹出下述对话框:

在ROS下安装AndroidStudio

5)点击上图中的”OK“按钮,提示:

在ROS下安装AndroidStudio

    接着弹出如下对话框:

在ROS下安装AndroidStudio

6)点击上图的”Cancel“按钮,提示:

在ROS下安装AndroidStudio

7)点击上图的”Next“按钮,提示:

在ROS下安装AndroidStudio

8)点击上图的”Next“按钮,提示:

在ROS下安装AndroidStudio

9)点击上图的”Next“按钮,提示:

在ROS下安装AndroidStudio

10)点击上图的”Finish“按钮,提示:

在ROS下安装AndroidStudio

11)点击上图的”Finish“按钮,提示:

在ROS下安装AndroidStudio



至此android studio安装成功,接着再按第一个网址继续安装即可,注意,一定要仔细阅读网址中描述的安装步骤,不可忽略任何一个环节。

下面将第一个网址中描述的内容复制如下:

First get some food or something, cause this is gonna take some time.

Full installation takes 16 GB (Ubuntu + Studio + SDK etc)

VM

Download Oracle VirtualBox https://www.virtualbox.org/
Also download extensions!
Download Ros64 http://nootrix.com/downloads/#RosVM
Double click the file to Import it to VirtualBox
Add USB filter in Virtualbox so that your virtual machine picks up your phone. Click settings, USB then the icon with the + and select your phone.

Start the virtual machine. Now come the cmd commands. (The password for viki is viki)
Now we will continue only in the VM.

Java http://tecadmin.net/install-oracle-java-8-jdk-8-ubuntu-via-ppa/

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

You can check java with:

java -version

Android studio https://paolorotolo.github.io/android-studio/

sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio

Install this or else the studio will start with an error.

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

This part here will probably take the longest, studio needs to install a lot of things and index even more, I recommend not doing other things until you start installing rosjava,. Studio just eats up your disk %.
Put studio in the search bar to start it. Press update. It will restart.

It will install some things before getting started.

You can create some random new project. Just press Enter a couple of times, the application details doesn't matter at all. We just need to get to the settings. But first, let it do it's indexing(you can see it on the bottom row), patience. You can make some coffee, it`s gonna take a few minutes.

Once it`s done:First, change the gradle settings to default:
File -> settings -> build,execution ->build tools-> gradle -> use default

Next get the right Sdk platforms and tools:
Tools -> Android -> select Android 4.0.3(15) and Android 2.3.3(10) -> ok

When it has finished reopen sdk manager and press Launch Standalone SDK manager
Select 21.1.2 and deselect everything else, everything else is just spam. You can update google repository if you want.
Good, you can minimize Studio for now and open command line.

Rosjava http://wiki.ros.org/rosjava/Tutorials/indigo/Source%20Installation

sudo apt-get install ros-indigo-catkin ros-indigo-rospack python-wstool
mkdir -p ~/rosjava/src
wstool init -j4 ~/rosjava/src https://raw.githubusercontent.com/rosjava/rosjava/indigo/rosjava.rosinstall
source /opt/ros/indigo/setup.bash
cd ~/rosjava
Make sure we've got all rosdeps and msg packages.
rosdep update
rosdep install --from-paths src -i -y
catkin_make
It`s fine, if the rosdep install command shows an error. Catkin_make takes a long time. Time for some more food.

Indigo http://wiki.ros.org/android/Tutorials/indigo/Installation%20-%20ROS%20Development%20Environment

mkdir -p ~/android_core
wstool init -j4 ~/android_core/src https://raw.github.com/rosjava/rosjava/indigo/android_core.rosinstall
source /opt/ros/indigo/setup.bash
source ~/rosjava/devel/setup.bash
cd ~/android_core

Create local.properties to android_core/src/android_core and android_extras with the contents: sdk.dir=/home/viki/Android/Sdk

catkin_make

Controller

Time to get the controller project:

mkdir -p ~/ROS_android/src
cd ~/ROS_android/src
source ~/rosjava/devel/setup.bash
catkin_create_android_pkg android_ros android_core rosjava_core std_msgs
cd android_ros
git clone https://github.com/erkihindo/controller.git
In the Settings.gradle, which is in android_ros folder, write: include 'controller'
Copy the local.properties file to android_ros
cd ../..
catkin_make

Reopen studio and press File -> open -> controller(/home/viki/ROS_android/src/android_ros/controller) -> ok
It won`t close the current project so find the right window.
Open Controller project in navigation, it will index it first.
Change what you want, if you want and then press the green arrow to install it to your phone.
Cheers!