Skip to content

Commit 9ca7d8f

Browse files
committed
add comment for stopping the simulation
1 parent 25cffd7 commit 9ca7d8f

File tree

53 files changed

+54
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+54
-0
lines changed

AerialNavigation/drone_3d_trajectory_following/Quadrotor.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def __init__(self, x=0, y=0, z=0, roll=0, pitch=0, yaw=0, size=0.25, show_animat
2323
if self.show_animation:
2424
plt.ion()
2525
fig = plt.figure()
26+
# for stopping simulation with the esc key.
2627
fig.canvas.mpl_connect('key_release_event',
2728
lambda event: [exit(0) if event.key == 'escape' else None])
2829

AerialNavigation/rocket_powered_landing/rocket_powered_landing.py

+1
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ def plot_animation(X, U): # pragma: no cover
567567

568568
fig = plt.figure()
569569
ax = fig.gca(projection='3d')
570+
# for stopping simulation with the esc key.
570571
fig.canvas.mpl_connect('key_release_event',
571572
lambda event: [exit(0) if event.key == 'escape' else None])
572573

ArmNavigation/arm_obstacle_navigation/arm_obstacle_navigation.py

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def astar_torus(grid, start_node, goal_node):
162162
for i in range(1, len(route)):
163163
grid[route[i]] = 6
164164
plt.cla()
165+
# for stopping simulation with the esc key.
165166
plt.gcf().canvas.mpl_connect('key_release_event',
166167
lambda event: [exit(0) if event.key == 'escape' else None])
167168
plt.imshow(grid, cmap=cmap, norm=norm, interpolation=None)

ArmNavigation/arm_obstacle_navigation/arm_obstacle_navigation_2.py

+1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def astar_torus(grid, start_node, goal_node):
193193
for i in range(1, len(route)):
194194
grid[route[i]] = 6
195195
plt.cla()
196+
# for stopping simulation with the esc key.
196197
plt.gcf().canvas.mpl_connect('key_release_event',
197198
lambda event: [exit(0) if event.key == 'escape' else None])
198199
plt.imshow(grid, cmap=cmap, norm=norm, interpolation=None)

ArmNavigation/n_joint_arm_to_point_control/NLinkArm.py

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def update_points(self):
5151

5252
def plot(self): # pragma: no cover
5353
plt.cla()
54+
# for stopping simulation with the esc key.
5455
plt.gcf().canvas.mpl_connect('key_release_event',
5556
lambda event: [exit(0) if event.key == 'escape' else None])
5657

ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def animation():
114114
def main(): # pragma: no cover
115115
fig = plt.figure()
116116
fig.canvas.mpl_connect("button_press_event", click)
117+
# for stopping simulation with the esc key.
117118
fig.canvas.mpl_connect('key_release_event',
118119
lambda event: [exit(0) if event.key == 'escape' else None])
119120
two_joint_arm()

Bipedal/bipedal_planner/bipedal_planner.py

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def walk(self, T_sup=0.8, z_c=0.8, a=10, b=1, plot=False):
111111
if c > len(com_trajectory_for_plot):
112112
# set up plotter
113113
plt.cla()
114+
# for stopping simulation with the esc key.
114115
plt.gcf().canvas.mpl_connect('key_release_event',
115116
lambda event: [exit(0) if event.key == 'escape' else None])
116117
ax.set_zlim(0, z_c * 2)

Localization/ensemble_kalman_filter/ensemble_kalman_filter.py

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def main():
213213

214214
if show_animation:
215215
plt.cla()
216+
# for stopping simulation with the esc key.
216217
plt.gcf().canvas.mpl_connect('key_release_event',
217218
lambda event: [exit(0) if event.key == 'escape' else None])
218219

Localization/extended_kalman_filter/extended_kalman_filter.py

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def main():
191191

192192
if show_animation:
193193
plt.cla()
194+
# for stopping simulation with the esc key.
194195
plt.gcf().canvas.mpl_connect('key_release_event',
195196
lambda event: [exit(0) if event.key == 'escape' else None])
196197
plt.plot(hz[0, :], hz[1, :], ".g")

Localization/histogram_filter/histogram_filter.py

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ def main():
233233

234234
if show_animation:
235235
plt.cla()
236+
# for stopping simulation with the esc key.
236237
plt.gcf().canvas.mpl_connect('key_release_event',
237238
lambda event: [exit(0) if event.key == 'escape' else None])
238239
draw_heat_map(grid_map.data, mx, my)

Localization/particle_filter/particle_filter.py

+1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def main():
230230

231231
if show_animation:
232232
plt.cla()
233+
# for stopping simulation with the esc key.
233234
plt.gcf().canvas.mpl_connect('key_release_event',
234235
lambda event: [exit(0) if event.key == 'escape' else None])
235236

Localization/unscented_kalman_filter/unscented_kalman_filter.py

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def main():
240240

241241
if show_animation:
242242
plt.cla()
243+
# for stopping simulation with the esc key.
243244
plt.gcf().canvas.mpl_connect('key_release_event',
244245
lambda event: [exit(0) if event.key == 'escape' else None])
245246
plt.plot(hz[0, :], hz[1, :], ".g")

Mapping/circle_fitting/circle_fitting.py

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def main():
124124

125125
if show_animation: # pragma: no cover
126126
plt.cla()
127+
# for stopping simulation with the esc key.
127128
plt.gcf().canvas.mpl_connect('key_release_event',
128129
lambda event: [exit(0) if event.key == 'escape' else None])
129130
plt.axis("equal")

Mapping/gaussian_grid_map/gaussian_grid_map.py

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def main():
7373

7474
if show_animation: # pragma: no cover
7575
plt.cla()
76+
# for stopping simulation with the esc key.
7677
plt.gcf().canvas.mpl_connect('key_release_event',
7778
lambda event: [exit(0) if event.key == 'escape' else None])
7879
draw_heatmap(gmap, minx, maxx, miny, maxy, xyreso)

Mapping/kmeans_clustering/kmeans_clustering.py

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def main():
133133
# for animation
134134
if show_animation: # pragma: no cover
135135
plt.cla()
136+
# for stopping simulation with the esc key.
136137
plt.gcf().canvas.mpl_connect('key_release_event',
137138
lambda event: [exit(0) if event.key == 'escape' else None])
138139
clusters.plot_cluster()

Mapping/raycasting_grid_map/raycasting_grid_map.py

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def main():
124124

125125
if show_animation: # pragma: no cover
126126
plt.cla()
127+
# for stopping simulation with the esc key.
127128
plt.gcf().canvas.mpl_connect('key_release_event',
128129
lambda event: [exit(0) if event.key == 'escape' else None])
129130
draw_heatmap(pmap, minx, maxx, miny, maxy, xyreso)

Mapping/rectangle_fitting/rectangle_fitting.py

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ def main():
242242

243243
if show_animation: # pragma: no cover
244244
plt.cla()
245+
# for stopping simulation with the esc key.
245246
plt.gcf().canvas.mpl_connect('key_release_event',
246247
lambda event: [exit(0) if event.key == 'escape' else None])
247248
plt.axis("equal")

PathPlanning/AStar/a_star.py

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def planning(self, sx, sy, gx, gy):
7979
if show_animation: # pragma: no cover
8080
plt.plot(self.calc_grid_position(current.x, self.minx),
8181
self.calc_grid_position(current.y, self.miny), "xc")
82+
# for stopping simulation with the esc key.
8283
plt.gcf().canvas.mpl_connect('key_release_event',
8384
lambda event: [exit(0) if event.key == 'escape' else None])
8485
if len(closed_set.keys()) % 10 == 0:

PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py

+1
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ def update_graph(self):
534534
def draw_graph(self, xCenter=None, cBest=None, cMin=None, etheta=None,
535535
samples=None, start=None, end=None):
536536
plt.clf()
537+
# for stopping simulation with the esc key.
537538
plt.gcf().canvas.mpl_connect('key_release_event',
538539
lambda event: [exit(0) if event.key == 'escape' else None])
539540
for rnd in samples:

PathPlanning/ClosedLoopRRTStar/pure_pursuit.py

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def closed_loop_prediction(cx, cy, cyaw, speed_profile, goal):
135135

136136
if target_ind % 1 == 0 and animation: # pragma: no cover
137137
plt.cla()
138+
# for stopping simulation with the esc key.
138139
plt.gcf().canvas.mpl_connect('key_release_event',
139140
lambda event: [exit(0) if event.key == 'escape' else None])
140141
plt.plot(cx, cy, "-r", label="course")

PathPlanning/Dijkstra/dijkstra.py

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def planning(self, sx, sy, gx, gy):
6969
if show_animation: # pragma: no cover
7070
plt.plot(self.calc_position(current.x, self.minx),
7171
self.calc_position(current.y, self.miny), "xc")
72+
# for stopping simulation with the esc key.
7273
plt.gcf().canvas.mpl_connect('key_release_event',
7374
lambda event: [exit(0) if event.key == 'escape' else None])
7475
if len(closedset.keys()) % 10 == 0:

PathPlanning/DubinsPath/dubins_path_planning.py

+1
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ def test():
318318

319319
if show_animation:
320320
plt.cla()
321+
# for stopping simulation with the esc key.
321322
plt.gcf().canvas.mpl_connect('key_release_event',
322323
lambda event: [exit(0) if event.key == 'escape' else None])
323324
plt.plot(px, py, label="final course " + str(mode))

PathPlanning/DynamicWindowApproach/dynamic_window_approach.py

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def main(gx=10.0, gy=10.0, robot_type=RobotType.circle):
268268

269269
if show_animation:
270270
plt.cla()
271+
# for stopping simulation with the esc key.
271272
plt.gcf().canvas.mpl_connect('key_release_event',
272273
lambda event: [exit(0) if event.key == 'escape' else None])
273274
plt.plot(predicted_trajectory[:, 0], predicted_trajectory[:, 1], "-g")

PathPlanning/Eta3SplinePath/eta3_spline_path.py

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def test1():
213213
if show_animation:
214214
# plot the path
215215
plt.plot(pos[0, :], pos[1, :])
216+
# for stopping simulation with the esc key.
216217
plt.gcf().canvas.mpl_connect('key_release_event',
217218
lambda event: [exit(0) if event.key == 'escape' else None])
218219
plt.pause(1.0)

PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py

+1
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ def main():
347347

348348
if show_animation: # pragma: no cover
349349
plt.cla()
350+
# for stopping simulation with the esc key.
350351
plt.gcf().canvas.mpl_connect('key_release_event',
351352
lambda event: [exit(0) if event.key == 'escape' else None])
352353
plt.plot(tx, ty)

PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py

+2
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def sweep_path_search(sweep_searcher, gmap, grid_search_animation=False):
213213

214214
if grid_search_animation:
215215
fig, ax = plt.subplots()
216+
# for stopping simulation with the esc key.
216217
fig.canvas.mpl_connect('key_release_event',
217218
lambda event: [exit(0) if event.key == 'escape' else None])
218219

@@ -268,6 +269,7 @@ def planning_animation(ox, oy, reso): # pragma: no cover
268269
if do_animation:
269270
for ipx, ipy in zip(px, py):
270271
plt.cla()
272+
# for stopping simulation with the esc key.
271273
plt.gcf().canvas.mpl_connect('key_release_event',
272274
lambda event: [exit(0) if event.key == 'escape' else None])
273275
plt.plot(ox, oy, "-xb")

PathPlanning/HybridAStar/a_star.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def dp_planning(sx, sy, gx, gy, ox, oy, reso, rr):
7878
# show graph
7979
if show_animation: # pragma: no cover
8080
plt.plot(current.x * reso, current.y * reso, "xc")
81+
# for stopping simulation with the esc key.
8182
plt.gcf().canvas.mpl_connect('key_release_event',
8283
lambda event: [exit(0) if event.key == 'escape' else None])
8384
if len(closedset.keys()) % 10 == 0:

PathPlanning/HybridAStar/hybrid_a_star.py

+1
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ def hybrid_a_star_planning(start, goal, ox, oy, xyreso, yawreso):
327327

328328
if show_animation: # pragma: no cover
329329
plt.plot(current.xlist[-1], current.ylist[-1], "xc")
330+
# for stopping simulation with the esc key.
330331
plt.gcf().canvas.mpl_connect('key_release_event',
331332
lambda event: [exit(0) if event.key == 'escape' else None])
332333
if len(closedList.keys()) % 10 == 0:

PathPlanning/InformedRRTStar/informed_rrt_star.py

+1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def get_final_course(self, lastIndex):
267267

268268
def draw_graph(self, xCenter=None, cBest=None, cMin=None, etheta=None, rnd=None):
269269
plt.clf()
270+
# for stopping simulation with the esc key.
270271
plt.gcf().canvas.mpl_connect('key_release_event',
271272
lambda event: [exit(0) if event.key == 'escape' else None])
272273
if rnd is not None:

PathPlanning/LQRPlanner/LQRplanner.py

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def lqr_planning(self, sx, sy, gx, gy, show_animation=True):
5454

5555
# animation
5656
if show_animation: # pragma: no cover
57+
# for stopping simulation with the esc key.
5758
plt.gcf().canvas.mpl_connect('key_release_event',
5859
lambda event: [exit(0) if event.key == 'escape' else None])
5960
plt.plot(sx, sy, "or")

PathPlanning/LQRRRTStar/lqr_rrt_star.py

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def planning(self, animation=True, search_until_max_iter=True):
102102

103103
def draw_graph(self, rnd=None):
104104
plt.clf()
105+
# for stopping simulation with the esc key.
105106
plt.gcf().canvas.mpl_connect('key_release_event',
106107
lambda event: [exit(0) if event.key == 'escape' else None])
107108
if rnd is not None:

PathPlanning/PotentialFieldPlanning/potential_field_planning.py

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def potential_field_planning(sx, sy, gx, gy, ox, oy, reso, rr):
9898

9999
if show_animation:
100100
draw_heatmap(pmap)
101+
# for stopping simulation with the esc key.
101102
plt.gcf().canvas.mpl_connect('key_release_event',
102103
lambda event: [exit(0) if event.key == 'escape' else None])
103104
plt.plot(ix, iy, "*k")

PathPlanning/ProbabilisticRoadMap/probabilistic_road_map.py

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, rr, road_map, sample_x, sample_y):
194194

195195
# show graph
196196
if show_animation and len(closedset.keys()) % 2 == 0:
197+
# for stopping simulation with the esc key.
197198
plt.gcf().canvas.mpl_connect('key_release_event',
198199
lambda event: [exit(0) if event.key == 'escape' else None])
199200
plt.plot(current.x, current.y, "xg")

PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def quintic_polynomials_planner(sx, sy, syaw, sv, sa, gx, gy, gyaw, gv, ga, max_
151151
if show_animation: # pragma: no cover
152152
for i, _ in enumerate(time):
153153
plt.cla()
154+
# for stopping simulation with the esc key.
154155
plt.gcf().canvas.mpl_connect('key_release_event',
155156
lambda event: [exit(0) if event.key == 'escape' else None])
156157
plt.grid(True)

PathPlanning/RRT/rrt.py

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def get_random_node(self):
138138

139139
def draw_graph(self, rnd=None):
140140
plt.clf()
141+
# for stopping simulation with the esc key.
141142
plt.gcf().canvas.mpl_connect('key_release_event',
142143
lambda event: [exit(0) if event.key == 'escape' else None])
143144
if rnd is not None:

PathPlanning/RRTDubins/rrt_dubins.py

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def planning(self, animation=True, search_until_max_iter=True):
106106

107107
def draw_graph(self, rnd=None): # pragma: no cover
108108
plt.clf()
109+
# for stopping simulation with the esc key.
109110
plt.gcf().canvas.mpl_connect('key_release_event',
110111
lambda event: [exit(0) if event.key == 'escape' else None])
111112
if rnd is not None:

PathPlanning/RRTStarDubins/rrt_star_dubins.py

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def planning(self, animation=True, search_until_max_iter=True):
112112

113113
def draw_graph(self, rnd=None):
114114
plt.clf()
115+
# for stopping simulation with the esc key.
115116
plt.gcf().canvas.mpl_connect('key_release_event',
116117
lambda event: [exit(0) if event.key == 'escape' else None])
117118
if rnd is not None:

PathPlanning/RRTStarReedsShepp/rrt_star_reeds_shepp.py

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def try_goal_path(self, node):
122122

123123
def draw_graph(self, rnd=None):
124124
plt.clf()
125+
# for stopping simulation with the esc key.
125126
plt.gcf().canvas.mpl_connect('key_release_event',
126127
lambda event: [exit(0) if event.key == 'escape' else None])
127128
if rnd is not None:

PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py

+1
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ def test():
395395

396396
if show_animation: # pragma: no cover
397397
plt.cla()
398+
# for stopping simulation with the esc key.
398399
plt.gcf().canvas.mpl_connect('key_release_event',
399400
lambda event: [exit(0) if event.key == 'escape' else None])
400401
plt.plot(px, py, label="final course " + str(mode))

PathPlanning/VoronoiRoadMap/voronoi_road_map.py

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, rr, road_map, sample_x, sample_y):
185185
# show graph
186186
if show_animation and len(closedset.keys()) % 2 == 0: # pragma: no cover
187187
plt.plot(current.x, current.y, "xg")
188+
# for stopping simulation with the esc key.
188189
plt.gcf().canvas.mpl_connect('key_release_event',
189190
lambda event: [exit(0) if event.key == 'escape' else None])
190191
plt.pause(0.001)

PathTracking/cgmres_nmpc/cgmres_nmpc.py

+1
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ def animation(plant, controller, dt):
546546
steer = math.atan2(controller.history_u_2[t] * WB / v, 1.0)
547547

548548
plt.cla()
549+
# for stopping simulation with the esc key.
549550
plt.gcf().canvas.mpl_connect('key_release_event',
550551
lambda event: [exit(0) if event.key == 'escape' else None])
551552
plt.plot(plant.history_x, plant.history_y, "-r", label="trajectory")

PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def do_simulation(cx, cy, cyaw, ck, speed_profile, goal):
224224

225225
if target_ind % 1 == 0 and show_animation:
226226
plt.cla()
227+
# for stopping simulation with the esc key.
227228
plt.gcf().canvas.mpl_connect('key_release_event',
228229
lambda event: [exit(0) if event.key == 'escape' else None])
229230
plt.plot(cx, cy, "-r", label="course")

PathTracking/lqr_steer_control/lqr_steer_control.py

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal):
203203

204204
if target_ind % 1 == 0 and show_animation:
205205
plt.cla()
206+
# for stopping simulation with the esc key.
206207
plt.gcf().canvas.mpl_connect('key_release_event',
207208
lambda event: [exit(0) if event.key == 'escape' else None])
208209
plt.plot(cx, cy, "-r", label="course")

PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py

+1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ def do_simulation(cx, cy, cyaw, ck, sp, dl, initial_state):
429429

430430
if show_animation: # pragma: no cover
431431
plt.cla()
432+
# for stopping simulation with the esc key.
432433
plt.gcf().canvas.mpl_connect('key_release_event',
433434
lambda event: [exit(0) if event.key == 'escape' else None])
434435
if ox is not None:

PathTracking/move_to_pose/move_to_pose.py

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def plot_vehicle(x, y, theta, x_traj, y_traj): # pragma: no cover
9393

9494
plt.plot(x_traj, y_traj, 'b--')
9595

96+
# for stopping simulation with the esc key.
9697
plt.gcf().canvas.mpl_connect('key_release_event',
9798
lambda event: [exit(0) if event.key == 'escape' else None])
9899

PathTracking/pure_pursuit/pure_pursuit.py

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def main():
166166

167167
if show_animation: # pragma: no cover
168168
plt.cla()
169+
# for stopping simulation with the esc key.
169170
plt.gcf().canvas.mpl_connect('key_release_event',
170171
lambda event: [exit(0) if event.key == 'escape' else None])
171172
plot_arrow(state.x, state.y, state.yaw)

PathTracking/rear_wheel_feedback/rear_wheel_feedback.py

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal):
149149

150150
if target_ind % 1 == 0 and show_animation:
151151
plt.cla()
152+
# for stopping simulation with the esc key.
152153
plt.gcf().canvas.mpl_connect('key_release_event',
153154
lambda event: [exit(0) if event.key == 'escape' else None])
154155
plt.plot(cx, cy, "-r", label="course")

PathTracking/stanley_controller/stanley_controller.py

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def main():
186186

187187
if show_animation: # pragma: no cover
188188
plt.cla()
189+
# for stopping simulation with the esc key.
189190
plt.gcf().canvas.mpl_connect('key_release_event',
190191
lambda event: [exit(0) if event.key == 'escape' else None])
191192
plt.plot(cx, cy, ".r", label="course")

SLAM/EKFSLAM/ekf_slam.py

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def main():
235235

236236
if show_animation: # pragma: no cover
237237
plt.cla()
238+
# for stopping simulation with the esc key.
238239
plt.gcf().canvas.mpl_connect('key_release_event',
239240
lambda event: [exit(0) if event.key == 'escape' else None])
240241

0 commit comments

Comments
 (0)