xArm-Developer / xArm-Python-SDK

Python SDK for UFACTORY robots, 850, xArm5/6/7, and Lite6.
https://www.ufactory.cc
BSD 3-Clause "New" or "Revised" License
180 stars 112 forks source link

Configurable GPIO takes robot out of ServoJ mode #80

Open alonks1234 opened 1 year ago

alonks1234 commented 1 year ago

Hi, We are using the configurable GPIO to determine if an external signal is received and stop the robot. I believe this ends up being the equivalent of set_state(4). We can recover from this interrupt in position mode in under .1 seconds.

We are now using ServoJ mode, and we have noticed that this signal takes the robot out of servoJ mode and into position mode. In order to switch back into servoj we are paying a 1+ second penalty, which does not work for our application.

Is there any way around this?

Thank you

penglongxiang commented 1 year ago

Hi @alonks1234, specific to your situation. You may try configuring the GPIO to "Safeguard Reset" which correspond to set_state(3), it is a PAUSE operation and will not reset the system mode to position mode (and not reset the queued tasks if in mode 0). However, please make sure not to keep sending command too far away from the paused position before setting the state back to 0, since it will immediately respond to the latest received command right after set_state(0), so please keep this in mind and test with caution.

I think a safe operation is to get the current position and send it to the robot before recovering the interrupt in ServoJ mode.