8000 pyplot in seconds not ms · NickNgHK/robotics-toolbox-python@b493902 · GitHub
[go: up one dir, main page]

Skip to content

Commit b493902

Browse files
committed
pyplot in seconds not ms
1 parent 6412cfa commit b493902

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/RRMC.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
start = time.time()
2727
v, arrived = rp.p_servo(panda.fkine(), Tep, 1)
2828
panda.qd = np.linalg.pinv(panda.jacobe()) @ v
29-
env.step(50)
29+
env.step(dt)
3030
stop = time.time()
3131

3232
if stop - start < dt:

roboticstoolbox/backends/PyPlot/PyPlot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ def launch(self, name=None, limits=None):
106106
# signal.setitimer(signal.ITIMER_REAL, 0.1, 0.1)
107107
# TODO still need to finish this, and get Jupyter animation working
108108

109-
def step(self, dt=50):
109+
def step(self, dt=0.05):
110110
"""
111111
Update the graphical scene
112112
113-
:param dt: time step in milliseconds, defaults to 50
113+
:param dt: time step in seconds, defaults to 50 (0.05 s)
114114
:type dt: int, optional
115115
116116
``env.step(args)`` triggers an update of the 3D scene in the matplotlib
@@ -138,7 +138,7 @@ def step(self, dt=50):
138138
self._set_axes_equal()
139139
# plt.ion()
140140
plt.draw()
141-
plt.pause(dt / 1000)
141+
plt.pause(dt)
142142

143143
self._update_robots()
144144

@@ -281,7 +281,7 @@ def _step_robots(self, dt):
281281
elif robot.control_type == 'v':
282282

283283
for i in range(robot.n):
284-
robot.q[i] += robot.qd[i] * (dt / 1000)
284+
robot.q[i] += robot.qd[i] * (dt)
285285

286286
elif robot.control_type == 'a':
287287
pass

0 commit comments

Comments
 (0)
0