The code below doesn’t move the arm, as a result set_position() should return almost immediately.
from xarm.wrapper import XArmAPI
import time
arm = XArmAPI(ip, is_radian=False)
arm.set_tcp_jerk(10000)
arm.set_tcp_maxacc(50000)
while True:
p = arm.get_position()
p = p[1][0], p[1][1], p[1][2], p[1][5]
init_time = time.time()
arm.set_position(
x=p[0],
y=p[1],
z=p[2],
yaw=p[3],
wait=True,
speed=1000,
mvacc=50000)
print(time.time() - init_time)
However, running the code prints:
0.5563387870788574
0.5542311668395996
0.5569033622741699
0.5589816570281982
0.5543324947357178
0.5549933910369873
0.5675535202026367
0.5544140338897705
0.5542652606964111
0.5548419952392578
0.5540516376495361
0.5541946887969971
0.5605826377868652
How do we eliminate what appears to be built in lag?