Universal Robots Forum

XmlRpc python deamon really slow

Hi, I get really slow responds time using my URCap on a UR5, the delay is lasting about 8 sec, but when I’m using it on the ursimulator it runs smoothly with no delay at all. Any ideas of why ?
here is my function getNumber() which I defined in my InstallationNodeContribution using the ScriptWriter:

public void generateScript(ScriptWriter writer) {
    writer.globalVariable(XMLRPC_VARIABLE, "rpc_factory(\"xmlrpc\", \"http://127.0.0.1:40404\")");

    writer.appendLine("def getNumber():");
    writer.appendLine("return " + XMLRPC_VARIABLE + ".get_number()");
    writer.appendLine("end");
} 

My Daemon:

#! /usr/bin/env python
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer

def get_number():
    return 42

server = SimpleXMLRPCServer(("127.0.0.1", 40404))
server.register_function(get_number, "get_number")
server.serve_forever()

Running a simple program:

As mentioned the program runs fine on the ursimulator, but I can’t believe that a daemon runs this slowly on a real robot, I must have done something wrong. Help would be very appreciated, thanks.

1 Like

Okay I found out that the python daemon isn’t running fast at all, compared to the c++ daemon.
So I suggest using a C++ daemon, especially when running multiple Capps on the machine.

@dhv

We are not able to re-produce this behaviour.
8 seconds is a long time.

The average latency for daemons on CB3.1 controllers is 8 ms, and 8-16 ms on CB3.0 controllers.
Since the CB3.0 controller has a inferior CPU to the CB3.1, it will take a bit longer to initialize the daemon as well.
But we have not been able to delay 8 sec.