ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The author is telling the function (in this case the constructor for the rospy subscriber class) which particular arguments the value they are passing in is for. If you look at the documentation for the subscriber class you will notice the __init__() function has name,data_class, and callback as arguments in the function definition. You don't necessarily have to do that, but then you need to be careful about the order in which you pass in the values to the function. Basically, the authors are explicitly telling the function which argument each value they pass in relates to.

Docs: Subscriber

The author is telling the function (in this case the constructor for the rospy subscriber class) which particular arguments the value they are passing in is for. If you look at the documentation for the subscriber class you will notice the __init__() function has name,data_class, and callback as arguments in the function definition. You don't necessarily have to do that, but then you need to be careful about the order in which you pass in the values to the function. Basically, the authors are explicitly telling the function which argument each value they pass in relates to.

Docs: Subscriber