Interface ServiceClient<T,S>

Type Parameters:
T - the ServiceServer responds to requests of this type
S - the ServiceServer returns responses of this type
All Known Implementing Classes:
DefaultServiceClient

public interface ServiceClient<T,S>
Provides a connection to a ROS service.
Author:
damonkohler@google.com (Damon Kohler)
  • Method Details

    • connect

      void connect(URI uri)
      Connects to a ServiceServer.
      Parameters:
      uri - the URI of the ServiceServer to connect to
    • isConnected

      boolean isConnected()
      Returns:
      true if the ServiceClient is connected
    • call

      void call(T request, ServiceResponseListener<S> listener)
      Calls a method on the ServiceServer.
      Parameters:
      request - the request message
      listener - the ServiceResponseListener that will handle the response to this request
    • getName

      GraphName getName()
      Returns:
      the name of the service this ServiceClient is connected to
    • shutdown

      void shutdown()
      Stops the client (e.g. disconnect a persistent service connection).
    • newMessage

      T newMessage()
      Returns:
      a new request message