Refer the code in velodyne_camera_calibration , when I run the code, it doesn't terminate and has no error but it doesn't continue in the middle(line 198 and line 190). In order to have convenient debug, I add some "cout" to print something.
message_filters::Subscriber<sensor_msgs::Image> image_sub(n, CAMERA_FRAME_TOPIC, 1);
message_filters::Subscriber<sensor_msgs::CameraInfo> info_sub(n, CAMERA_INFO_TOPIC, 1);
message_filters::Subscriber<sensor_msgs::PointCloud2> cloud_sub(n, VELODYNE_TOPIC, 1);
typedef sync_policies::ApproximateTime<sensor_msgs::Image, sensor_msgs::CameraInfo, sensor_msgs::PointCloud2> MySyncPolicy;
Synchronizer<MySyncPolicy> sync(MySyncPolicy(10), image_sub, info_sub, cloud_sub);
cout << "breakpoint 1 " << endl;
sync.registerCallback(boost::bind(&callback, _1, _2, _3)); // Add "cout << "breakpoint 2" << endl;" at the beginning of callback function
cout << "breakpoint 3" << endl;
ros::spin();
cout <<"breakpoint 4" << endl;
After I run the code, only "breakpoint 1" and "breakpoint 3" show up. It means that the callback function is skipped and ros::spin is not implementing.
Can anyone help me figure out where the problem is ? Thanks!
Originally posted by KWL on ROS Answers with karma: 3 on 2016-08-02
Post score: 0