[ros-users] question about callback functions

Patrick Bouffard bouffard at eecs.berkeley.edu
Thu Jun 3 23:04:10 UTC 2010


@Josh: The OP hasn't responded, but I would like to hear what you'd
have to say if he said "C++".

I'm also interested in how to properly handle the possibility of
multiple subscriber callbacks within the same C++ node. Are these
handled in separate threads? Do I need then to implement locks and
such?

Or, as http://www.ros.org/wiki/roscpp/Overview/Callbacks%20and%20Spinning
seems to suggest, if I am just using ros::spin(), is each subscriber's
callback called sequentially, based on the order the messages were
received?

Thanks,
Pat

On Wed, May 26, 2010 at 12:09 PM, Josh Faust <jfaust at willowgarage.com> wrote:
> On Tue, May 25, 2010 at 11:40 PM, chriss lei <lei.chriss at gmail.com> wrote:
>>
>> Hello.
>> I got two questions about callback functions.
>>
>> 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.
>>
>> 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 answer to these are different depending on the language you're working
> with.  What language are you developing in?
>
> Josh
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>



More information about the ros-users mailing list