xArm-Python-SDK
xArm-Python-SDK copied to clipboard
Error Code 19 when using TGPIO
Hello,
We're using TGPIO to control a custom end effector. Occasionally, reading from the TGPIO (with get_tgpio_analog
) returns code 1 and the control box shows Error Code 19. Can TGPIO with a custom end effector cause Code 19, and if so how?
Logs are here: XI130308B22L25_2023-06-12_11-06-20.tar.gz
I don't see the Code 19's in there for some reason, but there is this line:
[173141] 304h26m38s:338ms:362us:326ns [src/motor/tgpio_fun.cc 108 get_servo_16b] tpgio-> !get 16b data error! ret:3 id:9 addr:2582
Thanks for your help!
Hi @joshuafishman, is there a background thread in your application that is constantly acquiring status like robot state, error code, TCP pose in a high frequency (up to 200Hz)? Maybe the occasional C19 error has something to do with this. I guess when the controller was busy handling the high frequency communication, the IO with tool module was affected and had a higher chance of timeout.
If that is the case , please try reducing the status acquiring frequency if possible, or use the port 30003 automatic status report instead, refer to Developer manual chapter 2.1.6 Automatic Reporting Format.
Hi @penglongxiang, that's very interesting. Is the Automatic Status Report exposed through the SDK, or should we read from the port and parse the stream directly ourselves?
Hi @penglongxiang, thanks for the response--I wasn't able to replicate Error Code 19 with the script below that constantly reads robot state and TGPIO:
from xarm import XArmAPI
import time
xarm = XArmAPI("192.168.250.232")
duration = 1/200
while True:
start_time = time.time()
state = xarm.get_state()
code, v = xarm.get_tgpio_analog(0)
print(f"{state =}, {code =}, {v =}")
elapsed = time.time() - start_time
sleep_time = duration - elapsed
if sleep_time > 0:
time.sleep(sleep_time)
else:
print("TOOK TOO LONG")
Would you have other thoughts on what might be causing the error? Any guidance would be much appreciated!
Hi @vk-chen ,
C19 may be related to the communication between the end of the arm and the e custom end effector. If you remove the custom end effector, C19 will not occur, right? What is the firmware version? Please send an email to [email protected], I will help you to update the firmware of IO board to see if the problem can be solved.
Hi @penglongxiang, that's very interesting. Is the Automatic Status Report exposed through the SDK, or should we read from the port and parse the stream directly ourselves?
@joshuafishman you have to read and parse by yourselves.
Hi @MinnaZhong, Thanks for your response! Our firmware version is 2.0.1 and studio version is 2.0.3 -- I'll send an email.
Hi, can you mention me if you get an explanation about this error please? I think I had the same statement you mentioned above, I am reading the force using the TGPIO method and still get this error immediately when we run the script.
Hi @MahmoudMas00 ,
Would you please share your script? What are the firmware and UFactory Studio versions? It doesn't seem to be the same issue, they can't replicate Error Code 19 with the script. Let's discuss in https://github.com/xArm-Developer/xArm-Python-SDK/issues/82
Best,