Test below done with 12 xl-320
Pixl
Raspi Jessie
Pypot 2.11
In [1]:
import pypot.dynamixel
import time
In [2]:
print(pypot.dynamixel.get_available_ports())
In [19]:
dxl_io = pypot.dynamixel.Dxl320IO('/dev/ttyAMA0', use_sync_read=False)
In [7]:
motors = (dxl_io.scan(range(60)))
print (motors)
print(len(motors))
In [8]:
%timeit dxl_io.get_present_position(motors)
In [20]:
t0 = time.time()
i=0
latency = 0.01
while time.time() - t0 < 1 :
dxl_io.get_present_position(motors)
i+=1
time.sleep(latency)
print ("nombre d'instructions en 1 seconde : %d -> %d Hz " % (i,i) )
t = (1.0-(i*latency))
p = t/i*1000
print ("Temps réellement utilisé pour l'instruction get_present_position : %.2f s" %(t))
print ('le temps utilisé par une instruction get_present_position est donc de : %f ms' % p)
In [21]:
dxl_io.close()
In [22]:
dxl_io = pypot.dynamixel.Dxl320IO('/dev/ttyAMA0', use_sync_read=True)
In [23]:
%timeit dxl_io.get_present_position(motors)
In [25]:
t0 = time.time()
i=0
latency = 0.01
while time.time() - t0 < 1 :
dxl_io.get_present_position(motors)
i+=1
time.sleep(latency)
print ("nombre d'instructions en 1 seconde : %d -> %d Hz " % (i,i) )
t = (1.0-(i*latency))
p = t/i*1000
print ("Temps réellement utilisé pour l'instruction get_present_position : %.2f s" %(t))
print ('le temps utilisé par une instruction get_present_position est donc de : %f ms' % p)
In [26]:
t0 = time.time()
i=0
latency = 0.005
while time.time() - t0 < 1 :
dxl_io.get_present_position(motors)
i+=1
time.sleep(latency)
print ("nombre d'instructions en 1 seconde : %d -> %d Hz " % (i,i) )
t = (1.0-(i*latency))
p = t/i*1000
print ("Temps réellement utilisé pour l'instruction get_present_position : %.2f s" %(t))
print ('le temps utilisé par une instruction get_present_position est donc de : %f ms' % p)
In [28]:
t0 = time.time()
i=0
latency = 0.001
while time.time() - t0 < 1 :
dxl_io.get_present_position(motors)
i+=1
time.sleep(latency)
print ("nombre d'instructions en 1 seconde : %d -> %d Hz " % (i,i) )
t = (1.0-(i*latency))
p = t/i*1000
print ("Temps réellement utilisé pour l'instruction get_present_position : %.2f s" %(t))
print ('le temps utilisé par une instruction get_present_position est donc de : %f ms' % p)
In [29]:
dxl_io.close()
In [30]:
from roboticia_horse import RoboticiaHorse
In [31]:
robot=RoboticiaHorse()
In [32]:
robot.stop_sync()
In [33]:
robot.config
Out[33]:
In [40]:
robot._controllers
Out[40]:
In [41]:
dxl_io=robot._controllers[0].io
In [43]:
dxl_io.get_return_delay_time((11,12,13,21,22,23,31,32,33,41,42,43))
Out[43]:
In [44]:
dxl_io.set_return_delay_time({11:250,12:250,13:250,21:250,22:250,23:250,31:250,32:250,33:250,41:250,42:250,43:250})
In [46]:
robot.start_sync()
In [47]:
robot.stop_sync()
In [48]:
dxl_io._sync_read = True
In [50]:
robot.start_sync()
closing after 30 secondes.
In [51]:
robot.stop_sync()
In [52]:
dxl_io.set_return_delay_time({11:0,12:0,13:0,21:0,22:0,23:0,31:0,32:0,33:0,41:0,42:0,43:0})
In [54]:
robot.start_sync()
In [55]:
robot.stop_sync()
In [56]:
robot.close()
In [ ]: