What does the rospy.subscriber command do? [closed]
I cant able to understand what this code does. Explanation in wiki page is n ot clear to me. someone please help me understand what the below code is.
if __name__ == '__main__':
rospy.init_node('turtle_tf_broadcaster')
turtlename = rospy.get_param('~turtle')
rospy.Subscriber('/%s/pose' % turtlename,
turtlesim.msg.Pose,
handle_turtle_pose,
turtlename)
rospy.spin()
You need to clarify what exactly you do not understand. Also, it would help if you link to the wiki page you refer to. Is this a tutorial? Something specifc? Then we might be able to help...
http://wiki.ros.org/tf/Tutorials/Writ... this is a tf broadcaster tutorial. I don't understand the rospy.subscriber command. Thank you mgruhler
I edited your question title to somewhat reflect what you are having trouble with.
Subscribers are a very basic concept of ROS. If you are working through the tf tutorials, I guess you have read the ROS Getting Started section, especially the Concepts and followed the Beginner Tutorials. There is one specifically dealing with how to create a subscriber in python. There, everything is explained in detail.
When you've gone through those tutorials and still have questions, please come back and provide more details what you don't understand.
Thank you mgruhler
I marked the question as outdated as I think your last comment means you've actually solved your issues. If not, please feel free to reopen the question and provide the respective details (or, post a new, more comprehensive and detailed, question)