mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
mrs_lib::ServiceClientHandler< ServiceType >::Impl< ServiceType > Class Template Reference

implementation of the service client handler More...

#include <service_client_handler.hpp>

Public Member Functions

 Impl (rclcpp::Node::SharedPtr &node, const std::string &address, const rclcpp::QoS &qos, const rclcpp::CallbackGroup::SharedPtr &callback_group)
 constructor
 
std::optional< std::shared_ptr< typename ServiceType::Response > > callSync (const std::shared_ptr< typename ServiceType::Request > &request)
 "classic" synchronous service call
 
std::optional< std::shared_future< std::shared_ptr< typename ServiceType::Response > > > callAsync (const std::shared_ptr< typename ServiceType::Request > &request)
 asynchronous service call
 

Detailed Description

template<class ServiceType>
template<class ServiceType>
class mrs_lib::ServiceClientHandler< ServiceType >::Impl< ServiceType >

implementation of the service client handler

Constructor & Destructor Documentation

◆ Impl()

template<class ServiceType >
template<class ServiceType >
mrs_lib::ServiceClientHandler< ServiceType >::Impl< ServiceType >::Impl ( rclcpp::Node::SharedPtr &  node,
const std::string &  address,
const rclcpp::QoS &  qos,
const rclcpp::CallbackGroup::SharedPtr &  callback_group 
)
inline

constructor

Parameters
nodeROS node handler
addressservice address
qosQOS
callback_groupcallback group

Member Function Documentation

◆ callAsync()

template<class ServiceType >
template<class ServiceType >
std::optional< std::shared_future< std::shared_ptr< typename ServiceType::Response > > > mrs_lib::ServiceClientHandler< ServiceType >::Impl< ServiceType >::callAsync ( const std::shared_ptr< typename ServiceType::Request > &  request)
inline

asynchronous service call

Parameters
requestrequest
Returns
optional shared future to the result

◆ callSync()

template<class ServiceType >
template<class ServiceType >
std::optional< std::shared_ptr< typename ServiceType::Response > > mrs_lib::ServiceClientHandler< ServiceType >::Impl< ServiceType >::callSync ( const std::shared_ptr< typename ServiceType::Request > &  request)
inline

"classic" synchronous service call

Parameters
requestrequest
Returns
optional shared pointer to the response

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