Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Commit fe2b833

Browse files
authored
Merge pull request #229 from jubeira/dev/native-node-main
Small change to NativeNodeMain
2 parents 30bfd61 + 01dc810 commit fe2b833

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

rosjava/src/main/java/org/ros/node/NativeNodeMain.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
package org.ros.node;
22

3-
import org.ros.node.AbstractNodeMain;
4-
import org.ros.node.ConnectedNode;
5-
import org.ros.node.Node;
6-
import org.ros.namespace.GraphName;
7-
83
import org.apache.commons.logging.Log;
94
import org.apache.commons.logging.LogFactory;
105

11-
import java.util.List;
12-
import java.util.Map;
13-
146
/**
157
* A java wrapper to load and run a native-code ROS node.
168
*
@@ -70,16 +62,16 @@ public NativeNodeMain(String libName) {
7062
this(libName, null);
7163
}
7264

73-
// These methods define the execution model interface for this node.
74-
protected abstract void execute(String rosMasterUri, String rosHostName, String rosNodeName, String[] remappingArguments);
75-
protected abstract void shutdown();
65+
// These methods define the execution model interface for this node. Return values are error codes (not used by default).
66+
protected abstract int execute(String rosMasterUri, String rosHostName, String rosNodeName, String[] remappingArguments);
67+
protected abstract int shutdown();
7668

7769
@Override
7870
public void onStart(final ConnectedNode connectedNode) {
7971
// retain important ROS info
8072
masterUri = connectedNode.getMasterUri().toString();
8173
hostName = connectedNode.getUri().getHost();
82-
nodeName = this.libName;
74+
nodeName = getDefaultNodeName().toString();
8375

8476
// create a new thread to execute the native code.
8577
new Thread() {

0 commit comments

Comments
 (0)