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)
53 this->topic_ = topic_name;
57 virtual void call(
const MReq & request, MRes & response)
override
68 virtual void callback(
unsigned char *data)
override
70 ret->deserialize(data);
73 virtual const char * getMsgType()
override
75 return this->resp.getType();
77 virtual const char * getMsgMD5()
override
79 return this->resp.getMD5();
81 virtual int getEndpointType()
override
83 return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER;