Velocity control between points with Python

Hello everyone,

I am using python to control Uarm and I want to change the velocity between xyz points.
I 've tried to use the move_to_options command, but when the time_spend value is different than 0, uarm is not working properly.
Any suggestions;

Thank you in advance!

Here is the code I am using, firmware 1.7.3, pyuarm 1.3.29:

import pyuarm
import time

arm = pyuarm.uArm()

if not arm.is_connected():
	raise SystemExit()


#fetch card position, at the table
fetchCard = [-0.71, -9.72, 7.0]  #[-0.71, -9.72, 7.0]

#home position
home = [-1.49, -10.03, 18.9]
time_spend=5

arm. move_to(home[0], home[1], home[2], None, pyuarm.ABSOLUTE, time_spend, pyuarm.PATH_LINEAR, pyuarm.INTERP_EASE_INOUT_CUBIC)

#INTERP_EASE_INOUT_CUBIC, INTERP_LINEAR, INTERP_EASE_INOUT, INTERP_EASE_IN, INTERP_EASE_OUT
arm. move_to(fetchCard[0], fetchCard[1], fetchCard[2], None, pyuarm.ABSOLUTE, time_spend, pyuarm.PATH_LINEAR, pyuarm.INTERP_EASE_INOUT_CUBIC)
#time.sleep(0.1)
arm.pump_control(1)
arm. move_to(home[0], home[1], home[2], None, pyuarm.ABSOLUTE, time_spend, pyuarm.PATH_LINEAR, pyuarm.INTERP_EASE_INOUT_CUBIC)
arm.pump_control(0)

And that works for me at least.

Ahh, there I ran into the same thing!

I had to wait longer than ‘time_spend’ between ‘move_to’ calls.

time_spend=5

for i in range(52):
	arm.move_to(fetchCardFirst, .....
	time.sleep(5.1)
	arm.pump_control(1)
	time.sleep(1)
	arm.move_to(aboveCardStack......
	time.sleep(5.1)
	....

Now I have some cards to pick up from the floor…

Thank you for your reply, I want, if possible, to change the velocity by changing the pulse width to servos not adding a delay.
Also the firmware needs to be fixed cause the arm behaves strange when the time_spend value is !>0

Hi @DimAuto, You could try, our develop version, pyuarm dev- 2.0 version, We are using speed mm/sec instead of time_spend, also we provide the is_moving, you could check if uArm is moving or not.
If you want to test this, you need to upgrade your uArm’s firmware to dev version. current beta version is 2.0.9a. (if you install the dev 2.0 pyuarm. you could use uarm-firmware -df to flash latest dev version)
Highly recommend that use virtualenv to isolate 1.3 and 2.0 version.

Hi Alex, I have installed pyuarm 2.0 and the upgraded firmware. Now uarm is not responding to move_to commands and the get_coords command returns xyz very different than before.
Does it needs a calibration or something?

HI @DimAuto, would you show me the firmware version? you could use uarm-firmware -c
I have upgraded the develop firmware, you could try to use uarm-firmware -df

Firmware version is 2.0.10. With the arm in its initial position the get_coords commands returns sx-0.29y3.22z28.21 When I send move_to(0,5,15,300) uarm is stretching all the way to right side, while the get_coords from this point returns sx254.04y18.35z83.13.
Thank you

2.0.11 released. Please try.

Hi Alex, I ve updated the firmware to 2.0.11 and I have the same issues. First, the firmware_version response string begins with “h” instead of “s” that is defined in the ‘read_firmware_version’ function, I ve changed it and it’s ok.
The problem is again with the move_to and get_coor commands.
The xyz in the move_to function must be in cm right?

Hi @DimAuto, Sorry about the version mistake. we are using millimeter in Version 2.0.