org.ros.node
Interface Node

All Known Subinterfaces:
ConnectedNode
All Known Implementing Classes:
DefaultNode

public interface Node

A node in the ROS graph.


Method Summary
 void addListener(NodeListener listener)
          Add a new NodeListener to the Node.
 void executeCancellableLoop(CancellableLoop cancellableLoop)
          Executes a CancellableLoop using the Node's ScheduledExecutorService.
 org.apache.commons.logging.Log getLog()
           
 java.net.URI getMasterUri()
           
 MessageSerializationFactory getMessageSerializationFactory()
           
 GraphName getName()
           
 NodeNameResolver getResolver()
           
 java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
           
 MessageFactory getServiceRequestMessageFactory()
           
 MessageFactory getServiceResponseMessageFactory()
           
 MessageFactory getTopicMessageFactory()
           
 java.net.URI getUri()
           
 void removeListener(NodeListener listener)
          Remove a NodeListener from the Node.
 GraphName resolveName(GraphName name)
          Resolve the given name, using ROS conventions, into a full ROS namespace name.
 GraphName resolveName(java.lang.String name)
           
 void shutdown()
          Shut the node down.
 

Method Detail

getName

GraphName getName()
Returns:
the fully resolved name of this Node, e.g. "/foo/bar/boop"

resolveName

GraphName resolveName(GraphName name)
Resolve the given name, using ROS conventions, into a full ROS namespace name. Will be relative to the current namespace unless the name is global.

Parameters:
name - the name to resolve
Returns:
fully resolved ros namespace name

resolveName

GraphName resolveName(java.lang.String name)
See Also:
resolveName(GraphName)

getResolver

NodeNameResolver getResolver()
Returns:
NodeNameResolver for this namespace

getUri

java.net.URI getUri()
Returns:
the URI of this Node

getMasterUri

java.net.URI getMasterUri()
Returns:
URI of MasterXmlRpcEndpoint that this node is attached to.

getLog

org.apache.commons.logging.Log getLog()
Returns:
Logger for this node, which will also perform logging to /rosout.

getMessageSerializationFactory

MessageSerializationFactory getMessageSerializationFactory()
Returns:
the MessageSerializationFactory used by this node

getTopicMessageFactory

MessageFactory getTopicMessageFactory()
Returns:
the MessageFactory used by this node

getServiceResponseMessageFactory

MessageFactory getServiceResponseMessageFactory()
Returns:
the MessageFactory used by this node for service responses

getServiceRequestMessageFactory

MessageFactory getServiceRequestMessageFactory()
Returns:
the MessageFactory used by this node for service requests

addListener

void addListener(NodeListener listener)
Add a new NodeListener to the Node.

Parameters:
listener - the NodeListener to add

removeListener

void removeListener(NodeListener listener)
Remove a NodeListener from the Node.

If the given NodeListener is not registered, this has no effect.

Parameters:
listener - the NodeListener to remove

getScheduledExecutorService

java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
Returns:
the ScheduledExecutorService that this Node uses

executeCancellableLoop

void executeCancellableLoop(CancellableLoop cancellableLoop)
Executes a CancellableLoop using the Node's ScheduledExecutorService. The CancellableLoop will be canceled when the Node starts shutting down.

Any blocking calls executed in the provided CancellableLoop can potentially delay Node shutdown and should be avoided.

Parameters:
cancellableLoop - the CancellableLoop to execute

shutdown

void shutdown()
Shut the node down.