C++; arguments of message_filter's register_callback
Hello.
I'm using Ubuntu 16.04 and ROS kinetic.
I've just got a little problem.
Because I'm not still familiar with c++ programming, I don't know the below codes exactly.
message_filters::Subscriber<Image> image_sub(nh, "image", 1);
message_filters::Subscriber<CameraInfo> info_sub(nh, "camera_info", 1);
TimeSynchronizer<Image, CameraInfo> sync(image_sub, info_sub, 10);
registerCallback(boost::bind(&callback, _1, _2, _3)); // <------- this part!! ------>
What does each argumet_1, _2, _3 mean?
In python, I've ever used message_filter like following:
ts = message_filters.TimeSynchronizer([image_sub, info_sub], 10)
ts.registerCallback(callback)
and I guess maybe they both have the same meaning.
But I'm still not sure what the _1, _2, _3
means in registerCallback(boost::bind(&callback, _1, _2, _3));
PS. Maybe this belongs to C++ 's part simply, I think. But even so, would you please give me a piece of helpful advice?
Thanks in advance :)
Asked by kane_choigo on 2019-11-30 20:00:38 UTC
Comments
While this is really a C++ question (not a ROS one) as it is about
boost::bind(..)
, which is a generic piece of functionality from Boost, not ROS, I believe #q250014 answers a similar question.Could you check that question and see whether it clears things up for you?
Asked by gvdhoorn on 2019-12-01 07:19:08 UTC