mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-02-11 03:55:19 -05:00
exit on key
This commit is contained in:
@@ -149,6 +149,8 @@ def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal):
|
||||
|
||||
if target_ind % 1 == 0 and show_animation:
|
||||
plt.cla()
|
||||
plt.gcf().canvas.mpl_connect('key_release_event',
|
||||
lambda event: [exit(0) if event.key == 'escape' else None])
|
||||
plt.plot(cx, cy, "-r", label="course")
|
||||
plt.plot(x, y, "ob", label="trajectory")
|
||||
plt.plot(cx[target_ind], cy[target_ind], "xg", label="target")
|
||||
|
||||
Reference in New Issue
Block a user