This might be a issue because I am using ros hydro, changing: nodename = nodename[1:].split(roslib.names.SEP)[-1] to: nodename = nodename[1:].split(rospy.names.SEP)[-1] Seems to fix the problem.