{"application":{"id":"1","applicationInfo":{"name":"background_gp_reg_10_14","robotType":"UR5","createdDate":1783503389873,"lastModifiedDate":1783515214271,"defaultProgramId":null},"applicationContent":{"sourceConfig":{"labelMap":{},"analogDomainMap":{},"presets":{}},"activeOperatorScreen":"ur-operator-screen-default","smartSkills":[{"name":"Align to Plane","enabled":true,"type":"ur-align-to-plane","parameters":{"radius":0.05,"push_force":20,"n_plane_points":3,"max_distance":0.25,"velocity_slow":0.001,"velocity_search":0.035,"velocity_move":0.1,"acceleration":0.1}},{"name":"Align Z to Nearest Axis","enabled":true,"type":"ur-align-z-to-nearest-axis"},{"name":"Center","enabled":true,"type":"ur-center","parameters":{"push_force":10,"velocity_move":0.05,"acc_move":0.2,"max_radius_search":0.05,"num_fingers":3}},{"name":"Freedrive","enabled":true,"type":"ur-freedrive","version":"1.0.0","recordingFrequency":50,"recordingSignals":["timestamp","target_q","actual_TCP_pose","tcp_offset"]},{"name":"Move into Contact","enabled":true,"type":"ur-move-into-contact","parameters":{"force":10,"velocity":0.05,"acceleration":0.2,"max_distance":0.25,"retract":0},"version":"1.0.0"},{"name":"Retract","enabled":true,"type":"ur-retract","parameters":{"distance":0.1,"acceleration":0.4,"velocity":0.1},"version":"1.0.0"},{"name":"Put into Box","enabled":false,"type":"ur-put-in-box","version":"1.0.0"},{"name":"Custom","enabled":false,"type":"ur-custom-smart-skill","parameters":{"includePreamble":true,"includeModules":false},"version":"1.0.0"},{"name":"Home","enabled":true,"type":"ur-position","version":"1.1.2","parameters":{"actualWaypoint":{"frame":"base","pose":{"position":[0.0007234911264933834,-0.2333977082004337,1.0803476302965433],"orientation":[-0.0030465488234298825,2.219299153348662,-2.220820782887323]},"qNear":{"base":0,"shoulder":-1.5707963249999999,"elbow":0,"wrist1":-1.5707963249999999,"wrist2":0,"wrist3":0}},"variable":{"name":"Home","reference":false,"type":"$$Variable","valueType":"waypoint","id":"7622345a-0e52-2cf8-0ff6-3a6568b1e03a","_IDENTIFIER":"VariableDeclaration"}}}],"safety":{"settings":{"io":{"automaticModeSafeguardResetInput":{"name":"automaticModeSafeguardResetInput","valueA":255,"valueB":255},"automaticModeSafeguardStopInput":{"name":"automaticModeSafeguardStopInput","valueA":255,"valueB":255},"emergencyStopInput":{"name":"emergencyStopInput","valueA":255,"valueB":255},"notReducedModeOutput":{"name":"notReducedModeOutput","ossdEnabled":false,"valueA":255,"valueB":255},"operationalModeInput":{"name":"operationalModeInput","valueA":255,"valueB":255},"reducedModeInput":{"name":"reducedModeInput","valueA":255,"valueB":255},"reducedModeOutput":{"name":"reducedModeOutput","ossdEnabled":false,"valueA":255,"valueB":255},"robotMovingOutput":{"name":"robotMovingOutput","ossdEnabled":false,"valueA":255,"valueB":255},"robotNotStoppingOutput":{"name":"robotNotStoppingOutput","ossdEnabled":false,"valueA":255,"valueB":255},"safeHomeOutput":{"name":"safeHomeOutput","ossdEnabled":false,"valueA":255,"valueB":255},"safeguardResetInput":{"name":"safeguardResetInput","valueA":0,"valueB":1},"systemEmergencyStoppedOutput":{"name":"systemEmergencyStoppedOutput","ossdEnabled":false,"valueA":255,"valueB":255},"threePositionSwitchInput":{"name":"threePositionSwitchInput","valueA":255,"valueB":255},"freedriveEnabledInput":{"name":"freedriveEnabledInput","valueA":255,"valueB":255},"threePositionEnablingStopOutput":{"name":"threePositionEnablingStopOutput","ossdEnabled":false,"valueA":255,"valueB":255},"notThreePositionEnablingStopOutput":{"name":"notThreePositionEnablingStopOutput","ossdEnabled":false,"valueA":255,"valueB":255}},"major":5,"minor":14,"normalJointPositions":{"base":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"elbow":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"shoulder":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"wrist1":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"wrist2":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"wrist3":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false}},"normalJointSpeeds":{"base":3.3415926,"shoulder":3.3415926,"elbow":3.3415926,"wrist1":3.3415926,"wrist2":3.3415926,"wrist3":3.3415926},"normalRobotLimits":{"elbowForce":150,"elbowSpeed":1.5,"momentum":25,"power":300,"stoppingDistance":0.5,"stoppingTime":0.4,"toolForce":150,"toolSpeed":1.5},"reducedJointPositions":{"base":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"elbow":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"shoulder":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"wrist1":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"wrist2":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false},"wrist3":{"maximum":6.33555,"maximumJointPosition":0.05235988,"maximumRevolutionCounter":1,"minimum":-6.33555,"minimumJointPosition":6.2308254,"minimumRevolutionCounter":-2,"unlimited":false}},"reducedJointSpeeds":{"base":3.3415926,"shoulder":3.3415926,"elbow":3.3415926,"wrist1":3.3415926,"wrist2":3.3415926,"wrist3":3.3415926},"reducedRobotLimits":{"elbowForce":120,"elbowSpeed":0.75,"momentum":10,"power":200,"stoppingDistance":0.3,"stoppingTime":0.3,"toolForce":120,"toolSpeed":0.75},"safetyHardware":{"injectionMoldingMachineInterface":"NONE","teachPendant":"NORMAL"},"safetyPlanes":{"planes":[{"id":"e89dd1d0-8efc-4749-b0a3-344328a0068e","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"6ba29c2a-46e6-ba6e-ec90-930ca7d111c7","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"ce57234c-10e1-a66d-29d6-362597da08b9","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"6e05ab52-f94a-730c-cfdb-95c1265aab42","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"04ebb37f-7bda-efaf-39fb-e6b4f85c12f2","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"c25d0554-96c4-1f9a-dc72-9e48870c924f","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"a82b8c7b-595b-32af-118c-a9f4a079bb3c","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"},{"id":"276c328c-5058-f36e-b117-2a230e67e94a","name":"UNDEFINED","safetyPlane":{"normalModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModePlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"reducedModeTriggerPlane":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true},"tilt":0,"offset":0,"rotation":0,"restriction":"disabled"}],"ioSafetyPlanes":[{"id":"3c588faf-c35b-f291-c687-aba03a8613be","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"b911facc-69b8-e42d-76ed-3c8e386b43dd","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"cb6cacbc-37ae-83df-c79a-72455758d3e3","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"ff45458a-3580-39d7-7a07-59eda63d378f","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"a7ead258-c386-d799-6b9f-4e9b48884243","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"2a1bf9b9-cb64-e1bc-1481-3aaf69be6a03","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"dbffeead-a848-d30f-c85c-f96d425e14f6","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"},{"id":"76b63824-55a2-538b-b861-df918ea1c783","name":"UNDEFINED","ioSafetyPlane":{"triggerOutput":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"triggerSafeguard":{"distance":0,"vector":{"x":0,"y":0,"z":0}},"restrictsElbow":false,"restrictsToolFlange":true,"inputConfiguration":{"name":"UNDEFINED","valueA":255,"valueB":255},"outputConfiguration":{"name":"UNDEFINED","ossdEnabled":false,"valueA":255,"valueB":255}},"tilt":0,"offset":0,"rotation":0,"trigger":"disabled"}]},"safetySafeHome":{"base":-1,"elbow":-1,"shoulder":-1,"wrist1":-1,"wrist2":-1,"wrist3":-1,"enabled":false},"safetyAPIParameters":{"numberOfClients":0,"clients":[]},"safetyFieldbusses":{"enablePROFIsafe":false,"sourceAddressPROFIsafe":0,"destAddressPROFIsafe":0,"modeControlPROFIsafe":false},"threePosition":{"allowManualHighSpeed":true,"useTeachPendantAs3PE":false},"toolDirection":{"limitDeviation":6.2831855,"limitDirection":{"x":0,"y":0,"z":1},"limitRestriction":"DISABLED","tcp":{"id":"toolFlangeTcpId","name":"Tool_flange"},"toolPan":0,"toolTilt":0,"limitTilt":0,"limitRotation":0},"toolPositions":{"toolPositions":[{"name":"Tool Flange","center":{"x":0,"y":0,"z":0},"radius":0,"definition":2},{"name":"UNDEFINED","center":{"x":0,"y":0,"z":0},"radius":0,"definition":0},{"name":"UNDEFINED","center":{"x":0,"y":0,"z":0},"radius":0,"definition":0}]},"normalWristClamp":{"enableWristClampPosition":"LIMIT_ENABLED","enableWristClampTorque":"LIMIT_ENABLED"},"reducedWristClamp":{"enableWristClampPosition":"LIMIT_ENABLED","enableWristClampTorque":"LIMIT_ENABLED"}},"crc":"2850523693","confirmed":true},"operatorScreens":[{"type":"ur-operator-screen-default","version":"0.0.2","parameters":{"status":[],"configuration":[]}}],"applicationContributions":{"ur-mounting":{"type":"ur-mounting","version":"0.0.1","mounting":{"baseAngle":{"value":0,"unit":"deg"},"tiltAngle":{"value":0,"unit":"deg"}}},"ur-frames":{"type":"ur-frames","version":"0.0.7","framesList":[{"name":"base","nameVariable":{"name":"base","reference":false,"type":"$$Variable","valueType":"frame","id":"583d3a7d-b103-aff9-502d-73d459fc2a0e","_IDENTIFIER":"VariableDeclaration"},"parent":"world","pose":{"position":[0,0,0],"orientation":[0,0,0]}},{"name":"tcp","nameVariable":{"name":"tcp","reference":false,"type":"$$Variable","valueType":"frame","id":"1debc310-2146-1b93-ebf3-6e257bfdd2da","_IDENTIFIER":"VariableDeclaration"},"parent":"flange","pose":{"position":[0,0,0],"orientation":[0,0,0]}},{"name":"world","nameVariable":{"name":"world","reference":false,"type":"$$Variable","valueType":"frame","id":"ddca5ccc-8f81-8461-2a8f-935321f2bf01","_IDENTIFIER":"VariableDeclaration"},"pose":{"position":[0,0,0],"orientation":[0,0,0]}},{"name":"flange","nameVariable":{"name":"flange","reference":false,"type":"$$Variable","valueType":"frame","id":"a284652e-3e38-9434-2e20-eae9dd10bd79","_IDENTIFIER":"VariableDeclaration"},"parent":"base","pose":{"position":[0,0,0],"orientation":[0,0,0]}}]},"ur-grid-pattern":{"type":"ur-grid-pattern","version":"0.0.3","grids":[{"grid":{"name":"grid","reference":false,"type":"$$Variable","valueType":"grid","id":"af733917-cce3-4b11-fb24-7e6677ff572e","_IDENTIFIER":"VariableDeclaration"},"waypoint":{"name":"grid_iterator","reference":false,"type":"$$Variable","valueType":"waypoint","id":"68ebd02e-0a2d-ad92-c6de-c677a19dddf0","_IDENTIFIER":"VariableDeclaration"},"corners":[null,null,null,null],"numRows":4,"numColumns":5}]},"ur-end-effector":{"type":"ur-end-effector","version":"0.0.2","endEffectors":[{"id":"ff024c69-09b0-7f9a-4337-82a774fe7b8f","name":"Robot","payload":{"weight":{"value":0,"unit":"kg"}},"cog":{"cx":{"value":0,"unit":"m"},"cy":{"value":0,"unit":"m"},"cz":{"value":0,"unit":"m"}},"inertia":{"Ixx":{"value":0,"unit":"kg*m^2"},"Iyy":{"value":0,"unit":"kg*m^2"},"Izz":{"value":0,"unit":"kg*m^2"},"Ixy":{"value":0,"unit":"kg*m^2"},"Ixz":{"value":0,"unit":"kg*m^2"},"Iyz":{"value":0,"unit":"kg*m^2"}},"useCustomInertia":false,"tcps":[{"id":"9d2f3820-89cc-9b9d-0d28-d03387086ed9","name":"Tool_flange","x":{"value":0,"unit":"m"},"y":{"value":0,"unit":"m"},"z":{"value":0,"unit":"m"},"rx":{"value":0,"unit":"rad"},"ry":{"value":0,"unit":"rad"},"rz":{"value":0,"unit":"rad"}}]}],"defaultTcp":{"endEffectorId":"ff024c69-09b0-7f9a-4337-82a774fe7b8f","tcpId":"9d2f3820-89cc-9b9d-0d28-d03387086ed9"}},"ur-motion-profiles":{"type":"ur-motion-profiles","version":"0.0.1","moveProfiles":{"joint":[{"isDefault":false,"profile":{"name":"Joint_fast","reference":false,"type":"$$Variable","valueType":"profile","id":"66cc9640-9626-20a9-b6be-e75938fdf603","_IDENTIFIER":"VariableDeclaration"},"parameters":{"speedType":"OptiMove","speed":{"entity":{"value":1.0471975511965976,"unit":"rad/s"},"selectedType":"VALUE","value":1.0471975511965976},"acceleration":{"entity":{"value":1.3962634015954636,"unit":"rad/s^2"},"selectedType":"VALUE","value":1.3962634015954636},"optiMoveSpeed":{"entity":{"value":50,"unit":"%"},"selectedType":"VALUE","value":50},"optiMoveAcceleration":{"entity":{"value":25,"unit":"%"},"selectedType":"VALUE","value":25}}},{"isDefault":true,"profile":{"name":"Joint_slow","reference":false,"type":"$$Variable","valueType":"profile","id":"0e781f7a-4120-999b-9eb9-c25c1dc8d0c8","_IDENTIFIER":"VariableDeclaration"},"parameters":{"speedType":"OptiMove","speed":{"entity":{"value":1.0471975511965976,"unit":"rad/s"},"selectedType":"VALUE","value":1.0471975511965976},"acceleration":{"entity":{"value":1.3962634015954636,"unit":"rad/s^2"},"selectedType":"VALUE","value":1.3962634015954636},"optiMoveSpeed":{"entity":{"value":20,"unit":"%"},"selectedType":"VALUE","value":20},"optiMoveAcceleration":{"entity":{"value":4,"unit":"%"},"selectedType":"VALUE","value":4}}}],"linear":[{"isDefault":false,"profile":{"name":"Linear_fast","reference":false,"type":"$$Variable","valueType":"profile","id":"2faf9dcd-a026-b177-e610-2044e80f9d1a","_IDENTIFIER":"VariableDeclaration"},"parameters":{"speedType":"OptiMove","speed":{"entity":{"value":0.25,"unit":"m/s"},"selectedType":"VALUE","value":0.25},"acceleration":{"entity":{"value":1.2,"unit":"m/s^2"},"selectedType":"VALUE","value":1.2},"optiMoveSpeed":{"entity":{"value":50,"unit":"%"},"selectedType":"VALUE","value":50},"optiMoveAcceleration":{"entity":{"value":25,"unit":"%"},"selectedType":"VALUE","value":25}}},{"isDefault":true,"profile":{"name":"Linear_slow","reference":false,"type":"$$Variable","valueType":"profile","id":"f9fc918f-21e5-f43d-8029-5ab979f2ce28","_IDENTIFIER":"VariableDeclaration"},"parameters":{"speedType":"OptiMove","speed":{"entity":{"value":0.25,"unit":"m/s"},"selectedType":"VALUE","value":0.25},"acceleration":{"entity":{"value":1.2,"unit":"m/s^2"},"selectedType":"VALUE","value":1.2},"optiMoveSpeed":{"entity":{"value":20,"unit":"%"},"selectedType":"VALUE","value":20},"optiMoveAcceleration":{"entity":{"value":4,"unit":"%"},"selectedType":"VALUE","value":4}}}],"process":[{"isDefault":true,"profile":{"name":"Process","reference":false,"type":"$$Variable","valueType":"profile","id":"854474bd-bfb7-9f87-49da-48a03f2d574c","_IDENTIFIER":"VariableDeclaration"},"parameters":{"speedType":"Classic","speed":{"entity":{"value":0.25,"unit":"m/s"},"selectedType":"VALUE","value":0.25},"acceleration":{"entity":{"value":1.2,"unit":"m/s^2"},"selectedType":"VALUE","value":1.2}}}]}},"ur-smart-skills":{"type":"ur-smart-skills","version":"0.0.3","preamble":"# Start of Forces\n###\n# Transforms the force and torque values along the axes of the given pose\n# @param pose pose Any valid pose, defaults to base, the x, y, and z values are ignored\n# @return array 6D force torque vector with [Fx, Fy, Fz, Mx, My, Mz] aligned to pose in N and Nm respectively\n###\ndef get_tcp_wrench_in_frame(pose = p[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]):\n    # we are only interested in the rotation of pose, set translations to zero\n    local target_pose = pose\n    target_pose[0] = 0\n    target_pose[1] = 0\n    target_pose[2] = 0\n    # the conversion needs to happen as poses, so we need to convert back and forth a bit\n    local force = get_tcp_force()\n    local force_vector_as_pose = p[force[0], force[1], force[2], 0, 0, 0]\n    local torque_vector_as_pose = p[force[3], force[4], force[5], 0, 0, 0]\n    local transformed_force_as_pose = pose_trans(pose_inv(target_pose), force_vector_as_pose)\n    local transformed_torque_as_pose = pose_trans(pose_inv(target_pose), torque_vector_as_pose)\n    return [transformed_force_as_pose[0], transformed_force_as_pose[1], transformed_force_as_pose[2], transformed_torque_as_pose[0], transformed_torque_as_pose[1], transformed_torque_as_pose[2]]\nend\n###\n# See documentation for @link:get_tcp_wrench_in_frame()\n# @return forces and torques measured in TCP frame\n###\ndef get_tcp_wrench():\n    return get_tcp_wrench_in_frame(get_target_tcp_pose())\nend\n###\n# Projects the measured TCP force along the axis given\n# @param axis array 3D vector\n###\ndef project_tcp_force(axis):\n    local wrench = get_tcp_wrench()\n    local force = [wrench[0], wrench[1], wrench[2]]\n    return dot(force, axis)\nend\n# End of Forces\n# Start of Math\n# Definitions of constants\nglobal PI = acos(-1)\n###\n# Calculates the cross product between to 3D vectors\n# @param v1 array 3D vector\n# @param v2 array 3D vector\n###\ndef cross(v1, v2):\n    if length(v1) != length(v2):\n        popup(str_cat(\"For computing the cross product, the two vectors must have the same length. Provided lengths: \", [length(v1), length(v2)]), error=True, blocking=True)\n        return -1\n    end\n    if length(v1) != 3:\n        popup(str_cat(\"For computing the cross product, the two vectors must have length 3. Provided lengths: \", [length(v1), length(v2)]), error=True, blocking=True)\n        return -1\n    end\n    local cross = [0.0, 0.0, 0.0]\n    local i = 0\n    while i < 3:\n        local j = (i + 1) % 3 # The next index in a cyclic order\n        local k = (i + 2) % 3 # The next next index in a cyclic order\n        cross[i] = v1[j] * v2[k] - v1[k] * v2[j]\n        i = i + 1\n    end\n    return cross\nend\n###\n# Calculates the dot product between to n-dimensional vectors\n# @param v1 array nD vector\n# @param v2 array nD vector\n###\ndef dot(v1, v2):\n    if length(v1) != length(v2):\n        popup(str_cat(\"For computing the dot product, the two vectors must have the same length. Provided lengths: \", [length(v1), length(v2)]), error=True, blocking=True)\n        return -1\n    end\n    local result = 0\n    local i = 0\n    while i < length(v1):\n        result = result + (v1[i] * v2[i])\n        i = i + 1\n    end\n    return result\nend\n###\n# Return the larger number of a and b\n# @param a number a\n# @param b number b\n###\ndef max(a, b):\n    if a > b:\n        return a\n    end\n    return b\nend\n###\n# Find the maximum value in a list. The list must be of non-zero length and contain numbers\n# @param list array list\n###\ndef list_max(list):\n    local length = get_list_length(list)\n    if  length == 0:\n        popup(\"Getting the maximum of an empty list is impossible in list_max().\", error = True, blocking = True)\n        halt\n    end\n    local i = 0\n    local max = list[0]\n    while i < length:\n        if list[i] > max:\n            max = list[i]\n        end\n        i = i + 1\n        sync_at_multiple(i, 30)\n    end\n    return max\nend\ndef sync_at_multiple(i, n):\n    local tmp = i / n\n    if tmp == floor(tmp):\n        sync()\n    end\nend\n# End of Math\n# Start of Move Helper\nur_move_until_force_distance = 0.1\nur_move_until_force_direction = [0, 0, 1]\nur_move_until_force_velocity = 0.1\nur_move_until_force_acceleration = 0.2\ndef ur_move_tcp_direction(distance, direction, velocity, acceleration, blend_radius):\n    local current_pose = get_target_tcp_pose()\n    local movement = normalize(direction) * distance\n    local target_pose = pose_trans(current_pose, p[movement[0], movement[1], movement[2], 0, 0, 0])\n    movel(target_pose, a = 0.2, v = velocity, r = blend_radius)\nend\nthread ur_move_until_force_thread():\n    ur_move_tcp_direction(ur_move_until_force_distance, ur_move_until_force_direction, ur_move_until_force_velocity, ur_move_until_force_acceleration, 0)\n    popup(\"No contact detected.\", title = \"No Contact\", warning = False, error = True, blocking = False)\n    halt\nend\n###\n# Moves the robot in the TCP direction specified until a contact point is reached *or*\n# the robot reaches the maximum distance allowed specified by the distance parameter.\n# @param distance number The maximum distance the robot is allowed to travel in the direction specified\n# @param direction array 3D vector determining the move direction of the TCP\n# @param velocity number Velocity of the robot\n# @param acceleration number Acceleration of the robot\n# @param stop_force number Maximum search radius\n###\ndef ur_move_until_force(distance = 0.1, direction = [0, 0, 1], velocity = 0.1, acceleration = 0.2, stop_force = 20):\n    ur_move_until_force_distance = distance\n    ur_move_until_force_direction = direction\n    ur_move_until_force_velocity = velocity\n    ur_move_until_force_acceleration = acceleration\n    \n    thrd = run ur_move_until_force_thread()\n    while - project_tcp_force(direction) < stop_force:\n        sync()\n    end\n    kill thrd\n    local actual_pose = get_actual_tcp_pose()\n    stopl(1.0)\n    return actual_pose\nend\ndef ur_get_joint_speeds_before_offset(previous_q, time):\n    local current_q = get_joint_positions()\n    local delta_q = current_q - previous_q\n    return delta_q / time\nend\ndef ur_path_move(end_q, v, rampdown=False):\n    # Calculate distance to target\n    local start_q = get_joint_positions()\n    local delta_q = end_q - start_q\n    local positive_delta_q = [norm(delta_q[0]), norm(delta_q[1]), norm(delta_q[2]), norm(delta_q[3]), norm(delta_q[4]), norm(delta_q[5])]\n    # Calculate time to move based on desired velocity\n    local t = list_max(positive_delta_q) / v\n    servoj(end_q , 0, 0, t, lookahead_time=0.1, gain=500)\n    if(rampdown):\n        while(norm(ur_get_joint_speeds_before_offset(start_q, t)) > 0.0001):\n            t = max(t, 0.001)\n            start_q = get_joint_positions()\n            servoj(end_q , 0, 0, t)\n        end\n    end\nend\n# End of Move Helper"},"ur-application-variables":{"type":"ur-application-variables","version":"0.0.1","variables":{}},"ur-urconnect-application":{"type":"ur-urconnect-application","version":"1.0.0"}},"sidebarItems":[{"type":"ur-global-variables","version":"1.0.0","disabled":{"master":false,"automaticMode":false,"remoteMode":true}},{"type":"ur-log-messages-sidebar","version":"0.0.1","disabled":{"master":false,"automaticMode":false,"remoteMode":true}}],"logicPrograms":{"395b37c7-c41b-a6c0-b2a8-14d8ccf94a54":{"id":"395b37c7-c41b-a6c0-b2a8-14d8ccf94a54","programContent":{"children":[{"children":[],"contributedNode":{"type":"ur-modules","version":"0.0.1","allowsChildren":true,"lockChildren":false},"guid":"5f8867ec-c815-bf15-719e-ad8333e11b6b","parentId":"fc2ba7ab-7ba4-a041-19ec-271124f0e475","programType":"logic"},{"children":[],"contributedNode":{"type":"ur-functions","version":"0.0.1","allowsChildren":true,"lockChildren":false},"guid":"eb827e12-73da-82ea-f438-66952b0458bd","parentId":"fc2ba7ab-7ba4-a041-19ec-271124f0e475","programType":"logic"},{"children":[{"children":[],"contributedNode":{"type":"ur-assignment","version":"0.0.3","allowsChildren":false,"parameters":{"variable":{"entity":{"name":"gp_bool_0_10","id":"de3cd022-a771-db56-9873-1a807460abf5","valueType":"array","_IDENTIFIER":"VariableDeclaration","reference":false,"type":"$$Variable","declaredByID":"2ab69e3a-3364-bfd5-08f2-27d8ee921cc9"},"selectedType":"EXPRESSION","value":"make_list(10, False)"},"valueType":"array","waypointType":"teach"}},"guid":"2ab69e3a-3364-bfd5-08f2-27d8ee921cc9","parentId":"9e3365ee-18ef-c23c-ada4-243648825ac3","programLabel":[{"type":"primary","value":"gp_bool_0_10:"},{"type":"secondary","value":"make_list(10, False)"}],"programType":"logic"},{"children":[],"contributedNode":{"type":"ur-assignment","version":"0.0.3","allowsChildren":false,"parameters":{"variable":{"entity":{"name":"gp_int_0_10","id":"e6a281ed-df52-d43d-29e6-b42c85ebc53b","valueType":"array","_IDENTIFIER":"VariableDeclaration","reference":false,"type":"$$Variable","declaredByID":"3d7b298c-5521-4645-a419-c505b713f275"},"selectedType":"EXPRESSION","value":"make_list(10, 0)"},"valueType":"array","waypointType":"teach"}},"guid":"3d7b298c-5521-4645-a419-c505b713f275","parentId":"9e3365ee-18ef-c23c-ada4-243648825ac3","programLabel":[{"type":"primary","value":"gp_int_0_10:"},{"type":"secondary","value":"make_list(10, 0)"}],"programType":"logic"},{"children":[],"contributedNode":{"type":"ur-assignment","version":"0.0.3","allowsChildren":false,"parameters":{"variable":{"entity":{"name":"gp_float_0_10","reference":false,"type":"$$Variable","valueType":"array","id":"fa6550ee-eee9-497d-e769-0a2a4d641e5c","_IDENTIFIER":"VariableDeclaration","declaredByID":"8c83d6e3-ead6-a76d-3cd6-6b693040dee2"},"selectedType":"EXPRESSION","value":"make_list(10, 0)"},"valueType":"array","waypointType":"teach"}},"guid":"8c83d6e3-ead6-a76d-3cd6-6b693040dee2","parentId":"9e3365ee-18ef-c23c-ada4-243648825ac3","programLabel":[{"type":"primary","value":"gp_float_0_10:"},{"type":"secondary","value":"make_list(10, 0)"}],"programType":"logic"}],"contributedNode":{"type":"ur-before-start","version":"0.0.1","allowsChildren":true},"guid":"9e3365ee-18ef-c23c-ada4-243648825ac3","parentId":"fc2ba7ab-7ba4-a041-19ec-271124f0e475","programType":"logic"},{"children":[{"children":[{"children":[],"contributedNode":{"type":"ur-script","version":"0.0.1","parameters":{"name":"","expression":"gp_bool_0_10[n] = read_input_boolean_register(n)","valid":true}},"guid":"c094a0ea-cf68-be59-84f1-611e9773f4af","parentId":"1b5c23d3-fb8f-ee49-61a9-9933191f7dab","programLabel":"gp_bool_0_10[n] = read_input_boolean_register(n)","programType":"logic"},{"children":[],"contributedNode":{"type":"ur-script","version":"0.0.1","parameters":{"name":"","expression":"gp_int_0_10[n] = read_input_integer_register(n)","valid":true}},"guid":"d203df17-3231-0b9b-aa73-e95a5a114541","parentId":"1b5c23d3-fb8f-ee49-61a9-9933191f7dab","programLabel":"gp_int_0_10[n] = read_input_integer_register(n)","programType":"logic"},{"children":[],"contributedNode":{"type":"ur-script","version":"0.0.1","parameters":{"name":"","expression":"gp_float_0_10[n] = read_input_float_register(n)","valid":true}},"guid":"c01358f8-aca7-e37b-1f73-8e3cf3dc6286","parentId":"1b5c23d3-fb8f-ee49-61a9-9933191f7dab","programLabel":"gp_float_0_10[n] = read_input_float_register(n)","programType":"logic"}],"contributedNode":{"type":"ur-loop","version":"0.0.2","allowsChildren":true,"parameters":{"type":"xtimes","expression":{"value":"","selectedType":"EXPRESSION"},"xtimes":"10","loopVariable":{"name":"n","reference":false,"type":"$$Variable","valueType":"integer","declaredByID":"1b5c23d3-fb8f-ee49-61a9-9933191f7dab"}}},"guid":"1b5c23d3-fb8f-ee49-61a9-9933191f7dab","parentId":"402af48d-3383-f492-003e-d07d24ac4bf7","programLabel":[{"type":"secondary","translationKey":"program-node-label.loop.times","interpolateParams":{"xtimes":"10"}}],"programType":"logic"},{"children":[],"contributedNode":{"type":"ur-script","version":"0.0.1","parameters":{"name":"","expression":"sync()","valid":true}},"guid":"507842e5-43d3-09e7-9f80-d02d7c4e6a7e","parentId":"402af48d-3383-f492-003e-d07d24ac4bf7","programLabel":"sync()","programType":"logic"}],"contributedNode":{"type":"ur-logic-program","version":"0.0.1","allowsChildren":true,"parameters":{"logicProgram":{"name":"Logic_Program","reference":false,"type":"$$LogicProgram","declaredByID":"402af48d-3383-f492-003e-d07d24ac4bf7"}}},"guid":"402af48d-3383-f492-003e-d07d24ac4bf7","parentId":"fc2ba7ab-7ba4-a041-19ec-271124f0e475","programType":"logic"}],"contributedNode":{"type":"ur-logic-programs","version":"0.0.1","allowsChildren":true,"lockChildren":true,"parameters":{"name":"","symbolHistory":{"variables":[{"name":"gp_bool_0_10","valueType":"array","programNodeMetadata":{"programNodeId":"2ab69e3a-3364-bfd5-08f2-27d8ee921cc9","isSuppressed":false},"reference":{"id":"de3cd022-a771-db56-9873-1a807460abf5","_IDENTIFIER":"VariableReference"}},{"name":"gp_int_0_10","valueType":"array","programNodeMetadata":{"programNodeId":"3d7b298c-5521-4645-a419-c505b713f275","isSuppressed":false},"reference":{"id":"e6a281ed-df52-d43d-29e6-b42c85ebc53b","_IDENTIFIER":"VariableReference"}},{"name":"gp_float_0_10","valueType":"array","programNodeMetadata":{"programNodeId":"8c83d6e3-ead6-a76d-3cd6-6b693040dee2","isSuppressed":false},"reference":{"id":"fa6550ee-eee9-497d-e769-0a2a4d641e5c","_IDENTIFIER":"VariableReference"}},{"name":"base","valueType":"frame","reference":{"id":"583d3a7d-b103-aff9-502d-73d459fc2a0e","_IDENTIFIER":"VariableReference"}},{"name":"tcp","valueType":"frame","reference":{"id":"1debc310-2146-1b93-ebf3-6e257bfdd2da","_IDENTIFIER":"VariableReference"}},{"name":"world","valueType":"frame","reference":{"id":"ddca5ccc-8f81-8461-2a8f-935321f2bf01","_IDENTIFIER":"VariableReference"}},{"name":"flange","valueType":"frame","reference":{"id":"a284652e-3e38-9434-2e20-eae9dd10bd79","_IDENTIFIER":"VariableReference"}},{"name":"grid","valueType":"grid","reference":{"id":"af733917-cce3-4b11-fb24-7e6677ff572e","_IDENTIFIER":"VariableReference"}},{"name":"grid_iterator","valueType":"waypoint","reference":{"id":"68ebd02e-0a2d-ad92-c6de-c677a19dddf0","_IDENTIFIER":"VariableReference"}},{"name":"Joint_fast","valueType":"profile","reference":{"id":"66cc9640-9626-20a9-b6be-e75938fdf603","_IDENTIFIER":"VariableReference"}},{"name":"Joint_slow","valueType":"profile","reference":{"id":"0e781f7a-4120-999b-9eb9-c25c1dc8d0c8","_IDENTIFIER":"VariableReference"}},{"name":"Linear_fast","valueType":"profile","reference":{"id":"2faf9dcd-a026-b177-e610-2044e80f9d1a","_IDENTIFIER":"VariableReference"}},{"name":"Linear_slow","valueType":"profile","reference":{"id":"f9fc918f-21e5-f43d-8029-5ab979f2ce28","_IDENTIFIER":"VariableReference"}},{"name":"Process","valueType":"profile","reference":{"id":"854474bd-bfb7-9f87-49da-48a03f2d574c","_IDENTIFIER":"VariableReference"}},{"name":"Home","valueType":"waypoint","reference":{"id":"7622345a-0e52-2cf8-0ff6-3a6568b1e03a","_IDENTIFIER":"VariableReference"}},{"name":"item_counter","valueType":"integer","reference":{"id":"c3a49a83-3bb9-b10e-054d-ad17b7c54c0a","_IDENTIFIER":"VariableReference"}},{"name":"Loop","valueType":"integer","programNodeMetadata":{"programNodeId":"1b5c23d3-fb8f-ee49-61a9-9933191f7dab","isSuppressed":false},"reference":{"id":"fa673fc3-b37d-68c2-4425-3a157012522b","_IDENTIFIER":"VariableReference"}},{"name":"last_sensor_state","valueType":"boolean","programNodeMetadata":{"programNodeId":"83bc959b-5b7f-7bab-729e-8e0aba6b1154","isSuppressed":false},"reference":{"id":"20174ed1-e311-e40f-6ba1-03e932b25148","_IDENTIFIER":"VariableReference"}},{"name":"lights","valueType":"array","programNodeMetadata":{"programNodeId":"3101b26c-fdc7-888e-aa34-f5773d99a08c","isSuppressed":false},"reference":{"id":"81e077ca-33a4-6ba6-4180-2429fc69c239","_IDENTIFIER":"VariableReference"}},{"name":"light","valueType":"array","programNodeMetadata":{"programNodeId":"98671d76-e74d-70da-c25f-fe9e7e94ba8e","isSuppressed":false},"reference":{"id":"441febb0-40f9-5a25-6c3d-066958f94a8f","_IDENTIFIER":"VariableReference"}},{"name":"t","valueType":"integer","programNodeMetadata":{"programNodeId":"d7dafcfa-8d05-2b98-c093-588c55cc9268","isSuppressed":false},"reference":{"id":"9d47aebd-13b7-7064-dacf-93a0c556c781","_IDENTIFIER":"VariableReference"}},{"name":"safety_status","valueType":"integer","programNodeMetadata":{"programNodeId":"a94a5123-da0e-5158-4caa-ef74f5a8bfe4","isSuppressed":false},"reference":{"id":"c7206784-9ac6-e7c1-f49c-b71eec5869fb","_IDENTIFIER":"VariableReference"}},{"name":"program_status","valueType":"integer","programNodeMetadata":{"programNodeId":"3cbccb98-9300-76fa-1ced-b06ee7b0602f","isSuppressed":false},"reference":{"id":"2ce28a03-6fd0-a810-f1c7-69020112d061","_IDENTIFIER":"VariableReference"}},{"name":"robot_mode","valueType":"integer","programNodeMetadata":{"programNodeId":"a309ac46-c9ad-65dc-70d2-733583976052","isSuppressed":false},"reference":{"id":"4e3afb0f-8029-9660-c50d-bcbe0fc0cb31","_IDENTIFIER":"VariableReference"}},{"name":"status_text","valueType":"string","programNodeMetadata":{"programNodeId":"0d66d687-fa5d-1d85-9f84-f30e1808526b","isSuppressed":false},"reference":{"id":"edf72e83-a4cd-830a-8fdd-998ad6444c0c","_IDENTIFIER":"VariableReference"}},{"name":"blink_timestamp_s","valueType":"array","programNodeMetadata":{"programNodeId":"69aecf70-8d04-f46e-3573-8a87bded46b4","isSuppressed":false},"reference":{"id":"4411d232-83ef-393c-dc43-d9bdccd1aa4f","_IDENTIFIER":"VariableReference"}},{"name":"blink_duration_s","valueType":"array","programNodeMetadata":{"programNodeId":"327f178e-ee44-aa50-205d-048c208aeb1a","isSuppressed":false},"reference":{"id":"10a5c2c2-d635-1521-f7f3-c6d5bfeb9cb3","_IDENTIFIER":"VariableReference"}},{"name":"color","valueType":"array","programNodeMetadata":{"programNodeId":"3101b26c-fdc7-888e-aa34-f5773d99a08c","isSuppressed":false},"reference":{"id":"df0dee3c-64d2-8ece-00b8-0dfd889d6cdf","_IDENTIFIER":"VariableReference"}}],"functions":[{"name":"light_tower_thread","programNodeMetadata":{"programNodeId":"b873e83a-365f-32ba-322f-c79ee8e93d03","isSuppressed":false,"isThread":true},"moduleMetadata":{},"reference":{"id":"68c3a3ef-ca87-2e39-091a-18fe7bd4790d","_IDENTIFIER":"FunctionReference"}},{"name":"get_timestamp_s","programNodeMetadata":{"programNodeId":"4fff03fc-16a6-56a1-c1d4-6db2920455a7","isSuppressed":false,"isThread":false},"moduleMetadata":{},"reference":{"id":"a93b0218-9c47-fcfe-0c7f-8a7f9b90bb69","_IDENTIFIER":"FunctionReference"}},{"name":"reset_lights","programNodeMetadata":{"programNodeId":"a92213f0-35ae-48f4-424a-fe752110cc28","isSuppressed":false,"isThread":false},"moduleMetadata":{},"reference":{"id":"87aee5e7-62b6-cb54-748a-0aafc1a79be3","_IDENTIFIER":"FunctionReference"}},{"name":"robot_status_thread","programNodeMetadata":{"programNodeId":"d82a0c0d-9002-4b6a-0b36-16f26d192843","isSuppressed":false,"isThread":true},"moduleMetadata":{},"reference":{"id":"f3f6996b-25f6-b658-fbb6-012acfc3ef82","_IDENTIFIER":"FunctionReference"}}],"modules":[{"name":"application","reference":{"id":"application-module-id","_IDENTIFIER":"ModuleReference"}},{"name":"Module","programNodeMetadata":{"programNodeId":"ba245961-f8d4-0e7b-8c55-855903c84966","isSuppressed":false},"reference":{"id":"565930d1-03f8-e869-d4a6-acdff84f060a","_IDENTIFIER":"ModuleReference"}}]}}},"guid":"fc2ba7ab-7ba4-a041-19ec-271124f0e475","programType":"logic"},"programInformation":{"name":"Logic_Program","description":"","programState":"FINAL","functionsBlockShown":false,"createdDate":0,"lastSavedDate":0,"lastModifiedDate":0},"urscript":{"script":"$ 1 \"ur-logic-programs\"\n$ 2 \"ur-modules\"\n$ 3 \"ur-functions\"\n$ 4 \"ur-before-start\"\n$ 5 \"ur-assignment\"\nglobal gp_bool_0_10 = make_list(10, False)\n$ 6 \"ur-assignment\"\nglobal gp_int_0_10 = make_list(10, 0)\n$ 7 \"ur-assignment\"\nglobal gp_float_0_10 = make_list(10, 0)\n$ 8 \"ur-logic-program\"\nwhile (True):\n  $ 9 \"ur-loop\"\n  n = 0\n  while (n < 10):\n    $ 10 \"ur-script\"\n    gp_bool_0_10[n] = read_input_boolean_register(n)\n    $ 11 \"ur-script\"\n    gp_int_0_10[n] = read_input_integer_register(n)\n    $ 12 \"ur-script\"\n    gp_float_0_10[n] = read_input_float_register(n)\n    n = n + 1\n  end\n  $ 13 \"ur-script\"\n  sync()\nend","nodeIDList":["00000000-0000-0000-0000-000000000000","fc2ba7ab-7ba4-a041-19ec-271124f0e475","5f8867ec-c815-bf15-719e-ad8333e11b6b","eb827e12-73da-82ea-f438-66952b0458bd","9e3365ee-18ef-c23c-ada4-243648825ac3","2ab69e3a-3364-bfd5-08f2-27d8ee921cc9","3d7b298c-5521-4645-a419-c505b713f275","8c83d6e3-ead6-a76d-3cd6-6b693040dee2","402af48d-3383-f492-003e-d07d24ac4bf7","1b5c23d3-fb8f-ee49-61a9-9933191f7dab","c094a0ea-cf68-be59-84f1-611e9773f4af","d203df17-3231-0b9b-aa73-e95a5a114541","c01358f8-aca7-e37b-1f73-8e3cf3dc6286","507842e5-43d3-09e7-9f80-d02d7c4e6a7e"]},"autoPlayOptions":{"type":"ALWAYS"}}},"sourcesNodes":{"robot":{"groupId":"robot","version":"1.0.0.","sources":[{"sourceID":"ur-wired-io","signals":[{"signalID":"DI 0","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 1","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 2","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 3","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 4","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 5","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 6","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 7","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DO 0","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 1","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 2","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 3","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 4","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 5","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 6","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 7","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CI 0","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 1","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 2","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 3","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 4","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 5","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 6","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CI 7","direction":"IN","valueType":"BOOLEAN"},{"signalID":"CO 0","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 1","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 2","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 3","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 4","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 5","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 6","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"CO 7","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"AI 0","direction":"IN","valueType":"FLOAT"},{"signalID":"AI 1","direction":"IN","valueType":"FLOAT"},{"signalID":"AO 0","direction":"OUT","valueType":"FLOAT"},{"signalID":"AO 1","direction":"OUT","valueType":"FLOAT"}],"webSocketURL":"/sources/wired-io"},{"sourceID":"ur-tool-io","signals":[{"signalID":"DI 0","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DI 1","direction":"IN","valueType":"BOOLEAN"},{"signalID":"DO 0","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"DO 1","direction":"OUT","valueType":"BOOLEAN"},{"signalID":"AI 0","direction":"IN","valueType":"FLOAT"},{"signalID":"AI 1","direction":"IN","valueType":"FLOAT"}],"webSocketURL":"/sources/tool-io"}],"isDynamic":false},"ur-modbus":{"groupId":"ur-modbus","isDynamic":true,"version":"1.0.0","sources":[]},"ur-robot-io":{"type":"ur-robot-io","groupId":"ur-robot-io","isDynamic":false,"version":"1.0.3","sources":[{"sourceID":"ur-robot-wired-io","name":"Wired I/O","signals":[{"direction":"IN","signalID":"DI 0","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 1","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 2","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 3","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 4","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 5","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 6","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 7","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 0","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 1","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 2","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 3","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 4","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 5","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 6","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 7","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 0","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 1","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 2","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 3","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 4","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 5","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 6","valueType":"BOOLEAN"},{"direction":"IN","signalID":"CI 7","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 0","valueType":"BOOLEAN","name":"sensor_input (CO 0)"},{"direction":"OUT","signalID":"CO 1","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 2","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 3","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 4","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 5","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 6","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"CO 7","valueType":"BOOLEAN"},{"direction":"IN","signalID":"AI 0","valueType":"FLOAT"},{"direction":"IN","signalID":"AI 1","valueType":"FLOAT"},{"direction":"OUT","signalID":"AO 0","valueType":"FLOAT"},{"direction":"OUT","signalID":"AO 1","valueType":"FLOAT"}]},{"sourceID":"ur-robot-tool-io","name":"Tool I/O","signals":[{"direction":"IN","signalID":"DI 0","valueType":"BOOLEAN"},{"direction":"IN","signalID":"DI 1","valueType":"BOOLEAN"},{"direction":"IN","signalID":"AI 0","valueType":"FLOAT"},{"direction":"IN","signalID":"AI 1","valueType":"FLOAT"},{"direction":"OUT","signalID":"DO 0","valueType":"BOOLEAN"},{"direction":"OUT","signalID":"DO 1","valueType":"BOOLEAN"}]}],"parameters":{"sourceConfig":{"labelMap":{"ur-robot-wired-io":{"CI 4":"","CO 0":"sensor_input"}},"analogDomainMap":{},"presets":{},"toolOutput":{"dualPinPower":false,"voltage":{"value":0,"unit":"V"},"powerOutput":{"DO 0":1,"DO 1":1}}},"migrateSourceConfigDone":true}},"universalrobots-ethernetip-frontend":{"type":"universalrobots-ethernetip-frontend","version":"1.0.0","programAction":"IGNORE","enabled":false,"groupId":"universalrobots-ethernetip-frontend","sources":[{"sourceID":"frontend-source","name":"EtherNet/IP","signals":[]}],"isDynamic":false},"universalrobots-profinet-frontend-profinet":{"version":"1.0.0","groupId":"universalrobots-profinet-frontend-profinet","sources":[{"sourceID":"ur-profinet-source","name":"Profinet","signals":[]}],"isDynamic":false,"enabled":false,"robotIoModule":"IGNORE","registerModule1":"IGNORE","registerModule2":"IGNORE"}}},"urscript":{"script":"set_safety_mode_transition_hardness(1)\nreset_world_model()\nset_input_actions_to_default()\nset_analog_outputdomain(0,0)\nset_analog_outputdomain(1,0)\nset_standard_analog_input_domain(0,0)\nset_standard_analog_input_domain(1,0)\nset_tool_output_mode(0)\nset_tool_voltage(0)\nset_tool_digital_output_mode(0,1)\nset_tool_digital_output_mode(1,1)\nset_tool_analog_input_domain(0,0)\nset_tool_analog_input_domain(1,0)\nset_gravity([0, 0, 9.82])\nlocal existingBaseParent = get_frame_parent(\"base\")\nlocal basePose = get_pose(\"base\", existingBaseParent)\nbasePose[3] = 0\nbasePose[4] = 0\nbasePose[5] = 0\nmove_frame(\"base\", basePose, existingBaseParent)\nglobal base = \"base\"\nglobal tcp = \"tcp\"\nglobal world = \"world\"\nglobal flange = \"flange\"\nset_target_payload(0, [0, 0, 0], [0, 0, 0, 0, 0, 0])\nset_tcp(p[0, 0, 0, 0, 0, 0], \"Tool_flange\")\n# Start of Forces\n###\n# Transforms the force and torque values along the axes of the given pose\n# @param pose pose Any valid pose, defaults to base, the x, y, and z values are ignored\n# @return array 6D force torque vector with [Fx, Fy, Fz, Mx, My, Mz] aligned to pose in N and Nm respectively\n###\ndef get_tcp_wrench_in_frame(pose = p[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]):\n    # we are only interested in the rotation of pose, set translations to zero\n    local target_pose = pose\n    target_pose[0] = 0\n    target_pose[1] = 0\n    target_pose[2] = 0\n    # the conversion needs to happen as poses, so we need to convert back and forth a bit\n    local force = get_tcp_force()\n    local force_vector_as_pose = p[force[0], force[1], force[2], 0, 0, 0]\n    local torque_vector_as_pose = p[force[3], force[4], force[5], 0, 0, 0]\n    local transformed_force_as_pose = pose_trans(pose_inv(target_pose), force_vector_as_pose)\n    local transformed_torque_as_pose = pose_trans(pose_inv(target_pose), torque_vector_as_pose)\n    return [transformed_force_as_pose[0], transformed_force_as_pose[1], transformed_force_as_pose[2], transformed_torque_as_pose[0], transformed_torque_as_pose[1], transformed_torque_as_pose[2]]\nend\n###\n# See documentation for @link:get_tcp_wrench_in_frame()\n# @return forces and torques measured in TCP frame\n###\ndef get_tcp_wrench():\n    return get_tcp_wrench_in_frame(get_target_tcp_pose())\nend\n###\n# Projects the measured TCP force along the axis given\n# @param axis array 3D vector\n###\ndef project_tcp_force(axis):\n    local wrench = get_tcp_wrench()\n    local force = [wrench[0], wrench[1], wrench[2]]\n    return dot(force, axis)\nend\n# End of Forces\n# Start of Math\n# Definitions of constants\nglobal PI = acos(-1)\n###\n# Calculates the cross product between to 3D vectors\n# @param v1 array 3D vector\n# @param v2 array 3D vector\n###\ndef cross(v1, v2):\n    if length(v1) != length(v2):\n        popup(str_cat(\"For computing the cross product, the two vectors must have the same length. Provided lengths: \", [length(v1), length(v2)]), error=True, blocking=True)\n        return -1\n    end\n    if length(v1) != 3:\n        popup(str_cat(\"For computing the cross product, the two vectors must have length 3. Provided lengths: \", [length(v1), length(v2)]), error=True, blocking=True)\n        return -1\n    end\n    local cross = [0.0, 0.0, 0.0]\n    local i = 0\n    while i < 3:\n        local j = (i + 1) % 3 # The next index in a cyclic order\n        local k = (i + 2) % 3 # The next next index in a cyclic order\n        cross[i] = v1[j] * v2[k] - v1[k] * v2[j]\n        i = i + 1\n    end\n    return cross\nend\n###\n# Calculates the dot product between to n-dimensional vectors\n# @param v1 array nD vector\n# @param v2 array nD vector\n###\ndef dot(v1, v2):\n    if length(v1) != length(v2):\n        popup(str_cat(\"For computing the dot product, the two vectors must have the same length. Provided lengths: \", [length(v1), length(v2)]), error=True, blocking=True)\n        return -1\n    end\n    local result = 0\n    local i = 0\n    while i < length(v1):\n        result = result + (v1[i] * v2[i])\n        i = i + 1\n    end\n    return result\nend\n###\n# Return the larger number of a and b\n# @param a number a\n# @param b number b\n###\ndef max(a, b):\n    if a > b:\n        return a\n    end\n    return b\nend\n###\n# Find the maximum value in a list. The list must be of non-zero length and contain numbers\n# @param list array list\n###\ndef list_max(list):\n    local length = get_list_length(list)\n    if  length == 0:\n        popup(\"Getting the maximum of an empty list is impossible in list_max().\", error = True, blocking = True)\n        halt\n    end\n    local i = 0\n    local max = list[0]\n    while i < length:\n        if list[i] > max:\n            max = list[i]\n        end\n        i = i + 1\n        sync_at_multiple(i, 30)\n    end\n    return max\nend\ndef sync_at_multiple(i, n):\n    local tmp = i / n\n    if tmp == floor(tmp):\n        sync()\n    end\nend\n# End of Math\n# Start of Move Helper\nur_move_until_force_distance = 0.1\nur_move_until_force_direction = [0, 0, 1]\nur_move_until_force_velocity = 0.1\nur_move_until_force_acceleration = 0.2\ndef ur_move_tcp_direction(distance, direction, velocity, acceleration, blend_radius):\n    local current_pose = get_target_tcp_pose()\n    local movement = normalize(direction) * distance\n    local target_pose = pose_trans(current_pose, p[movement[0], movement[1], movement[2], 0, 0, 0])\n    movel(target_pose, a = 0.2, v = velocity, r = blend_radius)\nend\nthread ur_move_until_force_thread():\n    ur_move_tcp_direction(ur_move_until_force_distance, ur_move_until_force_direction, ur_move_until_force_velocity, ur_move_until_force_acceleration, 0)\n    popup(\"No contact detected.\", title = \"No Contact\", warning = False, error = True, blocking = False)\n    halt\nend\n###\n# Moves the robot in the TCP direction specified until a contact point is reached *or*\n# the robot reaches the maximum distance allowed specified by the distance parameter.\n# @param distance number The maximum distance the robot is allowed to travel in the direction specified\n# @param direction array 3D vector determining the move direction of the TCP\n# @param velocity number Velocity of the robot\n# @param acceleration number Acceleration of the robot\n# @param stop_force number Maximum search radius\n###\ndef ur_move_until_force(distance = 0.1, direction = [0, 0, 1], velocity = 0.1, acceleration = 0.2, stop_force = 20):\n    ur_move_until_force_distance = distance\n    ur_move_until_force_direction = direction\n    ur_move_until_force_velocity = velocity\n    ur_move_until_force_acceleration = acceleration\n    \n    thrd = run ur_move_until_force_thread()\n    while - project_tcp_force(direction) < stop_force:\n        sync()\n    end\n    kill thrd\n    local actual_pose = get_actual_tcp_pose()\n    stopl(1.0)\n    return actual_pose\nend\ndef ur_get_joint_speeds_before_offset(previous_q, time):\n    local current_q = get_joint_positions()\n    local delta_q = current_q - previous_q\n    return delta_q / time\nend\ndef ur_path_move(end_q, v, rampdown=False):\n    # Calculate distance to target\n    local start_q = get_joint_positions()\n    local delta_q = end_q - start_q\n    local positive_delta_q = [norm(delta_q[0]), norm(delta_q[1]), norm(delta_q[2]), norm(delta_q[3]), norm(delta_q[4]), norm(delta_q[5])]\n    # Calculate time to move based on desired velocity\n    local t = list_max(positive_delta_q) / v\n    servoj(end_q , 0, 0, t, lookahead_time=0.1, gain=500)\n    if(rampdown):\n        while(norm(ur_get_joint_speeds_before_offset(start_q, t)) > 0.0001):\n            t = max(t, 0.001)\n            start_q = get_joint_positions()\n            servoj(end_q , 0, 0, t)\n        end\n    end\nend\n# End of Move Helper\nmyurRPC = rpc_factory(\"xmlrpc\",\"http://servicegateway/universal-robots/urconnect/urconnect-telemetry/xmlrpc/\")\n# Waypoint variable for Home smart skill\nglobal Home = struct(p=p[0.0007234911264933834, -0.2333977082004337, 1.0803476302965433, -0.0030465488234298825, 2.219299153348662, -2.220820782887323], frame=\"base\", q=[0, -1.5707963249999999, 0, -1.5707963249999999, 0, 0])\n# Start of Align to Plane\n###\n# Align to plane will touch up a plane by moving the robot into contact with the table or part in several locations to determine its orientation. Afterwards the robot will orient its tool to the plane.\n# @param radius number Radius [m] of the circle within the plane will be touched up\n# @param push_force number How hard to robot pushed against the plane\n# @param n_plane_points number Number of points that the robot uses to compute the plane\n# @param max_distance number Maximum distance that the robot searches\n# @param velocity_slow number Velocity when pressing downwards\n# @param velocity_search number Velocity used when approaching the touch up point\n# @param velocity_move number Velocity used in freespace\n# @param acceleration number Acceleration of the robot\n# @param direction array 3D vector determining the direction of the TCP for touching up the plane\n###\ndef ur_align_to_plane(radius = 0.05, push_force = 20, n_plane_points = 3, max_distance = 0.25, velocity_slow = 0.001, velocity_search = 0.035, velocity_move = 0.10, acceleration = 0.1, direction = [0, 0, 1]):\n    local angle = 2 * PI / n_plane_points\n    local start_pos = get_target_tcp_pose()\n    local retract_distance = -0.015\n    ur_move_tcp_direction(retract_distance, direction, velocity_move, acceleration, 0)\n    sleep(0.25)\n    zero_ftsensor()\n    local cnt = 0\n    local t_base_target = get_target_tcp_pose()\n    local mean_point = [0.0, 0.0, 0.0]\n    local A = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]\n    local b = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]\n    while cnt < n_plane_points:\n        local new_pos = pose_trans(t_base_target, p[cos(angle * cnt) * radius, sin(angle * cnt) * radius, 0.0, 0.0, 0.0, 0.0])\n        local blend_radius = norm(point_dist(get_actual_tcp_pose(), new_pos))/5\n        movel(new_pos, a = acceleration, v = velocity_move, r = blend_radius)\n        ur_move_until_force(max_distance + norm(retract_distance), direction, velocity_search, acceleration, push_force)\n        local movement = normalize(direction * -1) * 0.0005\n        local target_pose = pose_trans(get_actual_tcp_pose(), p[movement[0], movement[1], movement[2], 0, 0, 0])\n        movel(target_pose)\n        sleep(0.2)\n        ur_move_until_force(max_distance + norm(retract_distance), direction, velocity_slow, acceleration, push_force)\n        sleep(0.2)\n        while (not is_steady()):\n            sync()\n        end\n        local poked_point = get_target_tcp_pose()\n        poked_point = pose_trans(inv(t_base_target), poked_point)\n        A[cnt, 0] = poked_point[0]\n        A[cnt, 1] = poked_point[1]\n        A[cnt, 2] = 1.0\n        b[cnt] = poked_point[2]\n        mean_point = mean_point + [poked_point[0], poked_point[1], poked_point[2]]\n        movel(new_pos, a = 0.2, v = velocity_move, r = blend_radius)\n        cnt = cnt + 1\n    end\n    mean_point = mean_point / n_plane_points\n    cnt = 0\n    while cnt < n_plane_points:\n        local cntj = 0\n        while cntj < 2:\n            A[cnt, cntj] = A[cnt, cntj] - mean_point[cntj]\n            cntj = cntj + 1\n        end\n        b[cnt] = b[cnt] - mean_point[2]\n        cnt = cnt + 1\n    end\n    local x1 = inv(transpose(A) * A) * transpose(A) * b\n    local x = normalize([x1[0], x1[1], -1])\n    local d = dot(mean_point, x)\n    local dval = dot(direction, x)\n    if dval < 0:\n        x = -x\n        dval = -dval\n    end\n    local eaa = [0.0, 0.0, 0.0]\n    local EPSILON = 1e-10\n    if norm(dval - 1) < EPSILON:\n        # if the projection is close to 1 then the angle between the vectors are almost 0 and we cannot\n        # reliably determine the perpendicular axis.\n        # A good approximation is therefore just to set the EAA equal to 0.\n        eaa = [0.0, 0.0, 0.0]\n    else:\n        local axis = cross(direction, x)\n        local eaa = normalize(axis) * acos(dval)\n    end\n    local t_base_target_aligned = pose_trans(t_base_target, p[0, 0, 0, eaa[0], eaa[1], eaa[2]])\n    movel(t_base_target_aligned, a = 0.2, v = velocity_move)\nend\n# End of Align to Plane\n# Start of Align Z to Nearest Axis\n###\n# Aligns the TCP Z axis to the nearest axis of the given frame\n# @param frame_id string frame_id to lookup frame\n###\ndef ur_align_z_to_nearest_axis(frame_id = \"world\"):\n    ###\n    # Given a reference frame as input this function returns a struct with the nearest\n    # pose which aligns the z-axis of the robot TCP with the z-axis of the given reference frame.\n    # The pose is in the reference of the given frame.\n    # @param frame bool frame\n    # @returns struct pose, distance, referencePose\n    ###\n    def get_aligned_z_pose(frame):\n        local actualPose = get_actual_tcp_pose()\n        local actualPoseInFrame = pose_trans(pose_inv(frame), actualPose)\n        # Create rotation vector and convert that to RPY representation\n        local actualRotInFrame = [actualPoseInFrame[3], actualPoseInFrame[4], actualPoseInFrame[5]]\n        local actRPY = rotvec2rpy(actualRotInFrame)\n        # Set RX and RY to 0 and convert back to rotation vector\n        local alignedRot = rpy2rotvec([0, 0, actRPY[2]])\n        local alignedRotFlipped = rpy2rotvec([PI, 0, actRPY[2]])\n        local zUpPose = actualPoseInFrame\n        zUpPose[3] = alignedRot[0]\n        zUpPose[4] = alignedRot[1]\n        zUpPose[5] = alignedRot[2]\n        zUpStruct = struct(pose = zUpPose, distance=pose_dist(actualPoseInFrame, zUpPose), referencePose=frame)\n        local zDownPose = actualPoseInFrame\n        zDownPose[3] = alignedRotFlipped[0]\n        zDownPose[4] = alignedRotFlipped[1]\n        zDownPose[5] = alignedRotFlipped[2]\n        local zDownStruct = struct(pose = zDownPose, distance=pose_dist(actualPoseInFrame, zDownPose), referencePose=frame)\n        # Return the solution which is closer to the current robot pose\n        if (zDownStruct.distance > zUpStruct.distance):\n            return zUpStruct\n        else:\n            return zDownStruct\n        end\n    end\n    local frame = get_pose(frame_id)\n    # Rotate the given frame so that Z can be align to X-Y-Z respectively \n    local rotZtoX = rpy2rotvec([0,0.5*PI,0])\n    local rotZtoY = rpy2rotvec([0.5*PI,0,0])\n    local rotZtoZ = rpy2rotvec([0,0,0])\n    # Get aligned poses for each of the rotated frames\n    local structAlignedToX = get_aligned_z_pose(pose_trans(frame, p[0,0,0,rotZtoX[0],rotZtoX[1],rotZtoX[2]]))\n    structAlignedToY = get_aligned_z_pose(pose_trans(frame, p[0,0,0,rotZtoY[0],rotZtoY[1],rotZtoY[2]]))\n    structAlignedToZ = get_aligned_z_pose(pose_trans(frame, p[0,0,0,rotZtoZ[0],rotZtoZ[1],rotZtoZ[2]]))\n    # Find the nearest alignement\n    local structAligned = structAlignedToZ\n    if(structAligned.distance > structAlignedToX.distance):\n        structAligned = structAlignedToX    \n    end\n    if(structAligned.distance > structAlignedToY.distance):\n        structAligned = structAlignedToY    \n    end\n    # Move the robot to the aligned pose\n    movel(pose_trans(get_actual_tcp_pose(), p[0,0,0.00001,0,0,0]), v = 0.1)\n    movel(pose_trans(structAligned.referencePose, structAligned.pose ), v = 0.1)\nend\n# End of Align Z to Nearest Axis\n# Start of Center to Object\n###\n# Centers to an object by touching the externals of it. It works well for fixtured or heavy parts.\n# @param push_force number Force the robot uses to determine if a contact has been achieved\n# @param velocity_move number Velocity in freespace\n# @param velocity_search number First move is used then search\n# @param acc_move number Acceleration in freespace\n# @param max_radius_search number Maximum search radius\n# @param num_fingers number Number of fingers that the gripper has\n###\ndef ur_center_to_object(push_force = 10, velocity_move = 0.10, velocity_search = 0.01, acc_move = 0.2, max_radius_search = 0.05, num_fingers = 3):\n    def compute_circle_center(p_list):\n        # Compute the circle center by circular regression\n        # Source: https://math.stackexchange.com/questions/2898295/how-to-quickly-fit-a-circle-by-given-random-arc-points\n        local itr = 0\n        local x = 0\n        local y = 1\n    \n        local m1 = [[0,0,0],[0,0,0],[0,0,0]]\n        local m2 = [[0,0],[0,0],[0,0]]\n        local m3 = [[0],[0],[0]]\n    \n        while(itr < get_list_length(p_list)):\n            local p = p_list[itr]\n    \n            if(p_list[itr] == p[0,0,0,0,0,0]):\n                break\n            end\n    \n            m1[0,0] = m1[0,0] + (p[x]*p[x])\n            m1[0,1] = m1[0,1] + (p[x]*p[y])\n            m1[0,2] = m1[0,2] + (p[x])\n    \n            m1[1,0] = m1[1,0] + (p[x]*p[y])\n            m1[1,1] = m1[1,1] + (p[y]*p[y])\n            m1[1,2] = m1[1,2] + (p[y])\n    \n            m1[2,0] = m1[2,0] + (p[x])\n            m1[2,1] = m1[2,1] + (p[y])\n    \n            m2[0,0] = m2[0,0] + (pow(p[x], 3))\n            m2[0,1] = m2[0,1] + (p[x] * pow(p[y], 2))\n    \n            m2[1,0] = m2[1,0] + (pow(p[y], 3))\n            m2[1,1] = m2[1,1] + (pow(p[x], 2) * p[y])\n    \n            m2[2,0] = m2[2,0] + (pow(p[x], 2))\n            m2[2,1] = m2[2,1] + (pow(p[y], 2))\n    \n            itr = itr +1\n        end\n    \n        if(itr < 2):\n            return p[0,0,0,0,0,0]\n        elif(itr > get_list_length(p_list)):\n            return p[0,0,0,0,0,0]\n        end\n    \n        m1[0,0] = 2 * m1[0,0]\n        m1[0,1] = 2 * m1[0,1]\n        m1[1,0] = 2 * m1[1,0]\n        m1[1,1] = 2 * m1[1,1]\n        m1[2,0] = 2 * m1[2,0]\n        m1[2,1] = 2 * m1[2,1]\n        m1[2,2] = itr\n        m3[0,0] = m2[0,0] + m2[0,1]\n        m3[1,0] = m2[1,0] + m2[1,1]\n        m3[2,0] = m2[2,0] + m2[2,1]\n    \n        local center = inv(m1) * m3\n    \n        return p[center[0,0], center[1,0],0,0,0,0]\n    end\n    \n    def sanity_checked_move(p_org, p_new, max_diff, acc, vel):\n        if (pose_dist(p_org, p_new) > max_diff):\n            movel(p_org, a = acc, v = vel)\n            popup(\"New pose is too far away from original. Returning to original\", title = \"Failed\", warning = False, error = True, blocking = True)\n        else:\n            movel(p_new, a = acc, v = vel)\n        end\n    end\n    # Start by zeroing the FT sensor\n    sleep(0.25)\n    zero_ftsensor()\n    local p_start = get_actual_tcp_pose()\n    local p0 = p[0,0,0,0,0,0]\n    local DIR_X = [1, 0, 0]\n    if (num_fingers == 2):\n        local dir_list = [DIR_X, -DIR_X, DIR_X, -DIR_X]\n        local start_offset = [p[0,0,0,0,0,0], p[0,0,0,0,0,0], p[0,0,0,0,0,0.35], p[0,0,0,0,0,0.35]]\n        local p_list = [p0, p0, p0, p0]\n    elif (num_fingers == 3):\n        local DIR_P1 = DIR_X\n        local DIR_P2 = [-1 / 2, sqrt(3.0) / 2.0, 0]\n        local DIR_P3 = [-1 / 2, -sqrt(3.0) / 2.0, 0]\n        local dir_list = [DIR_P1, DIR_P2, DIR_P3, DIR_P1, DIR_P2, DIR_P3]\n        local start_offset = [p[0,0,0,0,0,0], p[0,0,0,0,0,0], p[0,0,0,0,0,0], p[0,0,0,0,0,0.35], p[0,0,0,0,0,0.35], p[0,0,0,0,0,0.35]]\n        local p_list = [p0, p0, p0, p0, p0, p0]\n    else:\n        popup(\"Number of fingers not supported\")\n        halt\n    end\n    # Loop through directions\n    local it = 0\n    local dir_list_size = size(dir_list)\n    local dir_list_length = dir_list_size[0]\n    while(it < dir_list_length):\n        # Move to starting position if more than 3 positions is stored then calculate a new starting position\n        if(it < 3):\n            movel(pose_trans(p_start, start_offset[it]), a = acc_move, v = velocity_move)\n        else:\n            local p_start_temp = pose_trans(pose_trans(p_start, compute_circle_center(p_list)), start_offset[it])\n            local p_start_w_offset = pose_trans(p_start, start_offset[it])\n            sanity_checked_move(p_start_w_offset, p_start_temp, max_radius_search, acc_move, velocity_move)\n        end\n        local p_start_temp = get_actual_tcp_pose()\n        # Move into contact and store contact point\n        sleep(0.1)\n        local contact_point = ur_move_until_force(distance = max_radius_search, direction = [dir_list[it, 0], dir_list[it, 1], dir_list[it, 2]], velocity = velocity_search, acceleration = acc_move, stop_force = push_force)\n        \n        local dir = [dir_list[it, 0], dir_list[it, 1], dir_list[it, 2]]\n        dir = normalize(dir) * 0.05\n        contact_point = pose_trans(contact_point, p[dir[0], dir[1], dir[2], 0, 0, 0])\n        p_list[it] = pose_trans(pose_inv(p_start), contact_point)\n        # Move out of contact\n        movel(p_start_temp, a = acc_move, v = velocity_move)\n        it = it + 1\n    end\n    # Find circle center based on n stored  points\n    local center_offset_xy = compute_circle_center(p_list)\n    local p_center = pose_trans(p_start, center_offset_xy)\n    \n    # Move the robot to the center if it can\n    sanity_checked_move(p_start, p_center, max_radius_search, acc_move, velocity_move)\nend\n# End of Center to Object\n# Start of Move Into Contact\n###\n# Moves the robot into contact in the TCP direction set\n# @param force number Force that determines when a contact has been achieved\n# @param velocity number Velocity of the robot\n# @param acceleration number Acceleration of the robot\n# @param max_distance number Maximum distance that the robot searches\n# @param velocity_search number velocity_search\n# @param retract number Retract distance after a contact has been found\n# @param move_tcp_dir array TCP direction (3D vector)\n# @param zero_ft_on_start bool Determines if the force-torque sensor should be zeroed on start\n###\ndef ur_move_into_contact(force = 10, velocity = 0.05, acceleration = 0.1, max_distance = 0.25, retract = 0.0, move_tcp_dir = [0, 0, 1], zero_ft_on_start = True):\n    # Zero the force torque sensor\n    if (zero_ft_on_start):\n        sleep(0.25)\n        zero_ftsensor()\n    end\n    # Move the robot\n    ur_move_until_force(max_distance, move_tcp_dir, velocity, acceleration, force)\n    # If a retract distance is set, move the robot back to that position\n    if (retract != 0):\n        # Compute position offset from TCP direction and retract distance\n        local position = normalize(move_tcp_dir) * retract\n        movel(pose_trans(get_actual_tcp_pose(), p[position[0], position[1], position[2], 0, 0, 0]))\n    end\nend\n# End of Move Into Contact\n# Start of Retract\n###\n# Retract in the TCP direction set\n# @param distance number Retraction distance\n# @param direction array TCP direction to move in (3D vector)\n# @param acceleration number Acceleration used by the robot\n# @param velocity number Velocity used by the robot\n###\ndef ur_retract(distance = -0.1, direction = [0, 0, 1], acceleration = 0.4, velocity = 0.1):\n    local movement = normalize(direction) * distance\n    movel(pose_trans(get_actual_tcp_pose(), p[movement[0], movement[1], movement[2], 0, 0, 0]), a = acceleration, v = velocity)\nend\n# End of Retract","nodeIDList":[]}},"program":{"id":"1","programContent":{"guid":"5348248a-75f6-e59b-38e8-80928a3050b2","contributedNode":{"type":"ur-program","version":"0.0.3","allowsChildren":true,"lockChildren":true,"parameters":{"name":"background_gp_reg_10_13","symbolHistory":{"variables":[{"name":"base","valueType":"frame","reference":{"id":"583d3a7d-b103-aff9-502d-73d459fc2a0e","_IDENTIFIER":"VariableReference"}},{"name":"tcp","valueType":"frame","reference":{"id":"1debc310-2146-1b93-ebf3-6e257bfdd2da","_IDENTIFIER":"VariableReference"}},{"name":"world","valueType":"frame","reference":{"id":"ddca5ccc-8f81-8461-2a8f-935321f2bf01","_IDENTIFIER":"VariableReference"}},{"name":"flange","valueType":"frame","reference":{"id":"a284652e-3e38-9434-2e20-eae9dd10bd79","_IDENTIFIER":"VariableReference"}},{"name":"grid","valueType":"grid","reference":{"id":"af733917-cce3-4b11-fb24-7e6677ff572e","_IDENTIFIER":"VariableReference"}},{"name":"grid_iterator","valueType":"waypoint","reference":{"id":"68ebd02e-0a2d-ad92-c6de-c677a19dddf0","_IDENTIFIER":"VariableReference"}},{"name":"Joint_fast","valueType":"profile","reference":{"id":"66cc9640-9626-20a9-b6be-e75938fdf603","_IDENTIFIER":"VariableReference"}},{"name":"Joint_slow","valueType":"profile","reference":{"id":"0e781f7a-4120-999b-9eb9-c25c1dc8d0c8","_IDENTIFIER":"VariableReference"}},{"name":"Linear_fast","valueType":"profile","reference":{"id":"2faf9dcd-a026-b177-e610-2044e80f9d1a","_IDENTIFIER":"VariableReference"}},{"name":"Linear_slow","valueType":"profile","reference":{"id":"f9fc918f-21e5-f43d-8029-5ab979f2ce28","_IDENTIFIER":"VariableReference"}},{"name":"Process","valueType":"profile","reference":{"id":"854474bd-bfb7-9f87-49da-48a03f2d574c","_IDENTIFIER":"VariableReference"}},{"name":"Home","valueType":"waypoint","reference":{"id":"7622345a-0e52-2cf8-0ff6-3a6568b1e03a","_IDENTIFIER":"VariableReference"}},{"name":"item_counter","valueType":"integer","reference":{"id":"c3a49a83-3bb9-b10e-054d-ad17b7c54c0a","_IDENTIFIER":"VariableReference"}}],"functions":[],"modules":[{"name":"application","reference":{"id":"application-module-id","_IDENTIFIER":"ModuleReference"}}]}}},"children":[{"children":[],"contributedNode":{"type":"ur-modules","version":"0.0.1","allowsChildren":true,"lockChildren":false},"guid":"54ec4a31-9cf9-e4c6-b6d3-9b08eedb3620","parentId":"5348248a-75f6-e59b-38e8-80928a3050b2"},{"children":[],"contributedNode":{"type":"ur-functions","version":"0.0.1","allowsChildren":true,"lockChildren":false},"guid":"11d96cee-6a0a-c3b6-7987-22d900355add","parentId":"5348248a-75f6-e59b-38e8-80928a3050b2"},{"children":[],"contributedNode":{"type":"ur-before-start","version":"0.0.1","allowsChildren":true},"guid":"c83522bf-2cb2-82e2-7efb-4a95d3c81365","parentId":"5348248a-75f6-e59b-38e8-80928a3050b2"},{"children":[],"contributedNode":{"type":"ur-configuration","version":"0.0.1","allowsChildren":true,"parameters":{}},"guid":"e9a36f1a-e1b8-ed03-dc7b-bad7cabf2ff8","parentId":"5348248a-75f6-e59b-38e8-80928a3050b2"},{"children":[],"contributedNode":{"type":"ur-status","version":"0.0.1","allowsChildren":true,"parameters":{}},"guid":"5506de25-ec0b-1e4d-ca9c-ad5d7ab2a336","parentId":"5348248a-75f6-e59b-38e8-80928a3050b2"},{"children":[],"contributedNode":{"type":"ur-code","version":"0.0.1","allowsChildren":true,"lockChildren":false,"parameters":{"loopForever":false}},"guid":"46b24065-4157-ee70-ca87-cbed43231cf0","parentId":"5348248a-75f6-e59b-38e8-80928a3050b2"}]},"programInformation":{"name":"background_gp_reg_10_14","description":"Example showing how to get read gp registers in background.","createdDate":1783503389894,"lastSavedDate":1783515245556,"lastModifiedDate":null,"programState":"FINAL","functionsBlockShown":false},"urscript":{"script":"","nodeIDList":[]}}}