87 impl_->name_ = service_name;
88 impl_->persistent_ = persistent;
89 impl_->header_values_ = header_values;
90 impl_->service_md5sum_ = service_md5sum;
110 if (service_md5sum !=
impl_->service_md5sum_)
112 ROS_ERROR(
"Call to service [%s] with md5sum [%s] does not match md5sum when the handle was created ([%s])",
impl_->name_.c_str(), service_md5sum.c_str(),
impl_->service_md5sum_.c_str());
119 if (
impl_->persistent_)
121 if (!
impl_->server_link_)
125 if (!
impl_->server_link_)
131 link =
impl_->server_link_;
143 bool ret = link->call(req, resp);
162 return impl_->isValid();
169 return impl_->persistent_;
void shutdown()
Shutdown the connection associated with this ServiceClient.
bool isPersistent() const
Returns true if this handle points to a persistent service, false otherwise.
bool call(MReq &req, MRes &res)
Call the service aliased by this handle with the specified request/response messages.
static const ServiceManagerPtr & instance()
std::map< std::string, std::string > M_string
ServiceServerLinkPtr server_link_
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
Wait for this service to be advertised and available. Blocks until it is.
ROSCPP_DECL bool ok()
Check whether it's time to exit.
ROSCPP_DECL bool isShuttingDown()
Returns whether or not ros::shutdown() has been (or is being) called.
bool isValid() const
Returns whether or not this handle is valid. For a persistent service, this becomes false when the co...
Provides a handle-based interface to service client connections.
std::string getService()
Returns the name of the service this ServiceClient connects to.
ROSCPP_DECL bool exists(const std::string &service_name, bool print_failure_reason)
Checks if a service is both advertised and available.
bool exists()
Checks if this 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.