DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.

Ok, so I have a simple XMLRPC server running on my PC and I can communicate with it from  URSim.  The issue I'm having now is controlling the data types coming back to the robot.  I'm using the same basic URP scripting that UR has in their support section.

     pallet_server := rpc_factory("xml_rpc", "")

     get_next_pose := pallet_server.p_next_box(5)

On the server, this opens up a CSV file and strips out the 5th entry in the Box# column (using DictReader() class to read the CSV).  When I run the simple Python client below, I enter 5 and it's works fine.
import xmlrpc.client
import csv

s = xmlrpc.client.ServerProxy('')

index = input("Box Number: ")

When I run the UR program I get the following error:

The "current_box" variable is nested inside an IF statement (not showing all my code, obviously):
def get_next_box_location(index):
    with open('PalletDefinitionSheet.csv') as csvfile:
        reader = csv.DictReader(csvfile)
            for row in reader:
                if row['Box#']==index:
    return (current_box)
server.register_function(get_next_box_location, 'p_next_box')
Like I said before, this code works fine when I run the plain Python client request, but I get the error when I run it in my URP.  If I put the assignment of "current_box" before the IF, I always get that value returned.  Any ideas as to why this is happening?

If I monkey my code around so I get SOMETHING back that's usable, I get a data type mismatch.  Polyscope tells me that I am sending string when it expects pose or list of joint positions.  In the Python shell I see the output as:
However, it arrives in Polyscope as:
Any idea how to handle this?