0
$\begingroup$

Rosanswers logo

I would like to know if there there a way to wrap a ROS class callback function in a method to be used as a convenience API. I know that we could possibly achieve this via adapter design pattern, but then when this is coupled with middleware constructs it is harder to see or implement.

Anyone has an idea?


Originally posted by alfa_80 on ROS Answers with karma: 1053 on 2014-09-02

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You can certainly wrap ROS callback functions, however I can't think of an application for that approach, since you would need to manually provide the data the callback expects (whether message or request/response arguments). If you mean, can you reuse a generic function as a ROS callback, you can also use boost::bind to bind a function with arbitrary arguments.


Originally posted by paulbovbel with karma: 4518 on 2014-09-02

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.