ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Very classic problem:

 while (ros::ok())
  { 
translation_pub.publish(testmsg);
 ros::spinOnce(); ///<<< here!
  }
  //ros::spin(); //That is wrong for that purpose ... you need ros::spinOnce above....
  return 0;

Very classic problem:

 while (ros::ok())
  { 
translation_pub.publish(testmsg);
 ros::spinOnce(); ///<<< here!
here, btw, spin does the callbacks!
  }
  //ros::spin(); //That is wrong for that purpose ... you need ros::spinOnce above....
  return 0;

Very classic problem:

 while (ros::ok())
  { 
translation_pub.publish(testmsg);
 ros::spinOnce(); ///<<< here, btw, spin does the callbacks!
  }
  //ros::spin(); //That is wrong for that purpose ... you need ros::spinOnce above....
  return 0;

Also try to delete build and devel in your workspace and build it again. Sometimes it also helps, when everything is rebuild.