From aef955412838c3dcb9c07fe9535cc0b84a82ffa6 Mon Sep 17 00:00:00 2001 From: simondlevy Date: Mon, 16 Jul 2018 22:38:58 -0700 Subject: [PATCH] Added brief pause before map display to support refresh on slower machines --- examples/pltslamshow.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/pltslamshow.py b/examples/pltslamshow.py index d85c1ff..47eacdc 100644 --- a/examples/pltslamshow.py +++ b/examples/pltslamshow.py @@ -25,6 +25,7 @@ import matplotlib.pyplot as plt import matplotlib.cm as colormap from math import sin, cos, radians import numpy as np +from time import sleep class SlamShow(object): @@ -78,6 +79,9 @@ class SlamShow(object): mapimg = np.reshape(np.frombuffer(mapbytes, dtype=np.uint8), (self.map_size_pixels, self.map_size_pixels)) + # Pause to allow display to refresh + sleep(.001) + if self.img_artist is None: self.img_artist = self.ax.imshow(mapimg, cmap=colormap.gray)