16
16
17
17
# NOTE: *_pose is a 3-array: 0 - x coord, 1 - y coord, 2 - orientation angle \theta
18
18
19
+ show_animation = True
20
+
19
21
20
22
class eta3_path (object ):
21
23
"""
@@ -184,11 +186,13 @@ def test1():
184
186
for i , u in enumerate (ui ):
185
187
pos [:, i ] = path .calc_path_point (u )
186
188
187
- # plot the path
188
- plt .plot (pos [0 , :], pos [1 , :])
189
- plt .pause (1.0 )
189
+ if show_animation :
190
+ # plot the path
191
+ plt .plot (pos [0 , :], pos [1 , :])
192
+ plt .pause (1.0 )
190
193
191
- plt .close ("all" )
194
+ if show_animation :
195
+ plt .close ("all" )
192
196
193
197
194
198
def test2 ():
@@ -212,11 +216,13 @@ def test2():
212
216
for i , u in enumerate (ui ):
213
217
pos [:, i ] = path .calc_path_point (u )
214
218
215
- # plot the path
216
- plt .plot (pos [0 , :], pos [1 , :])
217
- plt .pause (1.0 )
219
+ if show_animation :
220
+ # plot the path
221
+ plt .plot (pos [0 , :], pos [1 , :])
222
+ plt .pause (1.0 )
218
223
219
- plt .close ("all" )
224
+ if show_animation :
225
+ plt .close ("all" )
220
226
221
227
222
228
def test3 ():
@@ -273,14 +279,16 @@ def test3():
273
279
pos [:, i ] = path .calc_path_point (u )
274
280
275
281
# plot the path
276
- plt .figure ('Path from Reference' )
277
- plt .plot (pos [0 , :], pos [1 , :])
278
- plt .xlabel ('x' )
279
- plt .ylabel ('y' )
280
- plt .title ('Path' )
281
- plt .pause (1.0 )
282
-
283
- plt .show ()
282
+
283
+ if show_animation :
284
+ plt .figure ('Path from Reference' )
285
+ plt .plot (pos [0 , :], pos [1 , :])
286
+ plt .xlabel ('x' )
287
+ plt .ylabel ('y' )
288
+ plt .title ('Path' )
289
+ plt .pause (1.0 )
290
+
291
+ plt .show ()
284
292
285
293
286
294
def main ():
0 commit comments