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

Revision history [back]

click to hide/show revision 1
initial version

I managed to avoid this error like this: I changed the lifetime of the text marker to lifetime=rospy.Duration() (unlimited) and I publish a marker that deletes the text marker (same namespace and id) right before I publish the text. So at each iteration, whatever was sent in the previous iteration is deleted and the new text is published. The delete marker looks like this:

def delete_visible_faces(marker_publisher):
    print "delete_visible_faces", '\n'
    marker_del_visible_faces = Marker(
        ns='visible_faces',
        type=Marker.TEXT_VIEW_FACING,
        action=Marker.DELETE,
        id=1,
        pose=Pose(Point(0.0, 0.0, 0.0), Quaternion(0, 0, 0, 1)),
        scale=Vector3(0.1, 0.0, 0.0),
        header=Header(frame_id='hokuyo_link'),
        color=ColorRGBA(0.0, 0.0, 1.0, 0.8),
        frame_locked=False, 
        )
    marker_publisher.publish(marker_del_visible_faces)

I don't know if that was the cause of the problem, but at least this makes my code work without crashing the rviz. I also suspect that this is caused by a mismatch on my graphics card driver (which cause me some other problems in the past and I didn't find a way to solve that yet. ) I work on a Thinkpad Lenovo P1, with two graphic cards NVIDIA Quadro P1000 and Intel(R) UHD Graphics 630. If anyone knows if this error might be cause by the graphic cards drivers, please, feel free to share.