Package org.ros.node
Interface ConnectedNode
- All Superinterfaces:
Node
- All Known Implementing Classes:
DefaultNode
A node in the ROS graph that has successfully contacted the master.
A ConnectedNode serves as a factory for:
- Author:
- damonkohler@google.com (Damon Kohler)
-
Method Summary
Modifier and TypeMethodDescriptionorg.ros.message.TimeIn ROS, time can be wallclock (actual) or simulated, so it is important to usegetCurrentTime()instead of using the standard Java routines for determining the current time.Create aParameterTreeto query and set parameters on the ROS parameter server.<T,S> ServiceServer<T, S> getServiceServer(String serviceName) <T,S> ServiceServer<T, S> getServiceServer(GraphName serviceName) lookupServiceUri(String serviceName) lookupServiceUri(GraphName serviceName) <T> Publisher<T>newPublisher(String topicName, String messageType) <T> Publisher<T>newPublisher(GraphName topicName, String messageType) <T,S> ServiceClient<T, S> newServiceClient(String serviceName, String serviceType) <T,S> ServiceClient<T, S> newServiceClient(GraphName serviceName, String serviceType) Create aServiceClient.<T,S> ServiceServer<T, S> newServiceServer(String serviceName, String serviceType, ServiceResponseBuilder<T, S> serviceResponseBuilder) <T,S> ServiceServer<T, S> newServiceServer(GraphName serviceName, String serviceType, ServiceResponseBuilder<T, S> serviceResponseBuilder) Create a newServiceServer.<T> Subscriber<T>newSubscriber(String topicName, String messageType) <T> Subscriber<T>newSubscriber(String topicName, String messageType, TransportHints transportHints) <T> Subscriber<T>newSubscriber(GraphName topicName, String messageType) <T> Subscriber<T>newSubscriber(GraphName topicName, String messageType, TransportHints transportHints) Methods inherited from interface org.ros.node.Node
addListener, executeCancellableLoop, getLog, getMasterUri, getMessageSerializationFactory, getName, getResolver, getScheduledExecutorService, getServiceRequestMessageFactory, getServiceResponseMessageFactory, getTopicMessageFactory, getUri, removeListeners, resolveName, resolveName, shutdown
-
Method Details
-
getCurrentTime
org.ros.message.Time getCurrentTime()In ROS, time can be wallclock (actual) or simulated, so it is important to usegetCurrentTime()instead of using the standard Java routines for determining the current time.- Returns:
- the current time
-
newPublisher
- 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
Publisherfor the specified topic
-
newPublisher
- See Also:
-
newSubscriber
- Type Parameters:
T- the message type to create theSubscriberfor- Parameters:
topicName- the topic name to be subscribed to, this will be auto resolvedmessageType- the message data type (e.g. "std_msgs/String")- Returns:
- a
Subscriberfor the specified topic
-
newSubscriber
<T> Subscriber<T> newSubscriber(GraphName topicName, String messageType, TransportHints transportHints) - Type Parameters:
T- the message type to create theSubscriberfor- Parameters:
topicName- the topic name to be subscribed to, this will be auto resolvedmessageType- the message data type (e.g. "std_msgs/String")transportHints- the transport hints- Returns:
- a
Subscriberfor the specified topic
-
newSubscriber
- See Also:
-
newSubscriber
<T> Subscriber<T> newSubscriber(String topicName, String messageType, TransportHints transportHints) -
newServiceServer
<T,S> ServiceServer<T,S> newServiceServer(GraphName serviceName, String serviceType, ServiceResponseBuilder<T, S> serviceResponseBuilder) Create a newServiceServer.- Parameters:
serviceName- the name of the serviceserviceType- the type of the service (e.g. "rosjava_test_msgs/AddTwoInts")serviceResponseBuilder- called for every request to build a response- Returns:
- a
ServiceServer
-
newServiceServer
<T,S> ServiceServer<T,S> newServiceServer(String serviceName, String serviceType, ServiceResponseBuilder<T, S> serviceResponseBuilder) -
getServiceServer
- Parameters:
serviceName- theGraphNameof theServiceServer- Returns:
- the
ServiceServerwith the given name ornullif it does not exist
-
getServiceServer
- See Also:
-
lookupServiceUri
-
lookupServiceUri
- See Also:
-
newServiceClient
<T,S> ServiceClient<T,S> newServiceClient(GraphName serviceName, String serviceType) throws ServiceNotFoundException Create aServiceClient.- Parameters:
serviceName- the name of the serviceserviceType- the type of the service (e.g. "rosjava_test_msgs/AddTwoInts")- Returns:
- a
ServiceClient - Throws:
ServiceNotFoundException- thrown if no matching service could be found
-
newServiceClient
<T,S> ServiceClient<T,S> newServiceClient(String serviceName, String serviceType) throws ServiceNotFoundException - Throws:
ServiceNotFoundException- See Also:
-
getParameterTree
ParameterTree getParameterTree()Create aParameterTreeto query and set parameters on the ROS parameter server.- Returns:
ParameterTreewithNameResolverin this namespace.
-