ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Got it! There is the rospy.get_name()
which returns the current name (even when renamed with <node name="..." />
). I can use this to get my msg
parameter:
def talker():
rospy.init_node('talker')
name = rospy.get_name()
msg = 'default message'
if rospy.has_param('/' + name + '/msg'):
msg = rospy.get_param('/' + name + '/msg', msg)
...