luismesas / pydobot

Python library for Dobot Magician
MIT License
110 stars 59 forks source link

Dobot get lock when go to specific location #49

Open chinghiep01 opened 1 year ago

chinghiep01 commented 1 year ago

Hi,

I have question related to move dobot magician to specific location

when i try basic-example the dobot move according to current pose. However , when I try to put specific number such as


from serial.tools import list_ports

import pydobot

available_ports = list_ports.comports()
print(f'available ports: {[x.device for x in available_ports]}')
port = available_ports[0].device

device = pydobot.Dobot(port=port, verbose=True)

(x, y, z, r, j1, j2, j3, j4) = device.pose()
print(f'x:{x} y:{y} z:{z} j1:{j1} j2:{j2} j3:{j3} j4:{j4}')

for i in range(2):
    device.move_to(x+2, y + 20 , z + 50 , r, wait=True) # first direction 
    device.wait(1000)
    device.move_to ( 20 , 40 , 50 , 0 , wait=True) # second direction 
    device.wait(1000)

device.close()

From above code , the first direction is ok , when robot move to second direction is get lock and won't move back to the first direction. I dont think the robot excess the direction limit . I go to dobot studio and test with the second direction , it could move to other direction I want.

Notice : I also try the software package , when i do similar position code , the robot is get lock with red indicator

I'm not sure what is the issue. Any suggestion ?