[ros-users] Question about policy-based synchronizer

Aditya Gadre agadre at vt.edu
Mon Oct 18 03:28:28 UTC 2010


I am a new ROS user and have been trying to try the policy based 
synchronizer. I copied the sample code from the wiki and was able to 
build and run it. However, when I changed that code in order to 
experiment, I ended up with a very long list of errors originating from 
the line that instantiates the message_filters::Synchronizer. The 
attached file lists the errors produced by the building process. The 
code is reproduced below. The same code builds just fine if I use 
sensor_msgs::Image instead of std_msgs::UInt32 and std_msgs::String classes.

I would appreciate any help in this matter!
Thanks,
- Aditya

=========================================
#include <std_msgs/UInt32.h>
#include <std_msgs/String.h>

#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>

void callback(const std_msgs::UInt32ConstPtr& pUint32,
         const std_msgs::StringConstPtr& pString)
{

}

int main(int argc, char* argv[])
{
     // init ros
     ros::init(argc, argv, "test_policy_synchronizer_node");

     ros::NodeHandle nh;
     message_filters::Subscriber<std_msgs::UInt32> subUint32(nh, 
"uint32", 1);
     message_filters::Subscriber<std_msgs::String> subString(nh, 
"string", 1);

     typedef 
message_filters::sync_policies::ApproximateTime<std_msgs::UInt32, 
std_msgs::String>
         MyApproxTimeSyncPolicy;

     // The following line results in errors that are listed in the 
attached file.
     message_filters::Synchronizer<MyApproxTimeSyncPolicy> 
sync(MyApproxTimeSyncPolicy(10), subUint32, subString);
//    sync.registerCallback(boost::bind(&callback, _1, _2));

     ros::spin();

     // done
     return 0;
}

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Build_error.txt
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101017/df7d5fd3/attachment-0004.txt>


More information about the ros-users mailing list