How to set the parameter to let message_filters enter callback function
I want to use message_filters to get the image and imu message at the same time,but it's works sometimes because of different imu message frequency, I want to know how to set ApproximatePolicy param,here shows the code
message_filters::Subscriber<Image> image1_sub(nh, "/stereo/left/image_raw", 1);
message_filters::Subscriber<Image> image2_sub(nh, "/stereo/right/image_raw", 1);
message_filters::Subscriber<Imu> imu_sub(nh, "/inertial_tf/imu", 1);
message_filters::Subscriber<NavSatFix> gps_sub(nh, "/inertial_tf/gps", 1);
typedef ApproximateTime<Image, Image,Imu,NavSatFix> ApproximatePolicy;
typedef message_filters::Synchronizer<ApproximatePolicy> ApproximateSync;
boost::shared_ptr<ApproximateSync> approximate_sync_;
approximate_sync_.reset( new ApproximateSync(ApproximatePolicy(2000),
image1_sub, image2_sub,imu_sub,gps_sub) );
approximate_sync_->registerCallback(boost::bind(&imgimumsgFilter::callback,
&iif, _1, _2, _3, _4));
it works fine with this param when the frequency of image is 20Hz, and frequency of IMU is 100Hz, but when the frequency of IMU change to 60Hz,it did't work ,even I change the subscribe queue size and approximate time ,it is still didn't work and can't enter the callback function, so I want to know how to set this param correctly.Thanks!