Error from Joint or Connection

I have developed a UR cap (Universal Robots capability) that includes a state monitor to track the system’s state. However, when I deployed this cap to a customer, they encountered an issue where the state estimator is triggering right from the beginning, preventing them from using or running the program. I am seeking ideas to debug this problem and find a way to reset the connection or the robot programmatically in case of such an event.

Here is a snippet of the relevant code from the UR cap package:

package Shared.ProgramStateController;

import com.ur.urcap.api.domain.script.ScriptWriter;
import Shared.Backend.BackendHandler;
import URServers.RealtimeInterface;
import Shared.Backend.ControlOverScript;

public class ActionOnPlay implements ActOnState {

private ScriptWriter scriptWriter;

@Override
public void actOnState(BackendHandler backendHandler) {
    RealtimeInterface realtimeInterface = new RealtimeInterface();
    ControlOverScript Robot_state = new ControlOverScript(backendHandler);
    realtimeInterface.readNow();

    // Print the robot mode
    System.out.println("Mode: " + realtimeInterface.getRobotMode());
    // Robot_state.restart_robot();
    System.out.println("Play");
}

}

In my investigation, I discovered that realtimeInterface.getRobotMode() always returns a value of 7, indicating an inactive mode. This suggests that the connection or state of the robot needs to be reset to an active mode.

I am seeking assistance from the community to address the following concerns:

  1. Debugging the issue: How can I identify the root cause of the state monitor triggering at the start of the program, preventing its proper usage?
  2. Resetting the connection or robot programmatically: Is there a way to reset the connection or robot programmatically within the code snippet provided? I am looking for suggestions or code examples that would help me reset the connection or switch the robot to an active mode.

Any insights, ideas, or guidance would be greatly appreciated. Thank you in advance for your support!

Hmm…looks like you’ve got other classes at play here. I believe that RealtimeInterface was deprecated in favor of the RTDE stuff, but maybe that’s a custom class of yours too, not sure. When you’re saying it monitors the system’s state, do you mean just monitoring the actual robot mode or something more custom? Maybe you could implement the dashboard server instead?

I will try yo give more information, I am using state monitor which is being run in a thread, I am attaching entire folder along with the message
ProgramStateController.zip (4.3 KB)

Hope this might help you to give better under standing about what’s going on @eric.feldmann