Universal Robots+

Method call conflicting with GUI

This method is called on a press of a button in program Node. I am facing an issue here. The GUI is not responsive for time this task is performed. Once the task gets complete, GUI is responsive again. I want to perform the task such that I can still move around in my polyscope while the task is performed in the background.

The setPositionJob function in this method is a python daemon function which coordinate with a festo motor controller to reach to a specified position. Once the position is reached it return a string value. I believe as soon as setpositionJob function is called it is waiting for the function to get completely executed and return back the value. Since it can take 5-10 sec to complete the function before returning the value, My Java method doesn’t move further and moves only after the value has been received from the daemon function.

Can I avoid this waiting for return value from daemon and move to next step in my java method without changing my phyton function?

Hi Tal,

I think you are looking for doing it in a thread. You should be able to do it with this construction:

       CompletableFuture.runAsync(new Runnable() {
            @Override
            public void run() {             
                 fill in your functionality here
                 
            }
       });

Please be aware not to write into the program nodes data model in the other thread!