add a loop option to plot
@@ -1232,7 +1232,7 @@ class Robot(ABC, DynamicsMixin, IKMixin):
self, q, backend=None, block=False, dt=0.050,
limits=None, vellipse=False, fellipse=False,
jointaxes=True, jointlabels=False, eeframe=True, shadow=True, name=True, fig=None,
- movie=None, **bopts
+ movie=None, loop=False, **bopts
):
"""
Graphical display and animation
@@ -1330,6 +1330,10 @@ class Robot(ABC, DynamicsMixin, IKMixin):
# Stop lint error
images = [] # list of images saved from each plot
+ if movie is not None:
+ loop = False
+
+ while True:
for qk in q:
self.q = qk
if vellipse:
@@ -1347,6 +1351,8 @@ class Robot(ABC, DynamicsMixin, IKMixin):
movie,
save_all=True, append_images=images[1:], optimize=False,
duration=dt, loop=0)
+ if not loop:
+ break
# Keep the plot open
if block: # pragma: no cover
