Universal Robots Forum

Blocking main program from thread

Hi all.

I’m attempting to use values from a force/torque sensor to pause a UR5e program if contact is made and give the user the option to stop the program or back out by calling waypoints in reverse order (I will also need help on the second part, but ill save that for another post).

Initially I thought it would be nice to have a thread display a blocking popup if I made contact since the thread could continuously monitor the F/T values as I move to 70+ waypoints. Then I realized that the block on the popup applies to the service calling the block (the thread in this case) and not the main program. Does anyone know how I can block the main program form a thread or another solution that would give me the behavior I’m looking for?

I have also already tried an if statement with “check continuously” nested in the moveP that my waypoints are in where a blocking popup would show up if the F/T values were above a threshold. This never shows the popup or blocks my program in this setup, but the popup does show up if I move it to a thread, just no blocking.

Robot: UR5e Polyscope: 5.9

Hi @fernando.n.valdes_re,

Welcome to the UR community!

One option is to use the keyword pause that will pause all execution by the controller. But that will also pause the F/T monitor thread.

The way it is realized with “check continuously” is that the children is moved to another thread and is not running in the main thread.

I hope that gives you a clue to proceed!

Best regards

Thank you so much Ebbe!

I inserted the keyword “pause” just after my popup within a thread and changed my popup to no longer be blocking. This gets the desired behavior where the robot will stop motion and prompt the user asking whether they want to terminate or continue the program.

1 Like