35 #ifndef _ROS_SERVICE_CLIENT_H_ 36 #define _ROS_SERVICE_CLIENT_H_ 38 #include "rosserial_msgs/TopicInfo.h" 40 #include "ros/publisher.h" 41 #include "ros/subscriber.h" 46 template<
typename MReq ,
typename MRes>
47 class ServiceClient :
public Subscriber_
51 pub(topic_name, &req, rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_PUBLISHER)
57 virtual void call(
const MReq & request, MRes & response)
68 virtual void callback(
unsigned char *data)
70 ret->deserialize(data);
73 virtual const char * getMsgType()
75 return this->resp.getType();
77 virtual const char * getMsgMD5()
79 return this->resp.getMD5();
81 virtual int getEndpointType()
83 return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER;
void publish(const boost::shared_ptr< M > &message) const
bool call(MReq &req, MRes &res)
virtual bool connected()=0