RoboDK Forum
UR5 Online Programming Python API Issue with non-blocking moves- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: UR5 Online Programming Python API Issue with non-blocking moves (/Thread-UR5-Online-Programming-Python-API-Issue-with-non-blocking-moves)



UR5 Online Programming Python API Issue with non-blocking moves-austintc_180-06-01-2022

Hello,

I am attempting to use non-blocking calls with the Python API in order to send move commands within a GUI program. i.e robot.MoveL(target, blocking=False)

I have a seperate camera stream program that is periodically communicating target coordinates within the robots workspace in which the gui displays and allows the user to issue a command to get the robot to jog over that position with a laser. The program works however the non-blocking move commands still block and prevent the GUI from updating as well as preventing the camera from refreshing in the other asynchronous script while the robot moves.

Any advice is appreciated. Thanks.

I will attach the simple blocking function below and can provide a full script if needed. I am using a UR5 CB3 and using online-programming.


Code:
def MoveCommandLaser(self):
print("sending move")
robot.setPoseTool(tool3) # laser
# self.UpdateActiveTool(tool3)
XYZUVW = Pose_2_UR(robot.Pose())
x, y, z, u, v, w = XYZUVW
i = int(self.lasertargetentry.get())
targ = self.coords[((i - 1) * 4):((i * 4))]
x =浮动(目标[0])
y = float(targ[1])
z = float(self.laserzentry.get())
Move_Pose = UR_2_Pose ([x, y, z,u, v, w])
robot.MoveL(Move_Pose, blocking=False)
robot.setPoseTool(tool2) #camera ref
print("move sent")
# self.UpdateActiveTool(tool2)