ClientInterfaceBase Class Template
Provides an interface to a service client that can send a single request at a time. WARNING - This class currently does not support calling syncSendRequest function asynchronously from multiple threads. More...
Declaration
class moveit_pro::behaviors::ClientInterfaceBase<ServiceT> { ... }
Included Headers
Derived Classes
| class | RclcppClientInterface<ServiceT> |
|
Implements ClientInterfaceBase for the rclcpp service client. More... | |
Public Destructor Index
template <typename ServiceT> | |
| ~ClientInterfaceBase ()=default | |
Public Member Functions Index
template <typename ServiceT> | |
| void | initialize (const std::string &service_name, std::chrono::duration< double > wait_for_server_timeout, std::chrono::duration< double > response_timeout)=0 |
|
Initialize the service client. More... | |
template <typename ServiceT> | |
| bool | waitForServiceServer () const =0 |
|
Block until the service server is ready or a timeout is exceeded. More... | |
template <typename ServiceT> | |
| auto | syncSendRequest (const typename ServiceT::Request &request)=0 -> tl::expected< typename ServiceT::Response, std::string > |
|
Send a service request and block until the response is received or a timeout is exceeded. More... | |
template <typename ServiceT> | |
| void | cancelRequest ()=0 |
|
Abort waiting on the service response future, if it has not yet been completed. More... | |
Description
Provides an interface to a service client that can send a single request at a time. WARNING - This class currently does not support calling syncSendRequest function asynchronously from multiple threads.
Definition at line 22 of file service_client_interface.hpp.
Public Destructor
~ClientInterfaceBase()
| virtual default |
Definition at line 25 of file service_client_interface.hpp.
Public Member Functions
cancelRequest()
|
Abort waiting on the service response future, if it has not yet been completed.
Definition at line 53 of file service_client_interface.hpp.
initialize()
|
Initialize the service client.
- Parameters
-
service_name Service name to use when initializing the client.
wait_for_server_timeout Duration to wait for the service server to be available before failing.
response_timeout Duration to wait for a response before failing. If the duration is negative, wait forever.
Definition at line 33 of file service_client_interface.hpp.
syncSendRequest()
|
Send a service request and block until the response is received or a timeout is exceeded.
- Returns
Returns the service response if it was received. If the timeout limit was reached before the response was received, return an error result.
Definition at line 48 of file service_client_interface.hpp.
waitForServiceServer()
|
Block until the service server is ready or a timeout is exceeded.
- Returns
True if the service server was found to be available before the timeout. False if it was not.
Definition at line 40 of file service_client_interface.hpp.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.