mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
exit on key
This commit is contained in:
@@ -193,6 +193,8 @@ def astar_torus(grid, start_node, goal_node):
|
||||
for i in range(1, len(route)):
|
||||
grid[route[i]] = 6
|
||||
plt.cla()
|
||||
plt.gcf().canvas.mpl_connect('key_release_event',
|
||||
lambda event: [exit(0) if event.key == 'escape' else None])
|
||||
plt.imshow(grid, cmap=cmap, norm=norm, interpolation=None)
|
||||
plt.show()
|
||||
plt.pause(1e-2)
|
||||
|
||||
Reference in New Issue
Block a user