Exit gracefully

This commit is contained in:
Dr. Simon Levy
2016-08-10 16:38:17 -04:00
parent 043c14339f
commit 4c8255711e
2 changed files with 5 additions and 10 deletions

View File

@@ -104,9 +104,9 @@ def main():
display.displayRobot((x_mm, y_mm, theta_degrees))
# Exit gracefully if user closes display
key = display.refresh()
if key != None and (key&0x1A):
if not display.refresh():
exit(0)
# XXX Add delay for real-time plot

View File

@@ -166,17 +166,12 @@ class SlamShow(object):
except:
return False
# Rotate image 270 degrees
#wid,hgt = cv.GetSize(self.image)
#mapMatrix = cv2.getRotationMatrix2D((wid/2,hgt/2), 270, 1.0)
#cv.WarpAffine(self.image, self.image, cv.fromarray(mapMatrix))
# Display image
cv.ShowImage(self.window_name, self.image)
# Force image display, returning any key hit
# Force image display, returning False if user hit ESC, True otherwise
key = cvdisplay()
return key if key > -1 else None
return False if key==27 else True
def waitkey(self, action):