Package org.ros.node
Class NativeNodeMain
java.lang.Object
org.ros.node.AbstractNodeMain
org.ros.node.NativeNodeMain
- All Implemented Interfaces:
NodeListener,NodeMain
A java wrapper to load and run a native-code ROS node.
Note: there are no actual native methods declared in this class. We only define an interface. The native methods should be declared in the child class.
Native methods' return codes can be handled by the application using
AbstractNodeMain.onError(Node, Throwable).- Author:
- ecorbellini@creativa77.com.ar (Ernesto Corbellini)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionNativeNodeMain(String libName) NativeNodeMain(String libName, String[] remappings) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intvoidonShutdown(Node node) Called when theConnectedNodehas started shutting down.voidonStart(ConnectedNode connectedNode) Called when theNodehas started and successfully connected to the master.protected abstract intshutdown()Methods inherited from class org.ros.node.AbstractNodeMain
onError, onShutdownCompleteMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ros.node.NodeMain
getDefaultNodeName
-
Field Details
-
SUCCESS
public static final int SUCCESS- See Also:
-
executeReturnCode
protected int executeReturnCode -
shutdownReturnCode
protected int shutdownReturnCode
-
-
Constructor Details
-
NativeNodeMain
- Parameters:
libName- The name of the library to load.remappings- A string array with ROS argument remapping pairs in each element.
-
NativeNodeMain
- Parameters:
libName- The name of the library to load.
-
-
Method Details
-
execute
-
shutdown
protected abstract int shutdown() -
onStart
Description copied from interface:NodeListenerCalled when theNodehas started and successfully connected to the master.- Specified by:
onStartin interfaceNodeListener- Overrides:
onStartin classAbstractNodeMain- Parameters:
connectedNode- theConnectedNodethat has been started
-
onShutdown
Description copied from interface:NodeListenerCalled when theConnectedNodehas started shutting down. Shutdown will be delayed, although not indefinitely, until allNodeListeners have returned from this method.Since this method can potentially delay
ConnectedNodeshutdown, it is preferred to useNodeListener.onShutdownComplete(Node)whenConnectedNoderesources are not required during the method call.- Specified by:
onShutdownin interfaceNodeListener- Overrides:
onShutdownin classAbstractNodeMain- Parameters:
node- theNodethat has started shutting down
-