Skip to content
Snippets Groups Projects
Commit 01dc810b authored by Juan Ignacio Ubeira's avatar Juan Ignacio Ubeira
Browse files

Abstract methods execute and shutdown now return an error code.

Corrected nodeName.
parent 30bfd614
No related branches found
No related tags found
No related merge requests found
package org.ros.node;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.Node;
import org.ros.namespace.GraphName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.List;
import java.util.Map;
/**
* A java wrapper to load and run a native-code ROS node.
*
......@@ -70,16 +62,16 @@ public abstract class NativeNodeMain extends AbstractNodeMain {
this(libName, null);
}
// These methods define the execution model interface for this node.
protected abstract void execute(String rosMasterUri, String rosHostName, String rosNodeName, String[] remappingArguments);
protected abstract void shutdown();
// These methods define the execution model interface for this node. Return values are error codes (not used by default).
protected abstract int execute(String rosMasterUri, String rosHostName, String rosNodeName, String[] remappingArguments);
protected abstract int shutdown();
@Override
public void onStart(final ConnectedNode connectedNode) {
// retain important ROS info
masterUri = connectedNode.getMasterUri().toString();
hostName = connectedNode.getUri().getHost();
nodeName = this.libName;
nodeName = getDefaultNodeName().toString();
// create a new thread to execute the native code.
new Thread() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment