## page was renamed from turtlebot_android/Tutorials/Installation ## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0= ## descriptive title for the tutorial ## title = Installation ## multi-line description to be displayed in search ## description = Installation instructions for TurtleBot Android applications. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link=[[turtlebot_android/Tutorials/groovy/Create a new app|Create a New App]] ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = Android applications installation TurtleBot #################################### <<IncludeCSTemplate(TutorialCSHeaderTemplate)>> <<TableOfContents(4)>> This tutorial shows you how to download, compile and test the TurtleBot Android applications plus the required ROS stacks. == Prepare your environment == Ensure you have followed the first section of [[android_core]] installation procedure: [[android_core#Prerequisites|prerequisites]]. == Download the code == 1. Choose where do you want to install, for example on ~/android 2. Get the source: {{{ > rosws init ~/android /opt/ros/groovy > cd ~/android > rosws merge https://raw.github.com/turtlebot/turtlebot_android/groovy-devel/turtlebot_android.rosinstall > rosws update }}} 3. Source the setup file that `rosinstall` created: {{{ . setup.bash }}} '''Note:''' Be sure to do this every time you start doing development with this software. == Compile rosjava and android == 1. Compile rosjava: {{{ roscd rosjava_core ./gradlew install }}} '''Note:''' Message and service files used on apps must be included on ROS_PACKAGE_PATH when compiling rosjava in order to generate the java code that implements them. That's why rosinstall also downloaded [[turtlebot_apps]] and [[turtlebot_create]]. If the compiler cannot find some messages when building the apps, double check that both packages are included on ROS_PACKAGE_PATH and redo this step. 2. Compile some libraries from android_core: {{{ roscd android_core # Note: you may need to adjust the argument to the `--target` option based # which Android API version you're using. # You may have to kill gradle if it's already running. android update project --path ./android_gingerbread_mr1/ --target android-17 android update project --path ./android_honeycomb_mr2/ --target android-17 cd android_gingerbread_mr1 ../gradlew debug cd ../android_honeycomb_mr2 ../gradlew debug }}} At this point, maybe is a good idea to test your installation by trying out the tutorials, explained on third section of [[android_core]] documentation. == Compile turtlebot apps == 1. Go to the directory containing the applications {{{ roscd turtlebot_android }}} 3. If it's your first time using this working copy, generate the `project.properties` for each project using the configure script: {{{ ./configure.py }}} This script does a few thing: * Sets the target version (can change the default with the `--target` option * Works out where your project's dependencies are (android libraries listed in the `manifest.xml`) and inserts these into each `project.properties` script 4. To build all the apps: {{{ ./gradlew debug }}} or alternatively do one by one by invoking the gradlew wrapper from within that directory, e.g.: {{{ cd turtlebot_android_follower ../gradlew debug }}} == Testing the apps == If all went ok, let's try one of the apps as an example. 1. Launch TurtleBot minimal configuration in a new terminal. Note that ROS_MASTER_URI and ROS_HOSTNAME/ROS_IP must contain an address identifiable from the local network; the default '''localhost''' is not a valid option. Assuming your robot's IP is 192.168.6.66, export ROS_MASTER_URI and ROS_IP accordingly: {{{ export ROS_MASTER_URI=http://192.168.6.66:11311 export ROS_IP=192.168.6.66 roslaunch turtlebot_bringup minimal.launch --screen }}} 2. Load the app onto your Android device. Don't forget to enable developer mode. We will use follower as an example: {{{ roscd turtlebot_android_follower adb -d install -r ./bin/FollowerActivity-debug.apk }}} 3. Launch the app on your device. Set the ROS_MASTER_URI as http://192.168.6.66:11311. The follower app should start simultaneously on the robot. Verify it by by checking the log. The robot should now follow tirelessly anything in front of him, but the app allow you to start/stop this bothering behavior. == App chooser integration == Now that the follower app is on your device, you can start if from the [[https://play.google.com/store/apps/details?id=org.ros.android.android_app_chooser&feature=search_result#?t=W251bGwsMSwyLDEsIm9yZy5yb3MuYW5kcm9pZC5hbmRyb2lkX2FwcF9jaG9vc2VyIl0.|ROS Application Chooser]]. If you try to execute an app not already installed, the app chooser will redirect you to the Play store. ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE