Motors scan

Scan all ports to find the connected Dynamixel motors


In [1]:
import pypot.dynamixel

ports = pypot.dynamixel.get_available_ports()
if not ports:
    raise IOError('no port found!')
print 'ports found', ports


ports found ['/dev/ttyACM1', '/dev/ttyACM0', '/dev/ttyACM99']

In [2]:
for port in ports:
    print port
    dxl_io = pypot.dynamixel.DxlIO(port, baudrate=1000000)
    print "scanning"
    found =  dxl_io.scan(range(60))
    print found
    dxl_io.close()


/dev/ttyACM1
scanning
[31, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 51, 52, 53, 54]
/dev/ttyACM0
scanning
[11, 12, 13, 14, 15, 21, 22, 23, 24, 25]
/dev/ttyACM99
scanning
[]


In [ ]: