Merge pull request #259 from goktug97/close_on_key

Close on key
This commit is contained in:
Atsushi Sakai
2019-12-14 21:33:26 +09:00
committed by GitHub
53 changed files with 168 additions and 8 deletions

View File

@@ -135,6 +135,9 @@ def closed_loop_prediction(cx, cy, cyaw, speed_profile, goal):
if target_ind % 1 == 0 and animation: # pragma: no cover
plt.cla()
# for stopping simulation with the esc key.
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")