Note: This tutorial assumes that you have completed the previous tutorials: Installation. |
![]() |
Create a New App
Description: This tutorial shows you how to create a new Android application for your TurtleBotTutorial Level: BEGINNER
Contents
Prepare your environment
Go back to the workspace you created in the previous tutorial and source the ros environment:
> source ~/turtlebot_android/devel/setup.bash
Create
A New Repo
If you're not working within a repo, you'll need to setup a few files for gradle in the root of a new repo.
> cd ~/turtlebot_android/src > catkin_init_android_repo dudes
A New Library/App
The following creates a new library/app pair that depend on each other as well as android_gingerbread:
> cd ~/turtlebot_android/src/dudes > catkin_create_android_library_pkg dudette android_gingerbread > catkin_create_android_pkg dude dudette
Finally compile:
> cd ~/turtlebot_android > yujin_make # Or alternatively, just the packages and their dependencies > yujin_make --pkg=dude > yujin_make --pkg=dudette
Looking Around
Package Manifest - Dependencies
The build_depends tags in your project's package.xml file are used to automatically generate project.properties for you when catkin invokes cmake. It uses some utility functions from catkin_pkg to find and resolve the locations of dependencies that are android libraries.
Whenever you depend on a new android library, simply add it to the build_depends here. If you ever need to regenerate the project properties outside of a catkin build step, simply do something similar to the following:
> source ~/android_apps/devel/setup.bash > roscd turtlebot_android_follower > android_generate_project_properties
Ros Messages
These do not need to be explicitly depended on in package.xml (though they should be for completeness). They just need to be in your workspace at the point of building rosjava_messages.