Building-Problems with TimeSynchronizer
Hi - I want to subscribe two topics of the Kinect (synchron). I followed the TimeSynchronizer Tutorial, but I have following errors when I build the code:
error: CMakeFiles/example.dir/src/test.o: undefined reference to symbol 'boost::signals::connection::~connection()'
error: note: 'boost::signals::connection::~connection()' is defined in DSO /usr/lib/libboost_signals.so.1.46.1 so try adding it to the linker command line
/usr/lib/libboost_signals.so.1.46.1
error: could not read symbols: Invalid operation error: collect2: ld returned 1 exit status
Here is the important part:
void callback (const sensor_msgs::ImageConstPtr& input_image, const sensor_msgs::ImageConstPtr& input_depth) {
//opencv stuff
}
int main(int argc, char** argv) {
ros::init(argc, argv, "hole_detection");
ros::NodeHandle nh;
cv::namedWindow("matches");
cv::namedWindow("depth");
message_filters::Subscriber<sensor_msgs::Image> image_sub(nh, "camera/rgb/image_rect_color", 1);
message_filters::Subscriber<sensor_msgs::Image> depth_sub(nh, "camera/depth_registered/image_rect", 1);
TimeSynchronizer<sensor_msgs::Image, sensor_msgs::Image> sync(image_sub, depth_sub, 10);
sync.registerCallback(boost::bind(&callback, _1, _2));
ros::spin ();
return 0;
}
Thank you very much :)