Hello everybody,
we are developing an URCAP for UR robots. It is working fine.
Only issue is when we load a program that uses our Program nodes. They do not seem to append their script (generateScript()) until the node has been clicked by the user.
So when ‘PLAY’ is pressed, the Robot simply skips our function nodes, like everything is fine.
We checked the script generated, and our nodes’ code was missing.
This was experienced in an e-series UR3, polyscope 5.1.
Briefly: When the program is being written it works fine. When the program is loaded from USB or robot Memory, the URCAP’s nodes are skipped during execution. The workaround is to click each node individually, and only then press ‘PLAY’.
Did anyone ever had the same problem?
Here is a snippet of our Program Node Contribution:
@Override
public void openView() {
System.out.println(“openView of Gripper program node”);
view.setSelectedValueComboBox(model.get(FUNCAO_KEY, FUNCAO_DEFAULT_VALUE));
view.setApertureTextField(model.get(ABERTURA_KEY, ABERTURA_DEFAULT_VALUE));
view.setSliderValue(installationNode.getVelocidade());
view.setTextField(installationNode.getVelocidade());
connectionQuery();
}@Override
public void closeView() {
}@Override
public String getTitle() {
return "Garra GSP80: " + model.get(FUNCAO_KEY, FUNCAO_DEFAULT_VALUE);
}@Override
public boolean isDefined() {
return true;
}@Override
public void generateScript(ScriptWriter writer) {
double abertura = model.get(ABERTURA_KEY, ABERTURA_DEFAULT_VALUE);
int ab = (int) (abertura * 100);
int ab1 = (ab >> 8) & 0xFF;
int ab2 = ab & 0xFF;String funcao = model.get(FUNCAO_KEY, FUNCAO_DEFAULT_VALUE); if (funcao == "Abrir") { writer.appendLine("script_command(COD_open, " + ab1 + "," + ab2 + ")"); } else if (funcao == "Fechar") { writer.appendLine("script_command(COD_close, " + ab1 + "," + ab2 + ")"); }
}