From d69de4ac53883f8aac8d76d088069fecb768c052 Mon Sep 17 00:00:00 2001
From: Max <1@porzelt.net>
Date: Sat, 8 Apr 2017 11:48:32 +0200
Subject: [PATCH 1/3] Update gradle
---
.gitignore | 2 +
build.gradle | 4 +-
gradle/wrapper/gradle-wrapper.properties | 4 +-
libraries/libraries.iml | 25 ++++
libraries/rosandroid-core/build.gradle | 7 +-
libraries/rosandroid-core/rosandroid-core.iml | 124 ++++++++++++++++
rosandroid-example-app/build.gradle | 17 ++-
.../rosandroid-example-app.iml | 132 ++++++++++++++++++
rosjava_android_template.iml | 19 +++
9 files changed, 317 insertions(+), 17 deletions(-)
create mode 100644 libraries/libraries.iml
create mode 100644 libraries/rosandroid-core/rosandroid-core.iml
create mode 100644 rosandroid-example-app/rosandroid-example-app.iml
create mode 100644 rosjava_android_template.iml
diff --git a/.gitignore b/.gitignore
index ba97d94..b98fe6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
/.idea/workspace.xml
/build
.DS_Store
+
+.idea
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index c7b9115..eb48bb8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,9 +3,10 @@
buildscript {
repositories {
mavenCentral()
+ jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.2.3'
+ classpath 'com.android.tools.build:gradle:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -19,5 +20,6 @@ allprojects {
name "rosjava-github"
url "https://github.com/rosjava/rosjava_mvn_repo/raw/master"
}
+ jcenter()
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 582438d..8fece65 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Fri Dec 05 12:41:53 CET 2014
+#Sat Apr 08 11:19:15 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/libraries/libraries.iml b/libraries/libraries.iml
new file mode 100644
index 0000000..d36a528
--- /dev/null
+++ b/libraries/libraries.iml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries/rosandroid-core/build.gradle b/libraries/rosandroid-core/build.gradle
index ec72567..cc7c1b6 100644
--- a/libraries/rosandroid-core/build.gradle
+++ b/libraries/rosandroid-core/build.gradle
@@ -1,8 +1,8 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 14
+ buildToolsVersion '25.0.0'
}
configurations {
@@ -10,14 +10,11 @@ configurations {
}
dependencies {
-
compile('org.ros.rosjava_core:rosjava:0.2.1') {
exclude group: 'xml-apis'
exclude group: 'junit'
}
-
compile 'org.ros.rosjava_messages:std_msgs:0.5.9'
compile 'org.ros.rosjava_messages:rosgraph_msgs:1.11.1'
compile 'org.ros.rosjava_messages:sensor_msgs:1.11.7'
-
}
diff --git a/libraries/rosandroid-core/rosandroid-core.iml b/libraries/rosandroid-core/rosandroid-core.iml
new file mode 100644
index 0000000..ce2ae2c
--- /dev/null
+++ b/libraries/rosandroid-core/rosandroid-core.iml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/rosandroid-example-app/build.gradle b/rosandroid-example-app/build.gradle
index 962d6ab..bc42ddf 100644
--- a/rosandroid-example-app/build.gradle
+++ b/rosandroid-example-app/build.gradle
@@ -1,16 +1,15 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
-
+ compileSdkVersion 14
+ buildToolsVersion '25.0.0'
defaultConfig {
- applicationId "org.ollide.rosandroid"
+ applicationId 'org.ollide.rosandroid'
// Android 4.0+ http://dannyroa.com/2013/10/17/why-its-time-to-support-only-android-4-0-and-above
minSdkVersion 14
- targetSdkVersion 22
+ targetSdkVersion 14
versionCode 1
- versionName "1.0"
+ versionName '0.1'
}
buildTypes {
release {
@@ -18,16 +17,16 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
-
packagingOptions {
/* https://github.com/rosjava/android_core/issues/194 */
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
+ productFlavors {
+ }
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
-
+ compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':libraries:rosandroid-core')
}
diff --git a/rosandroid-example-app/rosandroid-example-app.iml b/rosandroid-example-app/rosandroid-example-app.iml
new file mode 100644
index 0000000..a20a09b
--- /dev/null
+++ b/rosandroid-example-app/rosandroid-example-app.iml
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ generateDebugSources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/rosjava_android_template.iml b/rosjava_android_template.iml
new file mode 100644
index 0000000..cf58a0b
--- /dev/null
+++ b/rosjava_android_template.iml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 34b533a1d3835c0520a916b5ca56a93a0c82d84d Mon Sep 17 00:00:00 2001
From: Max <1@porzelt.net>
Date: Sat, 8 Apr 2017 18:34:56 +0200
Subject: [PATCH 2/3] Add example subscriber node
---
.../org/ollide/rosandroid/MainActivity.java | 7 ++--
.../rosandroid/SimpleSubscriberNode.java | 36 +++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
create mode 100644 rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java
diff --git a/rosandroid-example-app/src/main/java/org/ollide/rosandroid/MainActivity.java b/rosandroid-example-app/src/main/java/org/ollide/rosandroid/MainActivity.java
index 6180530..f95815a 100644
--- a/rosandroid-example-app/src/main/java/org/ollide/rosandroid/MainActivity.java
+++ b/rosandroid-example-app/src/main/java/org/ollide/rosandroid/MainActivity.java
@@ -38,11 +38,14 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
protected void init(NodeMainExecutor nodeMainExecutor) {
- NodeMain node = new SimplePublisherNode();
-
NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress());
nodeConfiguration.setMasterUri(getMasterUri());
+ NodeMain node = new SimplePublisherNode();
nodeMainExecutor.execute(node, nodeConfiguration);
+
+
+ NodeMain node2 = new SimpleSubscriberNode();
+ nodeMainExecutor.execute(node2, nodeConfiguration);
}
}
diff --git a/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java b/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java
new file mode 100644
index 0000000..6591bee
--- /dev/null
+++ b/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java
@@ -0,0 +1,36 @@
+package org.ollide.rosandroid;
+
+import org.apache.commons.logging.Log;
+import org.ros.message.MessageListener;
+import org.ros.namespace.GraphName;
+import org.ros.node.AbstractNodeMain;
+import org.ros.node.ConnectedNode;
+import org.ros.node.NodeMain;
+import org.ros.node.topic.Subscriber;
+
+/**
+ * Created by maximilianporzelt on 08.04.17.
+ * Note: http://rosjava.github.io/rosjava_core/0.1.6/getting_started.html
+ */
+
+public class SimpleSubscriberNode extends AbstractNodeMain {
+
+ private static final String TAG = SimpleSubscriberNode.class.getSimpleName();
+
+ @Override
+ public GraphName getDefaultNodeName() {
+ return GraphName.of("SimpleSubscriberNode/ListenerNode");
+ }
+
+ @Override
+ public void onStart(ConnectedNode connectedNode) {
+ final Log log = connectedNode.getLog();
+ Subscriber subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE);
+ subscriber.addMessageListener(new MessageListener() {
+ @Override
+ public void onNewMessage(std_msgs.String message) {
+ log.info("I heard: \"" + message.getData() + "\"");
+ }
+ });
+ }
+}
From f811a1e94aaa363e9246bcbc796662a35d9d6f88 Mon Sep 17 00:00:00 2001
From: Max <1@porzelt.net>
Date: Sat, 8 Apr 2017 21:48:26 +0200
Subject: [PATCH 3/3] Bugfix in logging
---
.../java/org/ollide/rosandroid/SimpleSubscriberNode.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java b/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java
index 6591bee..09951d1 100644
--- a/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java
+++ b/rosandroid-example-app/src/main/java/org/ollide/rosandroid/SimpleSubscriberNode.java
@@ -1,6 +1,7 @@
package org.ollide.rosandroid;
-import org.apache.commons.logging.Log;
+import android.util.Log;
+
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
@@ -13,7 +14,7 @@
* Note: http://rosjava.github.io/rosjava_core/0.1.6/getting_started.html
*/
-public class SimpleSubscriberNode extends AbstractNodeMain {
+public class SimpleSubscriberNode extends AbstractNodeMain implements NodeMain {
private static final String TAG = SimpleSubscriberNode.class.getSimpleName();
@@ -24,12 +25,11 @@ public GraphName getDefaultNodeName() {
@Override
public void onStart(ConnectedNode connectedNode) {
- final Log log = connectedNode.getLog();
Subscriber subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE);
subscriber.addMessageListener(new MessageListener() {
@Override
public void onNewMessage(std_msgs.String message) {
- log.info("I heard: \"" + message.getData() + "\"");
+ Log.i(TAG, "I heard: \"" + message.getData() + "\"");
}
});
}