xArm-Developer / xArm-Python-SDK

Python SDK for UFACTORY robots, 850, xArm5/6/7, and Lite6.
https://www.ufactory.cc
BSD 3-Clause "New" or "Revised" License
163 stars 105 forks source link

`set_servo_angle_j` very violent #60

Open alonks1234 opened 1 year ago

alonks1234 commented 1 year ago

Hi, I am trying to run the robot such that I continuously stream target joint positions to the robot, and it will ignore all previous instructions and only go to the most recent target joints. It seems like set_servo_angle_j is built for this, but while running the example

https://github.com/xArm-Developer/xArm-Python-SDK/blob/56905c7726d70d32278632e766de20b18e6eb8b0/example/wrapper/common/7001-servo_j.py

I am seeing an extremely violent response and not sure how to proceed.

I am also getting the following terminal output errors:

[SDK][WARNING][2023-01-19 21:02:02][base.py:1929] - - The mode may be incorrect, just as a reminder, mode: 1 (0)
set_servo_angle_j, ret=0
[SDK][ERROR][2023-01-19 21:02:04][base.py:348] - - API -> set_servo_angle_j -> code=1, angles=[0.017453292519943295, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], velo=0.3490658503988659, acc=8.726646259971648
set_servo_angle_j, ret=1
vimior commented 1 year ago

@alonks1234 set_servo_angle_j needs to be used in servoj mode (mode=1), and the frequency needs to be controlled by itself. In this mode, the control box will only execute the latest servoj instruction, that is, if during the execution of a certain servoj instruction O, the control box receives servoj instructions A, B, C, D, E, then after executing the instruction O, will directly execute command E (A, B, C, D have been discarded)