xArm-Python-SDK icon indicating copy to clipboard operation
xArm-Python-SDK copied to clipboard

arm.set_servo_cartesian ignoring speed

Open wcdoug opened this issue 1 year ago • 1 comments

I'm having an issue during the initialization of my application. Essentially, when the app starts and sends the robot to the first position - it seems to be going at maximum speed (violently shaking the table). I put speed and mvacc in the command - but it seems to completely ignore the speed:

ret = arm.set_servo_cartesian(mvpose, speed=50, mvacc=50, wait=True)

at the moment, to "fix" the issue, for initialization I did the following: print("Setting Z - Initialize") #ret = arm.set_servo_cartesian(mvpose, speed=10, mvacc=10, wait=True) arm.set_mode(0) arm.set_state(state=0) time.sleep(0.1) align_head() arm.set_position(*[int(set_robot_x), set_robot_y, set_robot_z, 180, 0.0, rect_angle],speed=50,mvacc=50,wait=True) arm.set_mode(1) arm.set_state(state=0) time.sleep(0.1) print("Canceling Initialize") initialize = False

this is overly complex to go back and forth between modes for one motion. Any thoughts on why the arm.set_servo_cartesian not using the speed and acc? I know in the documentation it says these are "reserved" for this command - so is there another recommended way to control speed and acceleration when using arm.set_servo_cartesian (outside the inline command)?

thanks in advance

wcdoug avatar May 20 '23 11:05 wcdoug

@wcdoug I don’t know why you need to switch modes back and forth. set_servo_cartesian works in servoj mode and is sent directly to the drive motor without planning, so the speed and acceleration cannot be specified. Generally, it is not used by a single servoj command, but many servoj commands are used at a certain frequency. (The speed can be controlled by the frequency and the command spacing to a certain extent, the command spacing should not be too large, and the frequency control at 100hz will be relatively better) control.

vimior avatar May 22 '23 02:05 vimior