Create wall timer using callback with parameters - ROS2, C++
Hi. I have two image msg synchronized as follows:
message_filters::TimeSynchronizer<Image, Image> sync(image_1, image_2, 10);
sync.registerCallback(boost::bind(&callback, _1, _2));
It works until here. Now I'd want to define an interval between triggers of the callback using create_wall_timer. I tried:
node->create_wall_timer(500ms, boost::bind(&callback, _1, _2));
But I'm getting errors when using it
error: no matching function for call to ‘rclcpp::Node::create_wall_timer(std::chrono::milliseconds, boost::_bi::bind_t<void, void (*)(const std::shared_ptr<const sensor_msgs::msg::Image_<std::allocator<void> > >&, const std::shared_ptr<const sensor_msgs::msg::Image_<std::allocator<void> > >&), boost::_bi::list2<boost::arg<1>, boost::arg<2> > >)
What would be the proper way to use it? Thanks in advance.
obs: I tried with a callback without parameters node->create_wall_timer(500ms, &callback_test)
and it works fine...
obs: alternatives to create_wall_timer are also welcome!