From fc219e4eeecec712f8c1446288658cd5b61721c3 Mon Sep 17 00:00:00 2001 From: Thomas Timm Andersen Date: Thu, 17 Sep 2015 13:29:55 +0200 Subject: [PATCH] Limited the published IO state to 10 for pre 3.0 --- src/ur_ros_wrapper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ur_ros_wrapper.cpp b/src/ur_ros_wrapper.cpp index 7d7f207..f874b46 100644 --- a/src/ur_ros_wrapper.cpp +++ b/src/ur_ros_wrapper.cpp @@ -384,8 +384,10 @@ private: while (!robot_.sec_interface_->robot_state_->getNewDataAvailable()) { msg_cond_.wait(locker); } - - for (unsigned int i = 0; i < 18; i++) { + int i_max = 10; + if (robot_.sec_interface_->robot_state_->getVersion() > 3.0) + i_max = 18; // From version 3.0, there are up to 18 inputs and outputs + for (unsigned int i = 0; i < i_max; i++) { ur_msgs::Digital digi; digi.pin = i; digi.state =