#Why is "move_to_position()" so JERKY/CHOPPY when moving an ARM with the viam-sdk?

1 messages · Page 1 of 1 (latest)

weak idol
#

I have an UR5e robot arm that i have connected to a viam-server. The problem i am having is that the function my_arm.move_to_position(pose = [...]) moves the arm in small steps. The arm moves about 1 cm before stopping rapidly and then moving again. It is fine if it happens between commands, but i feel there must be a better function or something to resolve this issue. My current code that moves the arm end in a square:

sync def main():
machine = await connect()
ur5e = Arm.from_robot(machine, "UR5eARM")

endpos = await ur5e.get_end_position()
endpos.y -= 100
await ur5e.move_to_position(pose = endpos)

endpos = await ur5e.get_end_position()
endpos.x -= 100
await ur5e.move_to_position(pose = endpos)

endpos = await ur5e.get_end_position()
endpos.y += 100
await ur5e.move_to_position(pose = endpos)

endpos = await ur5e.get_end_position()
endpos.x += 100
await ur5e.move_to_position(pose = endpos)


await machine.close()

The code above results in choppy/jerky movement. Thanks for any help in advance.

deep cloud
#

Hi @weak idol , thanks for writing up this bug report! I was able to reproduce what you are seeing. This is an issue we are actively working to address with the UR driver and we hope to have a solution for this in the near future. For now, the workaround I suggest is to rely on the move_to_joint_positions method on the Arm API, rather than using the move_to_position method. Since your code is driving the arm in a square I would suggest writing printing out the joint positions after each of the movements and then commanding it to go to them in subsequent runs. Hope this helps, and happy to answer any other questions