Skip to main content

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

template <typename ServiceT>
class moveit_pro::behaviors::ClientInterfaceBase<ServiceT> { ... }

Included Headers

#include <service_client_interface.hpp>

Derived Classes

classRclcppClientInterface<ServiceT>

Implements ClientInterfaceBase for the rclcpp service client. More...

Public Destructor Index

template <typename ServiceT>
~ClientInterfaceBase ()=default

Public Member Functions Index

template <typename ServiceT>
voidinitialize (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>
boolwaitForServiceServer () 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>
voidcancelRequest ()=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()

template <typename ServiceT>
virtual moveit_pro::behaviors::ClientInterfaceBase< ServiceT >::~ClientInterfaceBase ()
virtual default

Definition at line 25 of file service_client_interface.hpp.

Public Member Functions

cancelRequest()

template <typename ServiceT>
virtual void moveit_pro::behaviors::ClientInterfaceBase< ServiceT >::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()

template <typename ServiceT>
virtual void moveit_pro::behaviors::ClientInterfaceBase< ServiceT >::initialize (const std::string & service_name, std::chrono::duration< double > wait_for_server_timeout, std::chrono::duration< double > response_timeout)

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()

template <typename ServiceT>
virtual tl::expected< typename ServiceT::Response, std::string > moveit_pro::behaviors::ClientInterfaceBase< ServiceT >::syncSendRequest (const typename ServiceT::Request & request)

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()

template <typename ServiceT>
virtual bool moveit_pro::behaviors::ClientInterfaceBase< ServiceT >::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.