[ros-users] question about callback functions
Blaise Gassend
blaise at willowgarage.com
Wed May 26 19:05:49 UTC 2010
> I'm wondering what happens if callback function has a blocking code inside
> and gets automatically called back because of a newly arriving message when
> the callback function is still busy.
The callback will not be called again until you
> Another thing I'm unclear about callback functions is if there exists an
> easy way to supply function input arguments to callback functions. Only
> example I found that does this is using registerCallBack method. Is there a
> easier way to supply function inputs?
The easiest way is for the callback to be a member function of a class.
You can then access any member variables from the callback. Alternately,
you can use boost::bind to create a boost::function in which you have
specified some of the arguments.
More information about the ros-users
mailing list