Ask Your Question

Additional Arguments to dynamic reconfigure callback.

asked 2019-02-20 13:20:28 -0600

ben2789 gravatar image

(also posted as issue on dynamic reconfigure git, possibly not appropriate for there) I am trying to use dynamic configure to set some camera parameters. I would like to pass a pointer to the camera object into the callback, so that I can use it's methods for setting the camera values. Is it possible to pass additional arguments to the dynamic reconfigure callback? Callback: void dr_callback(camera_node::dynamic_reconfig &parameters, uint32_t levels){ // set global object of parameters }

Binding: dr_callback = boost::bind(dr_callback, _1, _2); dr_server.setCallback(dr_callback);

ideal callback: void dr_callback_function(jai_camera_node::dynamic_reconfigConfig &parameters, uint32_t levels, cam_type *cam){ // use camera member functions to change values }

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-20 16:21:42 -0600

ben2789 gravatar image

passing a reference to the camera as an additional argument works fine. This is because the result of bind(function, _1 , _2, camera_ptr) is a two parameter function pointer which can be accepted by setCallback().

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-02-20 13:20:28 -0600

Seen: 49 times

Last updated: Feb 20 '19