Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

compile with android-studio #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ build
build.log
build-log.xml
docs.iml
*.log
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ project(tf2_android)

find_package(catkin REQUIRED rosjava_build_tools)

catkin_android_setup(assembleRelease publishToMavenLocal)
catkin_android_setup(assembleRelease uploadArchives)

catkin_package()

install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/tf2/
DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/tf2/)
62 changes: 30 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,51 @@
*/

task wrapper(type: Wrapper) {
gradleVersion = '1.8'
gradleVersion = "2.2.1"
}

allprojects {
group 'org.ros.tf2'
version = '0.0.0-SNAPSHOT'
buildscript {
apply from: "https://github.com/talregev/rosjava_mvn_repo/raw/master/buildscript.gradle"
//noinspection GroovyAssignabilityCheck
dependencies {
classpath "com.android.tools.build:gradle:1.0.1"
}
}

ext.androidBuildToolsVersion = "17"
apply plugin: "catkin"

subprojects {
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}

apply plugin: 'maven'
allprojects {

repositories {
mavenLocal()
maven {
url 'https://github.com/rosjava/rosjava_mvn_repo/raw/master'
url "http://www.github.com/talregev/rosjava_mvn_repo/raw/master"
}
}
configurations.add('compile') {
exclude group: 'junit'
exclude group: 'xml-apis'
}

group 'org.ros.tf2'
version = project.catkin.pkg.version
}

uploadArchives {
repositories {
mavenDeployer {
repository url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
}
}
}
ext.androidBuildToolsVersion = "21.1.2"

subprojects {

apply plugin: 'ros-android'
task publishToMavenLocal() << {
description = 'installs .aar files to the local maven repository.'
}
afterEvaluate { Project project ->
if (plugins.findPlugin('android-library')) {
publishToMavenLocal.dependsOn('uploadArchives')

afterEvaluate { project ->
android {
buildToolsVersion androidBuildToolsVersion
packagingOptions {
/* https://github.com/rosjava/android_core/issues/194 */
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'lib/armeabi/libtf2_ros.so'
}
}
}
}

defaultTasks 'assembleRelease', 'uploadArchives'
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Sep 25 14:10:30 PDT 2013
#Wed Feb 04 07:50:41 IST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
3 changes: 1 addition & 2 deletions insert_benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ dependencies {
compile project(':tf2_ros')
}

apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion 10
buildToolsVersion androidBuildToolsVersion
}

17 changes: 10 additions & 7 deletions insert_benchmark/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ros.tf2.insert_benchmark"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10"
android:targetSdkVersion="17" />
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.ros.tf2.insert_benchmark"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />

<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher">
android:icon="@mipmap/ic_launcher"
tools:replace="android:icon"
android:allowBackup="true">
<activity android:name="org.ros.tf2.insert_benchmark.BenchmarkActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
package org.ros.tf2.insert_benchmark;

import android.app.Activity;
import android.os.Bundle;
import android.os.AsyncTask;
import android.util.Log;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import java.util.ArrayList;
import org.ros.message.Duration;
import org.ros.message.MessageFactory;
import org.ros.message.Time;
import org.ros.node.NodeConfiguration;
import org.ros.tf2_ros.Buffer;

import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.Vector;

import geometry_msgs.Quaternion;
import geometry_msgs.Transform;
import geometry_msgs.TransformStamped;
import geometry_msgs.Vector3;
import tf2_msgs.TFMessage;

import org.ros.tf2_ros.Buffer;
import org.ros.message.Duration;
import org.ros.message.MessageFactory;
import org.ros.message.Time;
import org.ros.node.NodeConfiguration;

public class BenchmarkActivity extends Activity
{
private volatile boolean mRunBenchmark = false;
Expand Down
3 changes: 1 addition & 2 deletions lookup_benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ dependencies {
compile project(':tf2_ros')
}

apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion 10
buildToolsVersion androidBuildToolsVersion
}

17 changes: 10 additions & 7 deletions lookup_benchmark/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ros.tf2.lookup_benchmark"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10"
android:targetSdkVersion="17" />
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.ros.tf2.lookup_benchmark"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />

<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher">
android:icon="@mipmap/ic_launcher"
tools:replace="android:icon"
android:allowBackup="true">
<activity android:name="org.ros.tf2.lookup_benchmark.BenchmarkActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package org.ros.tf2.lookup_benchmark;

import android.app.Activity;
import android.os.Bundle;
import android.os.AsyncTask;
import android.os.Looper;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import java.util.Random;

import geometry_msgs.TransformStamped;
import org.ros.tf2_ros.Buffer;
import org.ros.message.Duration;
import org.ros.message.MessageFactory;
import org.ros.message.Time;
import org.ros.node.NodeConfiguration;
import org.ros.tf2_ros.Buffer;

import java.util.Random;

import geometry_msgs.TransformStamped;

public class BenchmarkActivity extends Activity
{
Expand Down
2 changes: 1 addition & 1 deletion ndk_library_scripts/get_ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ $# != 1 ] || [ $1 == '-h' ] || [ $1 == '--help' ]; then
fi

prefix=$(cd $1 && pwd)
URL=http://dl.google.com/android/ndk/android-ndk-r9-$system.tar.bz2
URL=http://dl.google.com/android/ndk/android-ndk-r10d-$system.tar.bz2

download_bz2 $URL $prefix

Expand Down
15 changes: 9 additions & 6 deletions tf2_ros/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ tasks.withType(JavaCompile) {
}

dependencies {
compile 'ros.android_core:android_gingerbread_mr1:0.0.0-SNAPSHOT'
compile 'com.github.rosjava.android_extras:gingerbread:0.1.0'
compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
compile 'org.ros.android_core:android_gingerbread_mr1:[0.1,0.2)'
compile 'org.ros.rosjava_core:rosjava:[0.1,0.2)'
compile 'com.github.rosjava.android_extras:gingerbread:[0.1,0.2)'
compile fileTree(dir: "$buildDir/native-libs", include: '*.jar')
}

apply plugin: 'android-library'
apply plugin: 'com.android.library'

android {
compileSdkVersion 10
buildToolsVersion androidBuildToolsVersion
}
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir 'src/main/libs'
}
}
10 changes: 5 additions & 5 deletions tf2_ros/src/main/java/org/ros/tf2_ros/Buffer.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.ros.tf2_ros;

import org.ros.message.Duration;
import org.ros.message.MessageFactory;
import org.ros.message.Time;
import org.ros.node.NodeConfiguration;

import geometry_msgs.Quaternion;
import geometry_msgs.Transform;
import geometry_msgs.TransformStamped;
import geometry_msgs.Vector3;
import std_msgs.Header;

import org.ros.message.Duration;
import org.ros.message.MessageFactory;
import org.ros.message.Time;
import org.ros.node.NodeConfiguration;

public class Buffer {
static {
System.loadLibrary("tf2_ros");
Expand Down
3 changes: 2 additions & 1 deletion tf2_ros/src/main/java/org/ros/tf2_ros/TransformListener.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.ros.tf2_ros;

import geometry_msgs.TransformStamped;
import org.ros.message.Duration;
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
Expand All @@ -10,6 +9,8 @@

import java.util.List;

import geometry_msgs.TransformStamped;

public class TransformListener extends AbstractNodeMain {

private Buffer mBuffer;
Expand Down
3 changes: 1 addition & 2 deletions tf2_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ dependencies {
compile project(':tf2_ros')
}

apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion 10
buildToolsVersion androidBuildToolsVersion
}

20 changes: 13 additions & 7 deletions tf2_test/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ros.tf2.tf2_test"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10"
android:targetSdkVersion="17" />
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.ros.tf2.tf2_test"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />

<application
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
tools:replace="android:icon"
android:allowBackup="true">
<activity android:name="Tf2Test"
android:label="@string/app_name"
android:screenOrientation="portrait">>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.ros.tf2.tf2_test;

import java.util.Iterator;
import java.util.ListIterator;
import java.util.Vector;

public class PermuteOption<T> {
Expand Down
2 changes: 0 additions & 2 deletions tf2_test/src/main/java/org/ros/tf2/tf2_test/Tf2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import android.widget.Button;
import android.widget.TextView;

import org.apache.http.util.ExceptionUtils;

public class Tf2Test extends Activity
{

Expand Down
3 changes: 1 addition & 2 deletions tf_broadcaster_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ dependencies {
compile project(':tf2_ros')
}

apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion 10
buildToolsVersion androidBuildToolsVersion
}
Loading