ROS2/create_subscription: How to pass callback arguments
In ROS 1, I was able to pass arguments to the callback function of a subscriber: rospy.Subscriber(topic_name, type, call_back, call_back_arg)
How can I do this in ROS2? My goal is to pass the name of the topic. Because I have a single call back for many topics and when the callback is invoked, I need to know what topic called it. It there a better way to find this? Thank you
Hey,I am also kind of stuck at same situation. can you post the answer if you have already.
Please see the below answer