Hi All,
I’m running into some inconsistencies when using set_position_aa
on my xArm6. I have a basic script that moves between two poses in axis-angle representation. Occasionally, it fails with:
Error C21 – “Kinematic Error”
Here’s the minimal code snippet:
from xarm.wrapper import XArmAPI
src = [287, -5, 523, 0, 1.7, 0]
dest = [436, -7, 723, 0, 1.7, 0]
arm = XArmAPI(xarm_ip)
arm.motion_enable(enable=True)
arm.set_mode(0)
arm.set_state(0)
# Move to source
code = arm.set_position_aa(src, wait=True, is_radian=True)
if code != 0:
print(f"[ERROR] Failed to move to src pose: Code {code}, Error: {arm.get_error_code()}")
# Move to destination
code = arm.set_position_aa(dest, wait=True, is_radian=True)
if code != 0:
print(f"[ERROR] Failed to move to dest pose: Code {code}, Error: {arm.get_error_code()}")
What’s the best practice for using set_position_aa
reliably? Would switching to set_position
provide more robust performance ? I’d appreciate any recommendations for making motion execution more robust and predictable, especially in production settings.
Thanks in advance!