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

Callback implementation

asked 2012-04-05 10:32:25 -0500

alfa_80 gravatar image

updated 2012-04-05 10:38:20 -0500

I would like to know a low-level implementation on how callback is implemented in ROS. Does it use function pointers, function objects or commands and Hollywood or any others. Could somebody point me to any of its implementations.

Thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-04-05 22:02:57 -0500

Lorenz gravatar image

Function callbacks are based on C++ functor objects. roscpp normally uses something that's compatible with the return value of boost::bind, e.g. boost::function. There are a bunch of overloaded versions of subscribe that take normal function pointers though. Internally, these methods just use boost::bind to generate the functor object. Have a look at roscpp/include/ros/node_handle.h.

edit flag offensive delete link more


Thanks for the information and clarification.

alfa_80 gravatar image alfa_80  ( 2012-04-05 23:31:38 -0500 )edit

answered 2012-04-05 12:45:42 -0500

joq gravatar image

There are many different callbacks.

I believe most are implemented with boost::bind().

edit flag offensive delete link more


Thanks a lot for the information.

alfa_80 gravatar image alfa_80  ( 2012-04-05 21:09:34 -0500 )edit

Question Tools


Asked: 2012-04-05 10:32:25 -0500

Seen: 338 times

Last updated: Apr 05 '12