Ubuntu Virtual Machine +ros+android Development environment Configuration Note
Virtual machine settings:
1. Local environment: Windows 7;vmware; Networking 2. Virtual Environment: Ubuntu 14.04, more stable, and supports many ROS3. Virtual machine configuration:hard disk at least 50G, as the entire toolchain is configured to require a lot of space, performance can be as high as possible. 4. After the virtual environment is set up, Ubuntu will pop up a prompt to ask whether to upgrade the software, restart after the upgrade, about 30 minutes, depending on the network environment. 5. After restarting, terminal executes the following: $ sudo apt-get upgrade
$ sudo apt-get update takes about 3 minutes to complete, depending on the network environment. 6. At this point, the virtual machine configuration is basically complete.
Ros Installation:1. Login Wiki.ros.org/indigo/installation/ubuntu; You can change Indigo to another suitable Ros version, but it is recommended not to choose the latest Ros version, because the latest version is often package support is not very good. The second-to-last new is often more stable. 2. First confirm that Ubuntu allows the installation of "restricted", "universe" and "Multiverse" type software (software sources configuration). 3. First configure the Ros source (1.2) and then configure the source key (1.3). 4. Follow the instructions to download and install Ros (ros-indigo-desktop-full), depending on the network environment, may take 30 minutes to download 1G multi-content. 5. Follow the instructions to configure ROSDEP (1.5), which is used to resolve Ros dependency. 6. Add the environment variable (1.6), and if you do not add this step, you will need to manually add the environment variable before each use: $ source/opt/ros/indigo/setup.bash7. Follow the instructions to download the installation Rosinstall. About a minute. 8.terminal perform the following: $ rospack find Rviz If a path is returned, the ROS installation is successful and the Rviz package is installed. 9. The ROS has been installed.
Rosjava:1.terminal execution: $ sudo apt-get install Ros-indigo-rosjava $ mkdir-p ~/rosjava $ wstool init-j4 ~/rosjava/src H Ttps://raw.githubusercontent.com/rosjava/rosjava/indigo/rosjava.rosinstall $ Source/opt/ros/indigo/setup.bash $ c D ~/rosjava $ ROSDEP update $ ROSDEP Install--from-paths src-i-y $ source ~/rosjava/devel/setup.bash $ Catkin_make running ROSDEP may take a little time, it will automatically be under other dependent packages. Finally Catkin_make one step, perhaps because the network reason cannot be successful at once, can try several times.
You can then add the following or do not add: $ mkdir-p ~/rosjava_minimal $ wstool init-j4 ~/rosjava_minimal/src Https://raw.githubusercon Tent.com/rosjava/rosjava/indigo/rosjava_minimal.rosinstall $ Source/opt/ros/indigo/setup.bash $ cd ~/rosjava_mini Mal $ rosdep Update $ ROSDEP Install--from-paths src-i-y-r $ catkin_make
2.terminal executed as follows: $ mkdir-p ~/myjava/src $ cd ~/MYJAVA/SRC $ Source/opt/ros/indigo/setup.bash $ catkin_ini T_workspace $ cd ~/myjava $ Catkin_make $ echo "Export Ros_lang_disable=genjava" >> ~/myjava/devel/setup . Bash
3.terminal executes as follows: $ sudo apt-get install OPENJDK-7-JDK $ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 Lib 32stdc++6
4. Download Android Studio, the network does not necessarily support download the installation package from the official, you can download from elsewhere. 5. Modify opt permissions, sudo nautilus, navigate to/opt, and change its permissions to "Create and delete Files". 6. Unzip the downloaded installation file to opt, and the/opt/android-studio folder will be available upon completion. 7.terminal: $/opt/android-studio/bin/studio.sh to open Android Studio, select New, read the instructions and navigate to download the SDK (nearly 1G). 8. Open the SDK Manager in Android Studio,configure. In addition to the latest SDK, download SDK Build Tools 21.2, APIs 10,13,15,18,21. Some downloads need to be selected Obsolee to see. This download may take a lot of time. You can try to separate several packages to download.doubt here! Download will appear Download interrupted:connection to http://dl-ssl.google.com refusedthese few packages do not know how to follow the impact. API10 download has not been successful. download unsuccessful or slow download solution:1. In Android SKD Manager, click Tools, Options in the top menu bar, and select the Enforce HTTP protocol option. (not successful)2. Change the host to add the following to/etc/hosts:203.208.46.146 dl.google.com203.208.46.146 dl-ssl.google.com(host address is not stable)3.VPN, the most effective over the wall!
9. Add a path:$ echo Export Path=\${path}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-studio/bin >> ~/.BASHRC
$ echo Export ANDROID_HOME=/OPT/ANDROID-SDK >> ~/.BASHRCthere may be problems with the path, see below.
10.terminal under: $ mkdir-p ~/android_core$ wstool init-j4 ~/android_core/src Https://raw.github.com/rosjava/rosjava/indigo/android_core.rosinstallThere is a problem here, do not use-J4, will download four files at the same time, error-prone. $ wstool init ~/android_core/src Https://raw.github.com/rosjava/rosjava/indigo/android_core.rosinstall $ catkin_makewill fail because of bad network, try more several times?there will be several possible issues related to the solution:1.gardle address may be replaced, see Ros Wiki explained in detailHttp://wiki.ros.org/android/FAQ/Issue%20of%20building%20application%20with%20modified%20rosjava%20core%20modulesor change the buildscript.gradle under Android_core:change the Apply from address to:"Https://raw.githubusercontent.com/rosjava/rosjava_bootstrap/indigo/buildscript.gradle "2.Android Studio version newer, compatibility issues:if the "SDK directory does not exist" error message appears, you need to modify the path to$ sudo nano ~/.bashrcEdit the modified path, such as:Export PATH = ${path}:/home/rg/android/tools:/home/rg/android/platform-tools:/opt/android-studio/binExport ANDROID_HOME=/HOME/RG/ANDROID/SDK3. If the first step make is successful, the second step makes a problem, you can:$ rm-r devel/$ rm-r build/and try make again .
4. If ADB is not installed:$ sudo apt-get install android-tools-adbIf all goes well, take about 10 minutes to make.
11. Install reference Interaction Suit, part of the basic unnecessary, is around the Turtlebot of some interactive package. terminal under:$ mkdir-p ~/android_interactions$ wstool init-j4 ~/android_interactions/src https://raw.github.com/rosjava/rosjava/indigo/android_interactions . Rosinstall$ source ~/rosjava/devel/setup.bash$ source ~/android_core/devel/setup.bash$ cd ~/android_interactions$ catkin_make12. After installation, according to the official textbook there is a test link, specifically:
Under the terminal:
$ source/opt/ros/indigo/setup.bash # set ROS_IP to Linux IP, ifconfig inet items can view native IP$ export ros_ip=192.168.1 .101$ Roscore
Under the other terminal: # The following packages may have been installed mostly$ sudo apt-get install Ros-indigo-image-view ros-indigo-rqt-image-view ros-indigo-image-transport-plugins
# set ROS_IP to Linux IP$ export ros_ip=192.168.1.101
$ rosrun image_view Image_view image:=/camera/image _image_transport:=compressed
You can then open Android Studio, specifically:
New terminal under: $ source ~/android_core/devel/setup.bash $/opt/android-studio/bin/studio.sh
Import the ~/android_core/src/android_core project. Connect the USB cable to your Android phone. Make sure that the phone is connected to the same network as the PC, and that setting up the VM's network connection to the host is a bridging mode. (You can test your network configuration by pinging your PC and your phone, and if you can ping each other, the next connection will work.) After making sure that the network is configured correctly, in Android studio, select the Android_tutorial_camera configuration, and then build. Make sure that the Android phone allows USB to debug and install the Cameratutorial app, and then fill in the app with the PC's IP address (such as http://192.168.23.10:11311/) and connect it to see on the PC/camera/ Image shows the framing images of the phone camera.
The basic configuration of the Ros and Android development environment has been successful.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Ubuntu Virtual Machine +ros+android Development environment Configuration Note