28 #ifndef ROSCPP_SERVICE_H 29 #define ROSCPP_SERVICE_H 32 #include "ros/common.h" 39 #include <boost/shared_ptr.hpp> 44 class ServiceServerLink;
64 template<
class MReq,
class MRes>
65 bool call(
const std::string& service_name, MReq& req, MRes& res)
67 namespace st = service_traits;
71 return client.
call(req, res);
84 template<
class Service>
85 bool call(
const std::string& service_name, Service& service)
87 namespace st = service_traits;
92 return client.
call(service.request, service.response);
103 ROSCPP_DECL
bool waitForService(
const std::string& service_name, int32_t timeout);
121 ROSCPP_DECL
bool exists(
const std::string& service_name,
bool print_failure_reason);
133 template<
class MReq,
class MRes>
151 template<
class Service>
163 #endif // ROSCPP_SERVICE_H ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
Create a client for a service, version templated on two message types.
Encapsulates all options available for creating a ServiceClient.
bool call(const std::string &service_name, MReq &req, MRes &res)
Invoke an RPC service.
bool call(MReq &req, MRes &res)
Call the service aliased by this handle with the specified request/response messages.
ROSCPP_DECL std::string resolve(const std::string &name, bool remap=true)
Resolve a graph resource name into a fully qualified graph resource name.
std::map< std::string, std::string > M_string
roscpp's interface for creating subscribers, publishers, etc.
boost::shared_ptr< ServiceServerLink > ServiceServerLinkPtr
Provides a handle-based interface to service client connections.
ROSCPP_DECL bool exists(const std::string &service_name, bool print_failure_reason)
Checks if a service is both advertised and available.
ROSCPP_DECL bool waitForService(const std::string &service_name, int32_t timeout)
Wait for a service to be advertised and available. Blocks until it is.
ServiceClient createClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
Create a client for a service.