org.ros.node
Interface ConnectedNode

All Superinterfaces:
Node
All Known Implementing Classes:
DefaultNode

public interface ConnectedNode
extends Node

A node in the ROS graph that has successfully contacted the master.

A ConnectedNode serves as a factory for:


Method Summary
 Time getCurrentTime()
          In ROS, time can be wallclock (actual) or simulated, so it is important to use getCurrentTime() instead of using the standard Java routines for determining the current time.
 ParameterTree getParameterTree()
          Create a ParameterTree to query and set parameters on the ROS parameter server.
<T,S> ServiceServer<T,S>
getServiceServer(GraphName serviceName)
           
<T,S> ServiceServer<T,S>
getServiceServer(java.lang.String serviceName)
           
 java.net.URI lookupServiceUri(GraphName serviceName)
           
 java.net.URI lookupServiceUri(java.lang.String serviceName)
           
<T> Publisher<T>
newPublisher(GraphName topicName, java.lang.String messageType)
           
<T> Publisher<T>
newPublisher(java.lang.String topicName, java.lang.String messageType)
           
<T,S> ServiceClient<T,S>
newServiceClient(GraphName serviceName, java.lang.String serviceType)
          Create a ServiceClient.
<T,S> ServiceClient<T,S>
newServiceClient(java.lang.String serviceName, java.lang.String serviceType)
           
<T,S> ServiceServer<T,S>
newServiceServer(GraphName serviceName, java.lang.String serviceType, ServiceResponseBuilder<T,S> serviceResponseBuilder)
          Create a new ServiceServer.
<T,S> ServiceServer<T,S>
newServiceServer(java.lang.String serviceName, java.lang.String serviceType, ServiceResponseBuilder<T,S> serviceResponseBuilder)
           
<T> Subscriber<T>
newSubscriber(GraphName topicName, java.lang.String messageType)
           
<T> Subscriber<T>
newSubscriber(java.lang.String topicName, java.lang.String messageType)
           
 
Methods inherited from interface org.ros.node.Node
addListener, executeCancellableLoop, getLog, getMasterUri, getMessageSerializationFactory, getName, getResolver, getScheduledExecutorService, getServiceRequestMessageFactory, getServiceResponseMessageFactory, getTopicMessageFactory, getUri, removeListener, resolveName, resolveName, shutdown
 

Method Detail

getCurrentTime

Time getCurrentTime()
In ROS, time can be wallclock (actual) or simulated, so it is important to use getCurrentTime() instead of using the standard Java routines for determining the current time.

Returns:
the current time

newPublisher

<T> Publisher<T> newPublisher(GraphName topicName,
                              java.lang.String messageType)
Type Parameters:
T - the message type to create the publisher for
Parameters:
topicName - the topic name, will be pushed down under this namespace unless '/' is prepended.
messageType - the message data type (e.g. "std_msgs/String")
Returns:
a Publisher for the specified topic

newPublisher

<T> Publisher<T> newPublisher(java.lang.String topicName,
                              java.lang.String messageType)
See Also:
newPublisher(GraphName, String)

newSubscriber

<T> Subscriber<T> newSubscriber(GraphName topicName,
                                java.lang.String messageType)
Type Parameters:
T - the message type to create the Subscriber for
Parameters:
topicName - the topic name to be subscribed to, this will be auto resolved
messageType - the message data type (e.g. "std_msgs/String")
Returns:
a Subscriber for the specified topic

newSubscriber

<T> Subscriber<T> newSubscriber(java.lang.String topicName,
                                java.lang.String messageType)
See Also:
newSubscriber(GraphName, String)

newServiceServer

<T,S> ServiceServer<T,S> newServiceServer(GraphName serviceName,
                                          java.lang.String serviceType,
                                          ServiceResponseBuilder<T,S> serviceResponseBuilder)
Create a new ServiceServer.

Parameters:
serviceName - the name of the service
serviceType - the type of the service (e.g. "test_ros/AddTwoInts")
serviceResponseBuilder - called for every request to build a response
Returns:
a ServiceServer

newServiceServer

<T,S> ServiceServer<T,S> newServiceServer(java.lang.String serviceName,
                                          java.lang.String serviceType,
                                          ServiceResponseBuilder<T,S> serviceResponseBuilder)
See Also:
newServiceServer(GraphName, String, ServiceResponseBuilder)

getServiceServer

<T,S> ServiceServer<T,S> getServiceServer(GraphName serviceName)
Parameters:
serviceName - the GraphName of the ServiceServer
Returns:
the ServiceServer with the given name or null if it does not exist

getServiceServer

<T,S> ServiceServer<T,S> getServiceServer(java.lang.String serviceName)
See Also:
getServiceServer(GraphName)

lookupServiceUri

java.net.URI lookupServiceUri(GraphName serviceName)
Parameters:
serviceName - the GraphName of the service URI to lookup
Returns:
the URI of the service or null if it does not exist

lookupServiceUri

java.net.URI lookupServiceUri(java.lang.String serviceName)
See Also:
lookupServiceUri(GraphName)

newServiceClient

<T,S> ServiceClient<T,S> newServiceClient(GraphName serviceName,
                                          java.lang.String serviceType)
                                    throws ServiceNotFoundException
Create a ServiceClient.

Parameters:
serviceName - the name of the service
serviceType - the type of the service (e.g. "test_ros/AddTwoInts")
Returns:
a ServiceClient
Throws:
ServiceNotFoundException - thrown if no matching service could be found

newServiceClient

<T,S> ServiceClient<T,S> newServiceClient(java.lang.String serviceName,
                                          java.lang.String serviceType)
                                    throws ServiceNotFoundException
Throws:
ServiceNotFoundException
See Also:
newServiceClient(GraphName, String)

getParameterTree

ParameterTree getParameterTree()
Create a ParameterTree to query and set parameters on the ROS parameter server.

Returns:
ParameterTree with NameResolver in this namespace.