34 #include <topic_proxy/GetMessage.h> 35 #include <topic_proxy/PublishMessage.h> 52 TopicProxy(
const std::string& host, uint32_t port = 0);
62 template <
class M>
void publishMessage(
const M& message,
const std::string& topic,
bool compressed =
false);
66 MessageInstanceConstPtr
send(GetMessage::Request&);
69 bool send(PublishMessage::Request&);
75 GetMessage::Request request;
76 request.topic = topic;
77 request.compressed = compressed;
78 request.timeout = timeout;
80 MessageInstanceConstPtr result =
send(request);
88 PublishMessage::Request request;
89 request.message.topic = topic;
90 request.message.md5sum = ros::message_traits::md5sum<M>(message);
91 request.message.type = ros::message_traits::datatype<M>(message);
92 request.message.message_definition = ros::message_traits::definition<M>(message);
93 request.message.blob.setCompressed(compressed);
94 request.message.blob.serialize(message);
101 #endif // TOPIC_PROXY_H boost::shared_ptr< const M > getMessage(const std::string &topic, ros::Duration timeout=ros::Duration(), bool compressed=false)
ServiceClient get_message_
const uint32_t g_default_port
const std::string g_get_message_service
const std::string g_publish_message_service
uint16_t getTCPPort() const
const std::string & getHost() const
MessageInstanceConstPtr send(GetMessage::Request &)
ServiceClient publish_message_
void publishMessage(const M &message, const std::string &topic, bool compressed=false)