ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The problem is not that the marker is not published; the problem is that Rviz didn't have time to be started at the first marker publishing.
The solution is to give time to Rviz to start before publishing anything:
// Color
marker.color.r = marker.color.b = 0.2;
marker.color.g = 0.6f;
marker.color.a = 1.0;
sleep(5); // TODO: Give time to Rviz to be fully started
marker_pub.publish(marker);
return 0;
2 | No.2 Revision |
The problem is not that the marker is not published; the problem is that Rviz didn't have time to be started at the first marker publishing.
The solution is to give time to Rviz to start before publishing anything:
// Color
marker.color.r = marker.color.b = 0.2;
marker.color.g = 0.6f;
marker.color.a = 1.0;
sleep(5); // TODO: Give time to Rviz to be fully started
marker_pub.publish(marker);
return 0;
As @dornhege mentioned this is not ideal. The best option is to use a latched publisher.
3 | No.3 Revision |
The problem is not that the marker is not published; the problem is that Rviz didn't have time to be started at the first marker publishing.
The solution is to give time to Rviz to start before publishing anything:
// Color
marker.color.r = marker.color.b = 0.2;
marker.color.g = 0.6f;
marker.color.a = 1.0;
sleep(5); // TODO: Give time to Rviz to be fully started
marker_pub.publish(marker);
return 0;
As @dornhege mentioned this is not ideal. The best Another option is to use a latched publisher.