From 682c77582b9e9c4052589508c9af33766c4828a2 Mon Sep 17 00:00:00 2001 From: Thomas Timm Andersen Date: Fri, 19 Feb 2016 16:02:12 +0100 Subject: [PATCH] Removed info message about setting prefix when prefix is an empty string --- src/ur_ros_wrapper.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ur_ros_wrapper.cpp b/src/ur_ros_wrapper.cpp index 6280868..5dbb317 100644 --- a/src/ur_ros_wrapper.cpp +++ b/src/ur_ros_wrapper.cpp @@ -94,15 +94,17 @@ public: char buf[256]; if (ros::param::get("~prefix", joint_prefix)) { - sprintf(buf, "Setting prefix to %s", joint_prefix.c_str()); - print_info(buf); + if (joint_prefix.length() > 0) { + sprintf(buf, "Setting prefix to %s", joint_prefix.c_str()); + print_info(buf); + } + joint_names.push_back(joint_prefix + "shoulder_pan_joint"); + joint_names.push_back(joint_prefix + "shoulder_lift_joint"); + joint_names.push_back(joint_prefix + "elbow_joint"); + joint_names.push_back(joint_prefix + "wrist_1_joint"); + joint_names.push_back(joint_prefix + "wrist_2_joint"); + joint_names.push_back(joint_prefix + "wrist_3_joint"); } - joint_names.push_back(joint_prefix + "shoulder_pan_joint"); - joint_names.push_back(joint_prefix + "shoulder_lift_joint"); - joint_names.push_back(joint_prefix + "elbow_joint"); - joint_names.push_back(joint_prefix + "wrist_1_joint"); - joint_names.push_back(joint_prefix + "wrist_2_joint"); - joint_names.push_back(joint_prefix + "wrist_3_joint"); robot_.setJointNames(joint_names); use_ros_control_ = false;