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

rviz crashes with out of memory error

asked 2020-11-06 08:52:52 -0500

Spyros gravatar image

Hello. I have a simulation running in gazebo and visualize data in rviz. I start the rviz and I visualize some points with a launch file. Then with a publisher node I publish some lines and I add the topic manually in rviz. So far everything works as expected. When I add another marker element in the same namespace and with different id, to add some text caption for my lines, rviz shows my text, but when I move in the environment for a while the rviz crashes with the following error:

terminate called after throwing an instance of 'Ogre::InternalErrorException'
  what():  OGRE EXCEPTION(7:InternalErrorException): Vertex Buffer: Out of memory in GLHardwareVertexBuffer::lock at /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/OgreGLHardwareVertexBuffer.cpp (line 124)
[rviz-6] process has died [pid 25997, exit code -6, cmd /opt/ros/kinetic/lib/rviz/rviz -d /home/spyros/fast_ws/src/testplatform/testplatform_gazebo/rviz/rademaker.rviz __name:=rviz __log:=/home/spyros/.ros/log/61c369d8-203b-11eb-add8-4074e040d837/rviz-6.log].
log file: /home/spyros/.ros/log/61c369d8-203b-11eb-add8-4074e040d837/rviz-6*.log

I checked my available RAM as said here and I have 7GB available (so I guess is not a RAM problem). Here is how create the marker elements:

def show_visible_faces(marker_publisher, points, text):
    print "show_visible_faces", '\n'
    marker_visible_faces = Marker(
        ns='visible_faces',
        type=Marker.LINE_LIST,  # (0-1, 2-3, 4-5, ...)
        action=Marker.ADD,
        id=0,
        lifetime=rospy.Duration(0.5),
        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,  # ??? #
        points=points
        )

    marker_publisher.publish(marker_visible_faces)

    marker_visible_faces_caption = Marker(
        ns='visible_faces',
        type=Marker.TEXT_VIEW_FACING,
        action=Marker.ADD,
        id=1,
        lifetime=rospy.Duration(0.5),
        pose=Pose(Point(-1.0, 0.0, 0.0), Quaternion(0, 0, 0, 1)),
        scale=Vector3(0.00, 0.00, 0.3),
        header=Header(frame_id='hokuyo_link'),
        color=ColorRGBA(0.0, 1.0, 1.0, 1.0),
        frame_locked=False,  # ??? #
        text=text
    )
    marker_publisher.publish(marker_visible_faces_caption)

The "text" argument is the string I want to visualize together with my lines and its size changes with respect to time. Am I creating the marker correctly? I don't delete the marker every time since data should be over written when I publish a marker with the same id, right? When I don't use the marker visible_faces_caption rviz works fine. Can anyone give a hint about what I'm missing here, or what the problem could be?

I use Ubuntu 16.04 LTS, ROS Kinetic and I write in python.

Thank you in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-16 06:21:20 -0500

Spyros gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-11-06 08:52:52 -0500

Seen: 684 times

Last updated: Nov 16 '20