diff --git a/ros_msg_transporter.hpp b/ros_msg_transporter.hpp index 160a9f9..47b0ea9 100644 --- a/ros_msg_transporter.hpp +++ b/ros_msg_transporter.hpp @@ -291,13 +291,22 @@ namespace ros { RTT::base::ChannelElementBase* buf = internal::ConnFactory::buildDataStorage(policy); RTT::base::ChannelElementBase::shared_ptr tmp; if(is_sender){ + tmp = RTT::base::ChannelElementBase::shared_ptr(new RosPubChannelElement(port,policy)); +#if(RTT_VERSION_MAJOR >= 2 && RTT_VERSION_MINOR >= 8 && RTT_VERSION_PATCH >= 99) + buf->connectTo(tmp); +#else buf->setOutput(tmp); +#endif return buf; } else{ tmp = new RosSubChannelElement(port,policy); - tmp->setOutput(buf); +#if(RTT_VERSION_MAJOR >= 2 && RTT_VERSION_MINOR >= 8 && RTT_VERSION_PATCH >= 99) + tmp->connectFrom(buf); +#else + buf->setOutput(tmp); +#endif return tmp; } }