Hi! We’re currently using Python over ethernet to send commands to the UR-10. We’re also using a hex torque sensor and it’s add-on commands to provide extra functionality to the UR-10. Specifically we’re trying to use the “pin_insertion” command to guide a pin into a very tight hole. Now we can perform the pin insertion just fine if we create and perform the commands using UrScript on the UR-10 itself. But since our entire logic is in Python we want to perform the commands from there.
The commands we want to perform are as follows:
//Zero the sensor
of_tcp_offset_send_actual()
of_ft_bias()
//Perform the insertion
global of_return = of_pin_insertion( minDistZ = 0.03 , forceZ = 5.0 , compliance = [True, True, True, True, True, True] , maxDistZ = 0.05 , expSpeed = 0.0 , deltaForce = 0.0 , timeOut = 0.0 , FTLimits = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] , PGainF = 1.0 , PGainT = 0.2 , silent = False )
We tried to excecute the commands as follows using Python but this doesnt work…:
send_command("of_tcp_offset_send_actual()")
send_command("of_ft_bias()")
send_command("global of_return = of_pin_insertion( minDistZ = 0.03 , forceZ = 5.0 , compliance = [True, True, True, True, True, True] , maxDistZ = 0.05 , expSpeed = 0.0 , deltaForce = 0.0 , timeOut = 0.0 , FTLimits = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] , PGainF = 1.0 , PGainT = 0.2 , silent = False )")
The send command function is as follows:
def send_command(string):
global s
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10)
s.connect((HOST, PORT_30003))
s.send(string + "\n")
time.sleep(0.01)
s.close
Any help would be nice!