mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
mrs_lib::ServiceClientHandler_impl< ServiceType > Class Template Reference

implementation of the service client handler More...

#include <service_client_handler.h>

Public Member Functions

 ServiceClientHandler_impl (void)
 default constructor
 
 ~ServiceClientHandler_impl (void)
 default destructor
 
 ServiceClientHandler_impl (ros::NodeHandle &nh, const std::string &address)
 constructor More...
 
bool call (ServiceType &srv)
 "classic" synchronous service call More...
 
bool call (ServiceType &srv, const int &attempts)
 "classic" synchronous service call with repeats after an error More...
 
bool call (ServiceType &srv, const int &attempts, const double &repeat_delay)
 "classic" synchronous service call with repeats after an error More...
 
std::future< ServiceType > callAsync (ServiceType &srv)
 asynchronous service call More...
 
std::future< ServiceType > callAsync (ServiceType &srv, const int &attempts)
 asynchronous service call with repeates after an error More...
 
std::future< ServiceType > callAsync (ServiceType &srv, const int &attempts, const double &repeat_delay)
 asynchronous service call with repeates after an error More...
 

Detailed Description

template<class ServiceType>
class mrs_lib::ServiceClientHandler_impl< ServiceType >

implementation of the service client handler

Constructor & Destructor Documentation

◆ ServiceClientHandler_impl()

template<class ServiceType >
mrs_lib::ServiceClientHandler_impl< ServiceType >::ServiceClientHandler_impl ( ros::NodeHandle &  nh,
const std::string &  address 
)

constructor

Parameters
nhROS node handler
addressservice address

Member Function Documentation

◆ call() [1/3]

template<class ServiceType >
bool mrs_lib::ServiceClientHandler_impl< ServiceType >::call ( ServiceType &  srv)

"classic" synchronous service call

Parameters
srvdata
Returns
true when success

◆ call() [2/3]

template<class ServiceType >
bool mrs_lib::ServiceClientHandler_impl< ServiceType >::call ( ServiceType &  srv,
const int &  attempts 
)

"classic" synchronous service call with repeats after an error

Parameters
srvdata
attemptshow many attempts for the call
Returns
true when success

◆ call() [3/3]

template<class ServiceType >
bool mrs_lib::ServiceClientHandler_impl< ServiceType >::call ( ServiceType &  srv,
const int &  attempts,
const double &  repeat_delay 
)

"classic" synchronous service call with repeats after an error

Parameters
srvdata
attemptshow many attempts for the call
repeat_delayhow long to wait before repeating the call
Returns
true when success

◆ callAsync() [1/3]

template<class ServiceType >
std::future< ServiceType > mrs_lib::ServiceClientHandler_impl< ServiceType >::callAsync ( ServiceType &  srv)

asynchronous service call

Parameters
srvdata
Returns
future result

◆ callAsync() [2/3]

template<class ServiceType >
std::future< ServiceType > mrs_lib::ServiceClientHandler_impl< ServiceType >::callAsync ( ServiceType &  srv,
const int &  attempts 
)

asynchronous service call with repeates after an error

Parameters
srvdata
attemptshow many attempts for the call
Returns
future result

◆ callAsync() [3/3]

template<class ServiceType >
std::future< ServiceType > mrs_lib::ServiceClientHandler_impl< ServiceType >::callAsync ( ServiceType &  srv,
const int &  attempts,
const double &  repeat_delay 
)

asynchronous service call with repeates after an error

Parameters
srvdata
attemptshow many attempts for the call
repeat_delayhow long to wait before repeating the call
Returns
future result

The documentation for this class was generated from the following files: