Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your callbacks are called in ros::spin(), ros::spinOnce() or via asych spinner etc. Your code in contrast just does busy waiting. Modify your wait for first frame like:

 // Wait for the first frame:
  while(!new_cloud_available_flag) 
    {
      std::cout<<"waiting for first frame\n";
      ros::Duration( 0.01 ).sleep();
      ros::spinOnce();
    }