ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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;
2 | No.2 Revision |
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;
3 | No.3 Revision |
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.