ros配置
参考项目 https://github.com/rosjava/android_apps
Project复制kinetic包的东西,没有Project的gradle中的plugin:catkin会找不到
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(android_apps)
find_package(catkin REQUIRED rosjava_build_tools)
catkin_android_setup(assembleRelease assembleDebug uploadArchives)
catkin_package()
install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/android_apps/
DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/android_apps)
package.xml
<?xml version="1.0"?>
<package>
<name>android_apps</name>
<version>0.2.0</version>
<description>
Applications for robot-android pairing..
</description>
<url type="website">http://ros.org/wiki/android_apps</url>
<url type="repository">https://github.com/rosjava/android_apps</url>
<url type="bugtracker">https://github.com/rosjava/android_apps/issues</url>
<maintainer email="[email protected]">Daniel Stonier</maintainer>
<author email="[email protected]">Daniel Stonier</author>
<author email="[email protected]">Kazuto Murase</author>
<license>Apache 2.0</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rosjava_build_tools</build_depend>
<build_depend>rosjava_bootstrap</build_depend>
<build_depend>android_core</build_depend>
<build_depend>android_extras</build_depend>
<build_depend>android_remocons</build_depend>
<build_depend>rosjava_messages</build_depend>
</package>
配置Project的gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: "https://github.com/rosjava/android_core/raw/kinetic/buildscript.gradle"
repositories {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:2.2.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'catkin'
allprojects {
repositories {
jcenter()
}
group 'com.github.rosjava.android_apps'
version = project.catkin.pkg.version
}
subprojects {
apply plugin: 'ros-android'
afterEvaluate { project ->
android {
packagingOptions {
/* https://github.com/rosjava/android_core/issues/194 */
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
配置module:app的gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
defaultConfig {
applicationId "com.hlf.rosdemo"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
productFlavors {
kinetic {
applicationId "com.github.rosjava.android_apps.make_a_map.kinetic"
}
}
lintOptions {
abortOnError = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.github.rosjava.android_remocons:common_tools:[0.2,0.3)'
compile 'org.ros.android_core:android_15:[0.3,0.4)'
compile 'org.ros.rosjava_core:rosjava_geometry:[0.3,0.4)'
compile 'org.ros.rosjava_messages:map_store:[0.3,0.4)'
compile 'org.ros.rosjava_messages:world_canvas_msgs:[0.2,0.3)'
}