How to get arm current position?

I controll Swift by pyuf.
I want to know how to get the arm current position.

I have used uArm Metal by pyuarm.
I could get the current position to use get_position.

Bellow code is the testcode to controll swift and getposition.
But get_position return ‘None’.
Please tell me what to do.

import sys, os
from time import sleep

from uf.wrapper.swift_api import SwiftAPI
from uf.utils.log import *

swift = SwiftAPI() # default by filters: {‘hwid’: ‘USB VID:PID=2341:0042’}

print(“sleep 5 sec …”)
sleep(5)

goal1 = [250, 50, 150]
goal2 = [150, 0, 150]

print(“goal:”+str(goal1))
swift.set_position(goal1[0], goal1[1], goal1[2], speed = 10000)
sleep(1.5)
print(swift.get_position())

print(“goal:”+str(goal2))
swift.set_position(goal2[0], goal2[1], goal2[2], speed = 10000)
sleep(1.5)
print(swift.get_position())

uArm Serial No.: (the No. at the bottom of each uArm reading “UARM-040217004C”)
Operation System: Win(7)
uArm Controlling Method: Python (pyuf/library version:1.2)

It’s P2220, and a list of other g-code commands is in the quick start documentation.

To:ebto

Sorry, I updated my question, and your answer is crossed.

I have little knowledge about gcode…
I want to know the method with pyuf. Do you know?

You should upgrade the firmware (>= v2.3.7) to your non-pro swift, the old firmware reports uppercase ‘OK’, while swift-pro reports lowercase ‘ok’.

And the command buffer of non-pro swift is smaller than the pro version, I upload a test file of non-pro swift for you, please checkout the last commit of pyuf.

1 Like

To:Duke

I upgaded firm ware and used new pyuf.
And I can get arm position!!

Thanks a lot!!:blush:

1 Like