rviz crashes with out of memory error
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!