|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ros.internal.node.DefaultNode
public class DefaultNode
The default implementation of a Node.
| Constructor Summary | |
|---|---|
DefaultNode(NodeConfiguration nodeConfiguration,
java.util.Collection<NodeListener> nodeListeners,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
DefaultNodes should only be constructed using the
DefaultNodeFactory. |
|
| 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. |
|
Time |
getCurrentTime()
In ROS, time can be wallclock (actual) or simulated, so it is important to use ConnectedNode.getCurrentTime() instead of using the standard
Java routines for determining the current time. |
|
org.apache.commons.logging.Log |
getLog()
|
|
java.net.URI |
getMasterUri()
|
|
MessageSerializationFactory |
getMessageSerializationFactory()
|
|
GraphName |
getName()
|
|
ParameterTree |
getParameterTree()
Create a ParameterTree to query and set parameters on the ROS
parameter server. |
|
NodeNameResolver |
getResolver()
|
|
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutorService()
|
|
MessageFactory |
getServiceRequestMessageFactory()
|
|
MessageFactory |
getServiceResponseMessageFactory()
|
|
|
getServiceServer(GraphName serviceName)
|
|
|
getServiceServer(java.lang.String serviceName)
|
|
MessageFactory |
getTopicMessageFactory()
|
|
java.net.URI |
getUri()
|
|
java.net.URI |
lookupServiceUri(GraphName serviceName)
|
|
java.net.URI |
lookupServiceUri(java.lang.String serviceName)
|
|
|
newPublisher(GraphName topicName,
java.lang.String messageType)
|
|
|
newPublisher(java.lang.String topicName,
java.lang.String messageType)
|
|
|
newServiceClient(GraphName serviceName,
java.lang.String serviceType)
Create a ServiceClient. |
|
|
newServiceClient(java.lang.String serviceName,
java.lang.String serviceType)
|
|
|
newServiceServer(GraphName serviceName,
java.lang.String serviceType,
ServiceResponseBuilder<T,S> responseBuilder)
Create a new ServiceServer. |
|
|
newServiceServer(java.lang.String serviceName,
java.lang.String serviceType,
ServiceResponseBuilder<T,S> responseBuilder)
|
|
|
newSubscriber(GraphName topicName,
java.lang.String messageType)
|
|
|
newSubscriber(java.lang.String topicName,
java.lang.String messageType)
|
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultNode(NodeConfiguration nodeConfiguration,
java.util.Collection<NodeListener> nodeListeners,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
DefaultNodes should only be constructed using the
DefaultNodeFactory.
nodeConfiguration - the NodeConfiguration for this NodenodeListeners - a Collection of NodeListeners that will be added
to this Node before it starts| Method Detail |
|---|
public <T> Publisher<T> newPublisher(GraphName topicName,
java.lang.String messageType)
newPublisher in interface ConnectedNodeT - the message type to create the publisher fortopicName - the topic name, will be pushed down under this namespace unless
'/' is prepended.messageType - the message data type (e.g. "std_msgs/String")
Publisher for the specified topic
public <T> Publisher<T> newPublisher(java.lang.String topicName,
java.lang.String messageType)
newPublisher in interface ConnectedNodeConnectedNode.newPublisher(GraphName, String)
public <T> Subscriber<T> newSubscriber(GraphName topicName,
java.lang.String messageType)
newSubscriber in interface ConnectedNodeT - the message type to create the Subscriber fortopicName - the topic name to be subscribed to, this will be auto resolvedmessageType - the message data type (e.g. "std_msgs/String")
Subscriber for the specified topic
public <T> Subscriber<T> newSubscriber(java.lang.String topicName,
java.lang.String messageType)
newSubscriber in interface ConnectedNodeConnectedNode.newSubscriber(GraphName, String)
public <T,S> ServiceServer<T,S> newServiceServer(GraphName serviceName,
java.lang.String serviceType,
ServiceResponseBuilder<T,S> responseBuilder)
ConnectedNodeServiceServer.
newServiceServer in interface ConnectedNodeserviceName - the name of the serviceserviceType - the type of the service (e.g. "test_ros/AddTwoInts")responseBuilder - called for every request to build a response
ServiceServer
public <T,S> ServiceServer<T,S> newServiceServer(java.lang.String serviceName,
java.lang.String serviceType,
ServiceResponseBuilder<T,S> responseBuilder)
newServiceServer in interface ConnectedNodeConnectedNode.newServiceServer(GraphName, String,
ServiceResponseBuilder)public <T,S> ServiceServer<T,S> getServiceServer(GraphName serviceName)
getServiceServer in interface ConnectedNodeserviceName - the GraphName of the ServiceServer
ServiceServer with the given name or null if it
does not existpublic <T,S> ServiceServer<T,S> getServiceServer(java.lang.String serviceName)
getServiceServer in interface ConnectedNodeConnectedNode.getServiceServer(GraphName)public java.net.URI lookupServiceUri(GraphName serviceName)
lookupServiceUri in interface ConnectedNodeserviceName - the GraphName of the service URI to lookup
URI of the service or null if it does not existpublic java.net.URI lookupServiceUri(java.lang.String serviceName)
lookupServiceUri in interface ConnectedNodeConnectedNode.lookupServiceUri(GraphName)
public <T,S> ServiceClient<T,S> newServiceClient(GraphName serviceName,
java.lang.String serviceType)
throws ServiceNotFoundException
ConnectedNodeServiceClient.
newServiceClient in interface ConnectedNodeserviceName - the name of the serviceserviceType - the type of the service (e.g. "test_ros/AddTwoInts")
ServiceClient
ServiceNotFoundException - thrown if no matching service could be found
public <T,S> ServiceClient<T,S> newServiceClient(java.lang.String serviceName,
java.lang.String serviceType)
throws ServiceNotFoundException
newServiceClient in interface ConnectedNodeServiceNotFoundExceptionConnectedNode.newServiceClient(GraphName, String)public Time getCurrentTime()
ConnectedNodeConnectedNode.getCurrentTime() instead of using the standard
Java routines for determining the current time.
getCurrentTime in interface ConnectedNodepublic GraphName getName()
getName in interface NodeNode, e.g. "/foo/bar/boop"public org.apache.commons.logging.Log getLog()
getLog in interface Nodepublic GraphName resolveName(GraphName name)
Node
resolveName in interface Nodename - the name to resolve
public GraphName resolveName(java.lang.String name)
resolveName in interface NodeNode.resolveName(GraphName)public void shutdown()
Node
shutdown in interface Nodepublic java.net.URI getMasterUri()
getMasterUri in interface NodeURI of MasterXmlRpcEndpoint that this node is
attached to.public NodeNameResolver getResolver()
getResolver in interface NodeNodeNameResolver for this namespacepublic ParameterTree getParameterTree()
ConnectedNodeParameterTree to query and set parameters on the ROS
parameter server.
getParameterTree in interface ConnectedNodeParameterTree with NameResolver in this namespace.public java.net.URI getUri()
getUri in interface NodeURI of this Nodepublic MessageSerializationFactory getMessageSerializationFactory()
getMessageSerializationFactory in interface NodeMessageSerializationFactory used by this nodepublic MessageFactory getTopicMessageFactory()
getTopicMessageFactory in interface NodeMessageFactory used by this nodepublic MessageFactory getServiceRequestMessageFactory()
getServiceRequestMessageFactory in interface NodeMessageFactory used by this node for service requestspublic MessageFactory getServiceResponseMessageFactory()
getServiceResponseMessageFactory in interface NodeMessageFactory used by this node for service responsespublic void addListener(NodeListener listener)
NodeNodeListener to the Node.
addListener in interface Nodelistener - the NodeListener to addpublic void removeListener(NodeListener listener)
NodeNodeListener from the Node.
If the given NodeListener is not registered, this has no effect.
removeListener in interface Nodelistener - the NodeListener to removepublic java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
getScheduledExecutorService in interface NodeScheduledExecutorService that this Node usespublic void executeCancellableLoop(CancellableLoop cancellableLoop)
NodeCancellableLoop 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.
executeCancellableLoop in interface NodecancellableLoop - the CancellableLoop to execute
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||