Regarding movement troubleshooting of uarm swift

Greeting Sir,
I am using an UARM SWIFT that is belonging to one of my friend’s and I don’t have physical access to it whereas I type the code and expect my friend to run it and give my the output of my code’s response.
I developed to connect to my UARM SWIFT in python but I cannot make the UARM move to desired co-ordinates using my code.The buzzer is ringing successfully but UARM is not moving to the Desiresd position it is just showing some random jerk.If i give the same coordinates using Blockly it moves smmothly to that position.I don’t know what is wrong in my python code.Can someone pls help.It is quite urgent.

MY CODE BELOW:

#! /usr/bin/env python3
#THE ABOVE LINE SETS UP THE PYTHON ENVIRONMENT AND TELLS DURING RUN TIME THAT IT IS AN PYTHON CODE
import sys,os
from time import sleep
from uf.wrapper.swift_api import SwiftAPI
from uf.utils.log import *
#ADDS THE PATH OF FILE WITH IT’S PARENT DIRECTORY TO THE SYSTEM PATH
sys.path.append(os.path.join(os.path.dirname(file), ‘…/…’))
#GETTING THE ARGUMENTS FROM TERMINAL AND ASSIGNING IT TO VARIABLES
x=sys.argv[1] #gets the x coordinate
y=sys.argv[2] #gets the y coordinate
z=sys.argv[3] #gets the z coordinate
speed=sys.argv[4] #gets the speed
#To connect to swift
print(‘setup swift …’)
#Expected to connect to UARM via USB Port
try:
swift = SwiftAPI() # default by filters: {‘hwid’: ‘USB VID:PID=2341:0042’}
#WAIT FOR 5 SECONDS TO ENSURE CONNECTION IS SUCCESSFULL
print(‘sleep 5 sec …’)
sleep(5)
swift.set_buzzer()
print(“Does the buzzer sound!!Then the connection is successfull :)”)
try:
swift.flush_cmd()
#A variable to hold the return msg of the movement action
mov_status=‘’
#setting the robot to motion of position(100,0,200) with speed of 20 cm/min using values provided in args
mov_status=swift.set_position(x, y, z, speed, timeout=10)
swift.flush_cmd()
if mov_status==True:
print(“Robot Arm Moved to positon given”)
else:
print(“Robot movement unavailable.Kindly try Again :)”)
except:
print(“Connection successful but prob in movement of UARM”)
except:
print(“UARM CONNECTION TO PC FAILED”)

OUTPUT IS AS:
THE BUZZER SOUND APPEARS AND IT PRINT Does the buzzer sound!!Then the connection is successfull

But after that the robot doesn’t move to the desired coordinates using set_position command. It just gives some Random Jerk.I gave only coordinates that are within movable range of UARM SWIFT .Same coordinates when given in blockly UARM SWIFT MOVES.SOMEBODY PLS TELL ME WHAT AM I DOING WRONG IN MY CODE.

Thanks in Advance!!!
Kindly help me as soon as possible. It’s urgent!!!

uArm Serial No.: (the No. at the bottom of each uArm reading “UARM-XXXXXXXXXX”) (Don’t know as it belong to my Friend)

Firmware Version: UPDATED USING UARM CREATOR STUDIO(v 2.3.6 Publish date: 2017-07-28)

Operation System: LINUX

uArm Controlling Method: Python (using pyuf package for UARM SWIFT CONTROL)


UFACTORY Website
Official Store
uArm User Facebook Group

Feedback:
English
中文通道

Hi, the program end before the uArm reach the position. You could adjust the “timeout =10” to a longer time such as “timeout=20” or more. Another way is add "while True: sleep(1) " on the end of your code to stop the program’s terminating.