We are developing a URCap to perform interactive record and playback tasks with a UR5 and our end-effector, but we are facing an unexpected behavior. The problem comes up when the Python XML-RPC daemon tries to save the recorded trajectory points in a file located on a usb memory connected to the teach pendant. The python module used is the
pickle one, which actually load and dump the data correctly everytime (using respectively,
pickle.dump()). However, when I click the “save changes” button on the GUI which call the RPC to dump the recorded waypoints, the robot enters in the protection mode with the followings log:
I rewrite the two warnings for possibily future searches:
C4A1: Communication issue: Communication with Controller lost. C192A18: Safety system fault: The other safety processor is in fault.
On restart, I found the previously modified data correctly loaded by the related python method (which do not cause any crash).
I’ve already tried to investigate a bit the problem but it seems to be related only with the
Alessandro Tondo @qbrobotics
Update: after some experiments I’ve noted that the exact same failure happens occasionally during the recording phase. This is a bit annoying since I have to restart the robot everytime.
Update 2: I forgot to mention that this problem has never happened during the simulation on my PC.
Is there a verbose log to investigate what cause the fault?
Could you give more detailed information on what your python daemon does, your AWT GUI does and how many points generally you record?
I’d guess that this may be due to your python script being too resource hungry and not leaving CPU time for URcontrol to communicate with the robot.
You could try monitoring the output of the top command while calling these methods/adjusting the priority of your python execution to make it “nicer”.
Thank you both for your time.
My python daemon stores few waypoints during the record phase in a object list, and it writes to file only when a GUI button is pressed. It writes every time the whole list of about 16 objects which can be arbitrarily filled with waypoints (no more than 10 elements per object) or not. And it does not matter if I change just one waypoint or many, it always crashes (e.g. even if the whole list is empty).
@ajp that’s what I believe too, but the python methods are indivisible anyway.
The python script is something like the following:
#!/usr/bin/env python import cPickle as pickle import sys from SimpleXMLRPCServer import SimpleXMLRPCServer class RecordedData: def __init__(self): self.joint_positions =  def insertWaypoint(self, id, waypoint): self.joint_positions.insert(id, waypoint) ... list_g = [RecordedData() for i in range(16)] def dump(): trajectories = open('/programs/usbdisk/trajectories.pkl', 'w') pickle.dump(list_g, trajectories, -1) trajectories.close() return 0 def load(): global list_g trajectories = open('/programs/usbdisk/trajectories.pkl', 'r') list_g = pickle.load(trajectories) trajectories.close() return 0 def insertMotionWaypoint(id, point_id, waypoint): list_g[id].insertWaypoint(point_id, waypoint) return 0 ... def main(): load() # load previous stored trajectories server = SimpleXMLRPCServer(("127.0.0.1", 40405)) server.register_function(dump, "dump") server.register_function(load, "load") server.register_function(insertMotionWaypoint, "insertMotionWaypoint") ... server.serve_forever() if __name__ == '__main__': main()
Alessandro Tondo @qbrobotics
What if you dump to a file on the local disk first? Same error?
Thank you for your assistance @ajp
Do you mean something like
How can I access that directory to recover dumped files then?
Update: it works! Thank you very much.
Great! You can use shutil.move() to move the file to the USB after that. (it’s possible this will make the communication issue re-emerge though)