{"id":13697556,"url":"https://github.com/SintefManufacturing/python-urx","last_synced_at":"2025-05-03T20:30:37.273Z","repository":{"id":7610537,"uuid":"8968745","full_name":"SintefManufacturing/python-urx","owner":"SintefManufacturing","description":"Python library to control a robot from 'Universal Robots' http://www.universal-robots.com/","archived":false,"fork":false,"pushed_at":"2024-05-10T12:06:10.000Z","size":214,"stargazers_count":556,"open_issues_count":78,"forks_count":279,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-05T00:03:52.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SintefManufacturing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-23T10:33:39.000Z","updated_at":"2025-04-04T14:16:46.000Z","dependencies_parsed_at":"2022-09-09T16:30:47.725Z","dependency_job_id":"544811bf-e7fb-42e4-9481-19ee9bf7b394","html_url":"https://github.com/SintefManufacturing/python-urx","commit_stats":{"total_commits":164,"total_committers":25,"mean_commits":6.56,"dds":0.6585365853658536,"last_synced_commit":"00211834e214b9f5838f94b94c3b1d34b42daa30"},"previous_names":["oroulet/python-urx"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SintefManufacturing%2Fpython-urx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SintefManufacturing%2Fpython-urx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SintefManufacturing%2Fpython-urx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SintefManufacturing%2Fpython-urx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SintefManufacturing","download_url":"https://codeload.github.com/SintefManufacturing/python-urx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252252491,"owners_count":21718749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:01:00.141Z","updated_at":"2025-05-03T20:30:33.326Z","avatar_url":"https://github.com/SintefManufacturing.png","language":"Python","readme":"urx is a python library to control the robots from [Universal Robots](https://www.universal-robots.com/). It is published under the LGPL license and comes with absolutely no guarantee.\n\nIt is meant as an easy to use module for pick and place operations, although it has been used for welding and other sensor based applications that do not require high control frequency.\n\nBoth the 'secondary port' interface and the real-time/matlab interface of the UR controller are used. urx can optionally use the [python-math3d](https://github.com/mortlind/pymath3d)(GPL) library to receive and send transformation matrices to the robot urx is known to work with all release robots from Universal Robot.\n\nurx was primarily developed by [Olivier Roulet-Dubonnet](https://github.com/oroulet) for [Sintef Raufoss Manufacturing](http://www.sintef.no/manufacturing/).\n\n\n\n# Install\n\nThe easiest is probably to use pip:\n```\npip install urx\n```\n\n\n# Example use:\n\n```python\nimport urx\n\nrob = urx.Robot(\"192.168.0.100\")\nrob.set_tcp((0, 0, 0.1, 0, 0, 0))\nrob.set_payload(2, (0, 0, 0.1))\nsleep(0.2)  #leave some time to robot to process the setup commands\nrob.movej((1, 2, 3, 4, 5, 6), a, v)\nrob.movel((x, y, z, rx, ry, rz), a, v)\nprint \"Current tool pose is: \",  rob.getl()\nrob.movel((0.1, 0, 0, 0, 0, 0), a, v, relative=true)  # move relative to current pose\nrob.translate((0.1, 0, 0), a, v)  #move tool and keep orientation\nrob.stopj(a)\n\nrob.movel(x, y, z, rx, ry, rz), wait=False)\nwhile True :\n    sleep(0.1)  #sleep first since the robot may not have processed the command yet\n    if rob.is_program_running():\n        break\n\nrob.movel(x, y, z, rx, ry, rz), wait=False)\nwhile rob.getForce() \u003c 50:\n    sleep(0.01)\n    if not rob.is_program_running():\n        break\nrob.stopl()\n\ntry:\n    rob.movel((0,0,0.1,0,0,0), relative=True)\nexcept RobotError, ex:\n    print(\"Robot could not execute move (emergency stop for example), do something\", ex)\n```\n\n# Development using Transform objects from math3d library:\n\n```python\nfrom urx import Robot\nimport math3d as m3d\n\nrobot = Robot(\"192.168.1.1\")\nmytcp = m3d.Transform()  # create a matrix for our tool tcp\nmytcp.pos.z = 0.18\nmytcp.orient.rotate_zb(pi/3)\nrobot.set_tcp(mytcp)\ntime.sleep(0.2)\n\n# get current pose, transform it and move robot to new pose\ntrans = robot.get_pose()  # get current transformation matrix (tool to base)\ntrans.pos.z += 0.3\ntrans.orient.rotate_yb(pi/2)\nrobot.set_pose(trans, acc=0.5, vel=0.2)  # apply the new pose\n\n\n#or only work with orientation part\no = robot.get_orientation()\no.rotate_yb(pi)\nrobot.set_orientation(o)\n```\n\n# Other interactive methods/properties\n\n```python\n\nfrom urx import Robot\nrob = Robot(\"192.168.1.1\")\nrob.x  # returns current x\nrob.rx  # returns 0 (could return x component of axis vector, but it is not very usefull\nrob.rx -= 0.1  # rotate tool around X axis\nrob.z_t += 0.01  # move robot in tool z axis for +1cm\n\ncsys = rob.new_csys_from_xpy() #  generate a new csys from 3 points: X, origin, Y\nrob.set_csys(csys)\n```\n\n\n# Robotiq Gripper\n\nurx can also control a Robotiq gripper attached to the UR robot.  The robotiq class was primarily developed by [Mark Silliman](https://github.com/markwsilliman).\n\n## Example use:\n\n```python\nimport sys\nimport urx\nfrom urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper\n\nif __name__ == '__main__':\n\trob = urx.Robot(\"192.168.0.100\")\n\trobotiqgrip = Robotiq_Two_Finger_Gripper()\n\n\tif(len(sys.argv) != 2):\n\t\tprint \"false\"\n\t\tsys.exit()\n\n\tif(sys.argv[1] == \"close\") :\n\t\trobotiqgrip.close_gripper()\n\tif(sys.argv[1] == \"open\") :\n\t\trobotiqgrip.open_gripper()\n\n\trob.send_program(robotiqgrip.ret_program_to_run())\n\n\trob.close()\n\tprint \"true\"\n\tsys.exit()\n```\n","funding_links":[],"categories":["Cobots","📚 فهرست"],"sub_categories":["رباتیک"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSintefManufacturing%2Fpython-urx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSintefManufacturing%2Fpython-urx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSintefManufacturing%2Fpython-urx/lists"}