|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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)
DefaultNode s 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)
DefaultNode
s should only be constructed using the
DefaultNodeFactory
.
nodeConfiguration
- the NodeConfiguration
for this Node
nodeListeners
- a Collection
of NodeListener
s that will be added
to this Node
before it startsMethod Detail |
---|
public <T> Publisher<T> newPublisher(GraphName topicName, java.lang.String messageType)
newPublisher
in interface ConnectedNode
T
- 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 topicpublic <T> Publisher<T> newPublisher(java.lang.String topicName, java.lang.String messageType)
newPublisher
in interface ConnectedNode
ConnectedNode.newPublisher(GraphName, String)
public <T> Subscriber<T> newSubscriber(GraphName topicName, java.lang.String messageType)
newSubscriber
in interface ConnectedNode
T
- 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 topicpublic <T> Subscriber<T> newSubscriber(java.lang.String topicName, java.lang.String messageType)
newSubscriber
in interface ConnectedNode
ConnectedNode.newSubscriber(GraphName, String)
public <T,S> ServiceServer<T,S> newServiceServer(GraphName serviceName, java.lang.String serviceType, ServiceResponseBuilder<T,S> responseBuilder)
ConnectedNode
ServiceServer
.
newServiceServer
in interface ConnectedNode
serviceName
- 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 ConnectedNode
ConnectedNode.newServiceServer(GraphName, String,
ServiceResponseBuilder)
public <T,S> ServiceServer<T,S> getServiceServer(GraphName serviceName)
getServiceServer
in interface ConnectedNode
serviceName
- 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 ConnectedNode
ConnectedNode.getServiceServer(GraphName)
public java.net.URI lookupServiceUri(GraphName serviceName)
lookupServiceUri
in interface ConnectedNode
serviceName
- 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 ConnectedNode
ConnectedNode.lookupServiceUri(GraphName)
public <T,S> ServiceClient<T,S> newServiceClient(GraphName serviceName, java.lang.String serviceType) throws ServiceNotFoundException
ConnectedNode
ServiceClient
.
newServiceClient
in interface ConnectedNode
serviceName
- the name of the serviceserviceType
- the type of the service (e.g. "test_ros/AddTwoInts")
ServiceClient
ServiceNotFoundException
- thrown if no matching service could be foundpublic <T,S> ServiceClient<T,S> newServiceClient(java.lang.String serviceName, java.lang.String serviceType) throws ServiceNotFoundException
newServiceClient
in interface ConnectedNode
ServiceNotFoundException
ConnectedNode.newServiceClient(GraphName, String)
public Time getCurrentTime()
ConnectedNode
ConnectedNode.getCurrentTime()
instead of using the standard
Java routines for determining the current time.
getCurrentTime
in interface ConnectedNode
public GraphName getName()
getName
in interface Node
Node
, e.g. "/foo/bar/boop"public org.apache.commons.logging.Log getLog()
getLog
in interface Node
public GraphName resolveName(GraphName name)
Node
resolveName
in interface Node
name
- the name to resolve
public GraphName resolveName(java.lang.String name)
resolveName
in interface Node
Node.resolveName(GraphName)
public void shutdown()
Node
shutdown
in interface Node
public java.net.URI getMasterUri()
getMasterUri
in interface Node
URI
of MasterXmlRpcEndpoint
that this node is
attached to.public NodeNameResolver getResolver()
getResolver
in interface Node
NodeNameResolver
for this namespacepublic ParameterTree getParameterTree()
ConnectedNode
ParameterTree
to query and set parameters on the ROS
parameter server.
getParameterTree
in interface ConnectedNode
ParameterTree
with NameResolver
in this namespace.public java.net.URI getUri()
getUri
in interface Node
URI
of this Node
public MessageSerializationFactory getMessageSerializationFactory()
getMessageSerializationFactory
in interface Node
MessageSerializationFactory
used by this nodepublic MessageFactory getTopicMessageFactory()
getTopicMessageFactory
in interface Node
MessageFactory
used by this nodepublic MessageFactory getServiceRequestMessageFactory()
getServiceRequestMessageFactory
in interface Node
MessageFactory
used by this node for service requestspublic MessageFactory getServiceResponseMessageFactory()
getServiceResponseMessageFactory
in interface Node
MessageFactory
used by this node for service responsespublic void addListener(NodeListener listener)
Node
NodeListener
to the Node
.
addListener
in interface Node
listener
- the NodeListener
to addpublic void removeListener(NodeListener listener)
Node
NodeListener
from the Node
.
If the given NodeListener
is not registered, this has no effect.
removeListener
in interface Node
listener
- the NodeListener
to removepublic java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
getScheduledExecutorService
in interface Node
ScheduledExecutorService
that this Node
usespublic void executeCancellableLoop(CancellableLoop cancellableLoop)
Node
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.
executeCancellableLoop
in interface Node
cancellableLoop
- the CancellableLoop
to execute
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |