Skip to content

Commit

Permalink
Update Gradle plugin version.
Browse files Browse the repository at this point in the history
  • Loading branch information
esteve committed Oct 29, 2017
1 parent 8e84178 commit 7008299
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ros2_listener_android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: org.ros2.tools.gradle.AmentPlugin
apply plugin: 'org.ros2.tools.gradle'
apply plugin: 'me.tatarka.retrolambda'

sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -26,7 +26,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'gradle.plugin.org.ros2.tools.gradle:ament:0.5.1'
classpath 'gradle.plugin.org.ros2.tools.gradle:ament:0.6.1'
classpath 'me.tatarka:gradle-retrolambda:3.6.1'
}
}
Expand Down
4 changes: 2 additions & 2 deletions ros2_talker_android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: org.ros2.tools.gradle.AmentPlugin
apply plugin: 'org.ros2.tools.gradle'
apply plugin: 'me.tatarka.retrolambda'

sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -26,7 +26,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'gradle.plugin.org.ros2.tools.gradle:ament:0.5.1'
classpath 'gradle.plugin.org.ros2.tools.gradle:ament:0.6.1'
classpath 'me.tatarka:gradle-retrolambda:3.6.1'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void onClick(final View view) {
buttonStart.setEnabled(false);
buttonStop.setEnabled(true);
getExecutor().addNode(talkerNode);
talkerNode.start();
}
};

Expand All @@ -84,6 +85,7 @@ public void onClick(final View view) {
buttonStart.setEnabled(true);
buttonStop.setEnabled(false);
Log.d(logtag, "onClick() ended - stop button");
talkerNode.stop();
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@

import java.util.concurrent.TimeUnit;

import android.util.Log;

import org.ros2.rcljava.node.BaseComposableNode;
import org.ros2.rcljava.publisher.Publisher;
import org.ros2.rcljava.timer.WallTimer;

public class TalkerNode extends BaseComposableNode {

private static String logtag = TalkerNode.class.getName();

private final String topic;

private Publisher<std_msgs.msg.String> publisher;
Expand All @@ -38,6 +43,7 @@ public TalkerNode(final String name, final String topic) {
}

public void start() {
Log.d(logtag, "TalkerNode::start()");
if (this.timer != null) {
this.timer.cancel();
}
Expand All @@ -53,6 +59,7 @@ private void onTimer() {
}

public void stop() {
Log.d(logtag, "TalkerNode::stop()");
if (this.timer != null) {
this.timer.cancel();
}
Expand Down

0 comments on commit 7008299

Please sign in to comment.