Universal Robots+

URCap included with a Python Daemon => Run time error "XMLRPC: Failed with error code 1: <type 'exceptions.TypeError'>:an integer is required" occurs during the execution of a UR10 robot program which utilizes the URCap

I have prepared a urcap titled “CapSens” which consists of a Daemon (Python script running as an executable in the background ) process along with a XML-RPC client interface, Program Node and Installation Node.

The Daemon (Python script running as an executable in the background ) process utilizes the XML-RPC communication interface to receive the sensor data from sensor specific hardware setup. The python script dedicated for the Daemon process is configured as an XML-RPC server which registers the methods required for retrieving the sensor data from the sensor specific HW setup. And the XML-RPC client interface calls the XML-RPC server and executes the XML-RPC server specific registered methods which were defined earlier in the Python script.

Situation 1 => A ‘.urp’ UR10 robot program was defined with the “CapSens” urcap. After starting the Daemon process by configuring the relevant parameters appropriately from the Installation Node, the sensor data is shown in the preview section of the Program Node. The preview section of the Program Node utilizes XML-RPC client which in turn executes the XML-RPC server specific registered methods which were defined earlier in the Python script. Regarding situation 1, please refer to the following Figures 1.1, 1.2, 1.3 and 1.4.


Figure 1.1: Installation Node view before starting the Daemon process


Figure 1.2: Program Node view before starting the Daemon process


Figure 1.3: Installation Node view after starting the Daemon process


Figure 1.4: Program Node view after starting the Daemon process from installation node view

Situation 2 => After starting the Dameon process from the Installation Node, a runtime error “XMLRPC: Failed with error code 1: <type ‘exceptions.TypeError’>:an integer is required” results from the execution of ‘.urp’ UR10 robot program. Regarding situation 2, please see the following Figures 2.1, 2.2 and 2.3.


Figure 2.1: Program Node view after executing the UR10 robot program which utilizes the “CapSens” urcap


Figure 2.2: Runtime error “XMLRPC: Failed with error code 1: <type ‘exceptions.TypeError’>:an integer is required”


Figure 2.3: Runtime error refers to line 84 of ‘CapSensProgramNodeContribution.java’ file

Regarding the above-mentioned runtime error, I did a brief google search about this particular runtime error in the context of urcaps and also did a quick search in the universal robots+ forum. Unfortunately, i couldn’t find information which helps me to resolve the runtime error.

Has anyone encountered such kind of runtime error in the context of URCaps consisting of a Daemon process and XML-RPC communication interface?

Please give me your invaluable suggestions.

The following are the technical details of “CapSens” urcap.

Virtual Machine => URCapsStarterPackage [https://plus.universal-robots.com/download-center/urcaps-starter-package/?f=1.9.0] which is included with URCaps SDK version 1.9.0

URCap API version utilized to develop “CapSens” urcap => 1.8.0

UR10 Universal Robot Control Software => URSoftware 3.12.0.90886 (Nov 15, 2019) & URSoftware 3.11.0.82155 (Aug 20, 2019)

Thanking you in advance!

Best Regards,
Sriniwas Maddukuri

I forgot to upload the source code of “CapSens” urcap. The following is the source code of “CapSens” urcap.

“CapSens” urcap => com.profactor.capsens.zip (234.8 KB)

I found the cause behind the run time error [“XMLRPC: Failed with error code 1: <type ‘exceptions.TypeError’>:an integer is required”. The cause exists from both the URCap side and from the Daemon side. From the Daemon side, part of the cause is in the python script “capsensors_socketcomm_test1.py” and from the URCap side the remaining part of the cause is in the “XmlRpcCapSensInterface.JAVA” file.

Daemon side => In the python script, an explicit conversion of received Java Integer object from URCap into Python supported int was missing. This is evident in line 68 of “capsensors_socketcomm_test1.py”.

The above-mentioned runtime error was resolved by modifying the line 68 of “capsensors_socketcomm_test1.py” in the following way.

daemon_port = int (new_daemon_port)

URCap side => In the “XmlRpcCapSensInterface.JAVA” file, the parsing of the argument inside the function ‘setPortNum(Integer port_num)’ is incorrect. The proper way to parse the JAVA integer object as an argument to the function in line 77 of “XmlRpcCapSensInterface.JAVA” is supposed to be done in the following way.

args.add(port_num.intValue());

1 Like