Ask Your Question
0

message_filters approximate time does not compile

asked 2016-03-21 13:10:45 -0500

jappoz gravatar image

Hello everyone
I have a problem that I never had in the past I would like to synchronize two messages with Approximate Policy using message filters but I got an error. The portion of the code is :

sync = new message_filters::Synchronizer<MySyncPolicy> (MySyncPolicy(10), img_sub, rectangles_sub);
sync->registerCallback(boost::bind(&ObjectDetectorBasic::monoCallback, this, _1));
sync->registerCallback(boost::bind(&ObjectDetectorBasic::roisCallback, this, _2));

where ObjectDetectorBasic is my class implemented like

namespace pdt_module{
 // the methods of the class
  }

and the callbacks interfaces are

void roisCallback(const icars_stixel_generator::Rectangles::ConstPtr& rectangles);
void monoCallback(const sensor_msgs::Image& src);

the problem is that I get building error:

In file included from /usr/include/boost/bind.hpp:22:0, from /opt/ros/indigo/include/ros/publisher.h:35, from /opt/ros/indigo/include/ros/node_handle.h:32, from /opt/ros/indigo/include/ros/ros.h:45, from /home/jacopo/catkin_ws/src/icars/pdt_module/src/object_detector/ObjectDetectorBasic.hpp:6, from /home/jacopo/catkin_ws/src/icars/pdt_module/src/object_detector/ObjectDetectorBasic.cpp:4: /usr/include/boost/bind/bind.hpp: In instantiation of ‘void boost::_bi::list2<a1, a2="">::operator()(boost::_bi::type<void>, F&, A&, int) [with F = boost::_mfi::mf1<void, pdt_module::objectdetectorbasic,="" const="" sensor_msgs::image_<std::allocator<void=""> >&>; A = boost::_bi::list9<const boost::shared_ptr<const="" sensor_msgs::image_<std::allocator<void=""> > >&, const boost::shared_ptr<const icars_stixel_generator::rectangles_<std::allocator<void=""> > >&, const boost::shared_ptr<const message_filters::nulltype="">&, const boost::shared_ptr<const message_filters::nulltype="">&, const boost::shared_ptr<const message_filters::nulltype="">&, const boost::shared_ptr<const message_filters::nulltype="">&, const boost::shared_ptr<const message_filters::nulltype="">&, const boost::shared_ptr<const message_filters::nulltype="">&, const boost::shared_ptr<const message_filters::nulltype="">&>; A1 = boost::_bi::value<pdt_module::objectdetectorbasic*>; A2 = boost::arg<1>]’: /usr/include/boost/bind/bind_template.hpp:305:59: required from ‘boost::_bi::bind_t<r, f,="" l="">::result_type boost::_bi::bind_t<r, f,="" l="">::operator()(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&) [with A1 = boost::shared_ptr<const sensor_msgs::image_<std::allocator<void=""> > >; A2 = boost::shared_ptr<const icars_stixel_generator::rectangles_<std::allocator<void=""> > >; A3 = boost::shared_ptr<const message_filters::nulltype="">; A4 = boost::shared_ptr<const message_filters::nulltype="">; A5 = boost::shared_ptr<const message_filters::nulltype="">; A6 = boost::shared_ptr<const message_filters::nulltype="">; A7 = boost::shared_ptr<const message_filters::nulltype="">; A8 = boost::shared_ptr<const message_filters::nulltype="">; A9 = boost::shared_ptr<const message_filters::nulltype="">; R = void; F = boost::_mfi::mf1<void, pdt_module::objectdetectorbasic,="" const="" sensor_msgs::image_<std::allocator<void=""> >&>; L = boost::_bi::list2<boost::_bi::value<pdt_module::objectdetectorbasic*>, boost::arg<1> >; boost::_bi::bind_t<r, f,="" l="">::result_type = void]’ /usr/include/boost/bind/bind.hpp:827:34: required from ‘void boost::_bi::list9<a1, a2,="" a3,="" a4,="" a5,="" a6,="" a7,="" a8,="" a9="">::operator()(boost::_bi::type<void>, F&, A&, int) [with F = boost::_bi::bind_t<void, boost::_mfi::mf1<void,="" pdt_module::objectdetectorbasic,="" const="" sensor_msgs::image_<std::allocator<void=""> >&>, boost::_bi::list2<boost::_bi::value<pdt_module::objectdetectorbasic*>, boost::arg<1> > >; A = boost::_bi::list9<const boost::shared_ptr<const="" sensor_msgs::image_<std::allocator<void=""> > >&, const boost::shared_ptr<const icars_stixel_generator::rectangles_<std::allocator<void=""> > >&, const boost::shared_ptr<const message_filters ...

(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2016-03-21 20:46:17 -0500

kmhallen gravatar image

It is expecting a boost constant pointer. Try this:

void monoCallback(const sensor_msgs::Image::ConstPtr& src);
edit flag offensive delete link more

Comments

Thank you, this fixed the problem!

jappoz gravatar image jappoz  ( 2016-03-22 02:17:09 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2016-03-21 13:10:45 -0500

Seen: 374 times

Last updated: Mar 21 '16