ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

no matching function for call to message_filters::sync_policies::ApproximateTime

asked 2012-12-06 02:27:03 -0600

raminzohouri gravatar image

updated 2014-01-28 17:14:29 -0600

ngrennan gravatar image

Hi All I am using ROS to subscribe some camera topics in two different ways. Fist subscribe Topic from published messages and second subscribe them directly from bag file without playing bag the file , just read it directly.

in this program i have two different constructor one for published message and the other for reading file in each of the there are functions which do these tasks.

I have this error :

**/opt/ros/fuerte/include/message_filters/synchronizer.h:152: error: no matching function for call to 'message_filters::sync_policies::ApproximateTime<sensor_msgs::CameraInfo_<std::allocator<void> >, sensor_msgs::Image_<std::allocator<void> >, sensor_msgs::Image_<std::allocator<void> > >::ApproximateTime()'**

these are my constructors :

//for reading bag file 

FOVISODOMETRY::FOVISODOMETRY(vector<string> cameraTopices,
        const string bagFileName, const char* visual_odom_frame_name)
{
/// some implementations 
}

////for subscribing from published massages 

FOVISODOMETRY::FOVISODOMETRY(const char* image_topic,
        const char* depth_image_topic, const char* camera_info_topic,
        const char* visual_odom_frame_name) :
        initialized_(false), fovis_initialized_(false), depth_image_(NULL),       depth_data_(
                NULL), grayscale_data_(NULL), rect_(NULL), odom_(NULL), node_(
                ""), private_node_("~"), camera_info_sub_(node_,
                camera_info_topic, 100), rgb_image_sub_(node_, image_topic,
                100), depth_image_sub_(node_, depth_image_topic, 100),image_sync_(
                ApproximateTimeCustomPolicy(10), camera_info_sub_,
                rgb_image_sub_, depth_image_sub_), odom_broadcaster_()

{
/// some implementations 
}

and these are the massage filter Synchronizer :

typedef message_filters::sync_policies::ApproximateTime<
            sensor_msgs::CameraInfo, sensor_msgs::Image, sensor_msgs::Image> ApproximateTimeCustomPolicy;

message_filters::Synchronizer<ApproximateTimeCustomPolicy> image_sync_;

there is one point : when I omit the file reading constructor its has no error but as soon as I add the second constructor the error appears .

please let me how can I have both of my constructors and also no error

thank you in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-12-06 23:54:04 -0600

raminzohouri gravatar image

Hi Christian

Thank you for you answer. It was a good hint , but in order to get ride of that error I have to do initialize the second constructor like this :

FOVISODOMETRY::FOVISODOMETRY(vector<string> cameraTopices, const string bagFileName, const char visual_odom_frame_name):image_sync_( ApproximateTimeCustomPolicy(10), camera_info_sub_, rgb_image_sub_, depth_image_sub_)*

but I still have one question : Although I don't use it in second constructor ,why should I initialize this message_filter::synchronizer ? would you please help me on this !

thanks in advance . Ramin

typedef message_filters::sync_policies::ApproximateTime< sensor_msgs::CameraInfo, sensor_msgs::Image, sensor_msgs::Image> ApproximateTimeCustomPolicy; message_filters::Synchronizer<approximatetimecustompolicy> image_sync_;

edit flag offensive delete link more

Comments

Please read the support guidelines before posting. Do not create answers for comments, updates and additional information. Instead, edit your original post or use the comment functionality. If you have additional questions, open a new question. This is not a forum.

Lorenz gravatar image Lorenz  ( 2012-12-07 00:03:56 -0600 )edit

There is not default constructor, so you need to provide the parameters to the constructor by hand, otherwise the object cannot be created.

dornhege gravatar image dornhege  ( 2012-12-07 00:09:10 -0600 )edit
2

answered 2012-12-06 04:24:36 -0600

dornhege gravatar image

Initialize the approx time policy:

FOVISODOMETRY::FOVISODOMETRY(vector<string> cameraTopices,
        const string bagFileName, const char* visual_odom_frame_name) :  ApproximateTimeCustomPolicy(10)
{
/// some implementations 
}
edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-12-06 02:27:03 -0600

Seen: 1,852 times

Last updated: Dec 06 '12