From b6772be9004af98f6d682dfe59fb0bd0f1e752f3 Mon Sep 17 00:00:00 2001 From: Steffen Planthaber Date: Thu, 30 Mar 2017 11:04:07 +0200 Subject: [PATCH 1/4] adaptations to new rock-ros --- CMakeLists.txt | 7 ++++--- manifest.xml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b0562..bf2fccb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,11 +22,12 @@ link_directories(${OROCOS-RTT_LIBRARY_DIRS}) add_definitions(${OROCOS-RTT_DEFINITIONS}) if(NOT DEFINED ROS_FOUND) - find_package( ROS QUIET REQUIRED COMPONENTS roslib ) + # find_package( ROS QUIET REQUIRED COMPONENTS roslib ) + find_package( roscpp ) endif(NOT DEFINED ROS_FOUND) -include_directories(${ROS_INCLUDE_DIRS}) -link_directories(${ROS_LIBRARY_DIRS}) +include_directories(${roscpp_INCLUDE_DIRS}) +link_directories(${roscpp_LIBRARY_DIRS}) add_library(rtt-transport-ros-${OROCOS_TARGET} SHARED ros_publish_activity.cpp) diff --git a/manifest.xml b/manifest.xml index abac349..d79115b 100644 --- a/manifest.xml +++ b/manifest.xml @@ -4,7 +4,7 @@ Ruben Smits, ruben.smits@mech.kuleuven.be BSD http://ros.org/wiki/rtt_rosnode - + From 47f07bfcee2d44ad3d7cb13ae8053ac2900456f5 Mon Sep 17 00:00:00 2001 From: dmronga Date: Wed, 5 Jun 2019 15:53:43 +0200 Subject: [PATCH 2/4] Replace deprecated method from RTT::base::ChannelElementBase --- ros_msg_transporter.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ros_msg_transporter.hpp b/ros_msg_transporter.hpp index 160a9f9..7ca2de8 100644 --- a/ros_msg_transporter.hpp +++ b/ros_msg_transporter.hpp @@ -292,12 +292,12 @@ namespace ros { RTT::base::ChannelElementBase::shared_ptr tmp; if(is_sender){ tmp = RTT::base::ChannelElementBase::shared_ptr(new RosPubChannelElement(port,policy)); - buf->setOutput(tmp); + buf->connectTo(tmp); return buf; } else{ tmp = new RosSubChannelElement(port,policy); - tmp->setOutput(buf); + tmp->connectTo(buf); return tmp; } } From 4be6139705f6c71b7b330349e231ac76f5600125 Mon Sep 17 00:00:00 2001 From: dmronga Date: Thu, 6 Jun 2019 13:27:19 +0200 Subject: [PATCH 3/4] Use connectFrom() for incoming data --- ros_msg_transporter.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros_msg_transporter.hpp b/ros_msg_transporter.hpp index 7ca2de8..59c4edb 100644 --- a/ros_msg_transporter.hpp +++ b/ros_msg_transporter.hpp @@ -297,7 +297,7 @@ namespace ros { } else{ tmp = new RosSubChannelElement(port,policy); - tmp->connectTo(buf); + tmp->connectFrom(buf); return tmp; } } From ac66de9a574d16358465891952cdd36365229d6c Mon Sep 17 00:00:00 2001 From: dmronga Date: Tue, 11 Jun 2019 11:41:04 +0200 Subject: [PATCH 4/4] Add RTT version check --- ros_msg_transporter.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ros_msg_transporter.hpp b/ros_msg_transporter.hpp index 59c4edb..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); +#if(RTT_VERSION_MAJOR >= 2 && RTT_VERSION_MINOR >= 8 && RTT_VERSION_PATCH >= 99) tmp->connectFrom(buf); +#else + buf->setOutput(tmp); +#endif return tmp; } }