Exit on window close
This commit is contained in:
@@ -59,8 +59,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
display.setPose(x, y, theta)
|
display.setPose(x, y, theta)
|
||||||
|
|
||||||
# Exit on ESCape
|
# Exit on window close
|
||||||
key = display.refresh()
|
if not display.refresh():
|
||||||
if key != None and (key&0x1A):
|
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ from xvlidar import XVLidar as Lidar
|
|||||||
|
|
||||||
from pltslamshow import SlamShow
|
from pltslamshow import SlamShow
|
||||||
|
|
||||||
|
from sys import stdout
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# Connect to Lidar unit
|
# Connect to Lidar unit
|
||||||
@@ -62,8 +64,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
display.setPose(x, y, theta)
|
display.setPose(x, y, theta)
|
||||||
|
|
||||||
# Exit on ESCape
|
# Exit on window close
|
||||||
key = display.refresh()
|
if not display.refresh():
|
||||||
if key != None and (key&0x1A):
|
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user