8000 Fix bug with PyPlot teach panel hanging · Global19/robotics-toolbox-python@35bc9c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 35bc9c2

Browse files
committed
Fix bug with PyPlot teach panel hanging
1 parent 55f5d5b commit 35bc9c2

File tree

Expand file tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

roboticstoolbox/backends/PyPlot/PyPlot.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,11 @@ def hold(self): # pragma: no cover
312312
# signal.setitimer(signal.ITIMER_REAL, 0)
313313
plt.ioff()
314314

315-
try:
316-
plt.show()
317-
except AttributeError:
318-
pass
315+
# keep stepping the environment while figure is open
316+
while True:
317+
if not plt.fignum_exists(self.fig.number):
318+
break
319+
self.step()
319320

320321
#
321322
# Private methods
@@ -421,9 +422,6 @@ def update(val, text, robot): # pragma: no cover
421422

422423
text_trans(text)
423424

424-
# Step the environment
425-
self.step(0)
426-
427425
fig.subplots_adjust(left=0.25)
428426
text = []
429427

0 commit comments

Comments
 (0)
0