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

You appear to be looking at the wrong overload.

The subscribe(..) call you show is the one for member functions, and the last argument is the object (not the class) on which the member function is defined.

As the subscriber is created for the current object, that reference would be this.

If it was some other object, it would not be this, but the name of the variable referring the object.

You appear to be looking at the wrong overload.

The subscribe(..) call you show is the one for member functions, and the last argument is the object (not the class) on which the member function is defined.defined (or: the instance of the class to pass to the member function when it is invoked).

As the subscriber is created for the current object, that reference would be this.

If it was some other object, it would not be this, but the name of the variable referring the object.