{"id":13737194,"url":"https://github.com/roboticsleeds/ur5controller","last_synced_at":"2025-05-08T13:33:18.916Z","repository":{"id":65256169,"uuid":"109990655","full_name":"roboticsleeds/ur5controller","owner":"roboticsleeds","description":"OpenRAVE Controller Plugin for UR5 (Universal Robots UR5) Robot","archived":false,"fork":false,"pushed_at":"2020-06-22T09:36:33.000Z","size":5909,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-04T03:08:25.605Z","etag":null,"topics":["openrave","openrave-conroller","plugin","robotics","ros","ur5","ur5-robot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roboticsleeds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T15:03:03.000Z","updated_at":"2024-06-13T04:54:29.000Z","dependencies_parsed_at":"2023-01-16T15:00:32.514Z","dependency_job_id":null,"html_url":"https://github.com/roboticsleeds/ur5controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticsleeds%2Fur5controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticsleeds%2Fur5controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticsleeds%2Fur5controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboticsleeds%2Fur5controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roboticsleeds","download_url":"https://codeload.github.com/roboticsleeds/ur5controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224737431,"owners_count":17361345,"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":["openrave","openrave-conroller","plugin","robotics","ros","ur5","ur5-robot"],"created_at":"2024-08-03T03:01:37.244Z","updated_at":"2025-05-08T13:33:18.908Z","avatar_url":"https://github.com/roboticsleeds.png","language":"Python","readme":"# UR5 Controller for OpenRAVE\n\n\u003cp float=\"left\"\u003e\n    \u003cimg src=\"repo_assets/ridgeback_ur5_fts150_gripper.png\" width=\"250\" /\u003e \n    \u003cimg src=\"repo_assets/ridgeback_ur5_gripper.png\" width=\"250\" /\u003e \n    \u003cimg src=\"repo_assets/ridgeback_ur5.png\" width=\"250\" /\u003e\n\u003c/p\u003e\n\nCurrently we support different models (we only provide controllers for the UR5 and the two-finger gripper in this project):\n- Clearpath Ridgeback + UR5 + Force Torque Sensor 150 + RobotiQ Two Finger Gripper\n- Clearpath Ridgeback + UR5 + RobotiQ Two Finger Gripper\n- Clearpath Ridgeback + UR5\n\nThis controller will listen to ROS topic that publishes the joint values of the \nUR5 robot in real time and will visualise the current state of a UR5 robot in OpenRAVE.\n\nAnother important functionality of this plugin is that is able to execute trajectories \ngenerated by OpenRAVE planners on the real robot.\n\nThere is a test program that demonstrates this functionality under \n[`scripts/control_ur5`](scripts/control_ur5.py) in which case will load UR5 in \nOpenRAVE and then let you control the UR5 robot above a table (move left, right, \nforward, backwards and rotate the gripper clockwise and anti-clockwise).\n\n## 1. Developers and Contributors\nUR5 OpenRAVE controller was developed by the [Robot Manipulation Lab](https://artificial-intelligence.leeds.ac.uk/robot-manipulation/) in the School of Computing at the University of Leeds.\n- Author: [Rafael Papallas](http://rpapallas.com).\n- Current maintainor: [Rafael Papallas](http://rpapallas.com).\n\n## 2. License\nUR5 OpenRAVE controller is licensed under GNU General Public License v3.0. The full license is available [here](https://github.com/roboticsleeds/ur5controller/blob/master/LICENSE). \n\n## 3. Includes\nThis repository includes the following:\n- The custom written controller for OpenRAVE and UR5 robot.\n- The URDF and SRDF files for UR5 itself, Robotiq Two-Finger Gripper, and \nClearpath Ridgeback moving base.\n\n## 4. Installation\n\nYou can either get this controller using a Singularity container or by building the controller as a catkin package on your host machine. The advantage of using a singularity container over building it on your host machine is that you can have a different Ubuntu and ROS version on your host machine and have UR5 Controller within a singularity container that runs Ubuntu 14.04 and ROS Indigo. For example you can have a host machine with Ubuntu 18.04 and run UR5 Controller with the Singularity container. \n\n\u003cdetails\u003e\n\u003csummary\u003eUsing Singularity container\u003c/summary\u003e\n\u003c/br\u003e\nThe easiest way to get up and running with this controller is to use our Singularity container. \n\n1. Install Singularity on your machine by following [this](https://www.sylabs.io/guides/3.0/user-guide/quick_start.html#quick-installation-steps).\n2. Then, follow the instructions from [here](https://github.com/roboticsleeds/ur5controller_singularity).\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eBuilt from source on your own machine\u003c/summary\u003e\n\u003c/br\u003e\nIf you wish to build this control on your host machine, you can find the instructions below.\n\n#### Dependencies\n- [ur_modern_driver](https://github.com/ThomasTimm/ur_modern_driver) needs to be installed on the computer that controls the robot and you need to run `roslaunch ur_modern_driver ur5_bringup.launch robot_ip:=THE_IP_OF_UR5_ROBOT`.\n- You need to install the [openrave_catkin](https://github.com/personalrobotics/openrave_catkin).\n- You need to install and configure another OpenRAVE plugin called `or_urdf` this plugin is available [here](https://github.com/personalrobotics/or_urdf). I have written a small guide on \nhow to install this plugin if you struggle to find a solution, find the tutorial [here](https://gist.github.com/rpapallas/171cad0e881769647d0851b8780cc545).\n- **(OPTIONAL)** Install the Robotiq controller.\n  1. `cd ~/catkin_ws/src`\n  2. `git clone git@github.com:ros-industrial/robotiq.git`\n  3. `cd robotiq`\n  4. `git checkout indigo-devel`\n  5. `rosdep install robotiq_modbus_tcp`\n  6. `sudo apt-get install ros-indigo-soem`\n  7. `cd ~/catkin_ws`\n  8. `catkin_make`\n\n#### Installation\n- Go to your catkin worksapce e.g `cd ~/catkin_ws/src` and clone this repository: `git clone git@github.com:roboticsleeds/ur5controller.git`\n- Add the following line in your `~/.bashrc` file located under your home \ndirectory by running the following command in the terminal: `echo \n'export OPENRAVE_PLUGINS=$OPENRAVE_PLUGINS:~/catkin_ws/devel/share/openrave-0.9/plugins' \u003e\u003e ~/.bashrc`\n- Run `source ~/.bashrc`.\n- Go to your catkin workspace `cd ~/catkin_ws` and run `catkin_make`. You should \nsee a successful message on build in which case you are ready to go. If you get \nany errors at this stage, please review what went wrong.\n- Add in your `.bashrc` the Python path to the UR5 class by running \n```bash\necho 'export PYTHONPATH=$PYTHONPATH:~/catkin_ws/src/ur5controller/pythonsrc/ur5_robot' \u003e\u003e ~/.bashrc`\n```\nThis will let Python know where the Python classes for \ncreating UR5 robot instances in OpenRAVE are.\n\u003c/details\u003e\n\n## 5. Testing the controller\nThere is a file called `control_ur5.py` under `scripts` that you can run and \ntest the controller on the real robot.\n\nWith the Python class in place, creating a UR5 robot in OpenRAVE is super easy:\n\n\u003cdetails\u003e\n\u003csummary\u003eShow code\u003c/summary\u003e\n\u003c/br\u003e\n\n```python\nimport IPython\nfrom ur5_factory import UR5_Factory\nur5_factory = UR5_Factory()\n\n# If you want to specify all the configuration settings (is_simulation, has_ridgeback etc)\nenv, robot = ur5_factory.create_ur5_and_env(is_simulation=True,\n                                            has_ridgeback=True,\n                                            gripper_name=\"robotiq_two_finger\",\n                                            has_force_torque_sensor=True,\n                                            env_path=\"test_env.xml\",\n                                            viewer_name=\"qtcoin\",\n                                            urdf_path=\"package://ur5controller/ur5_description/urdf/\",\n                                            srdf_path=\"package://ur5controller/ur5_description/srdf/\")\n\n# The above is equivalent to the following (the `create_ur5_and_env` has set to defaults the values used above):\nenv, robot = ur5_factory.create_ur5_and_env()\nIPython.embed()\n```\n\nIf you would like to use the model with no gripper, then you need to pass `None` to the `gripper_name` argument.\n\u003c/details\u003e\n\n## 6. Controller explained\n1. Load the robot in OpenRAVE using the URDF plugin:\n\n\u003cdetails\u003e\n\u003csummary\u003eShow code\u003c/summary\u003e\n\u003c/br\u003e\n\n```python\nimport IPython\n\nenv = Environment()\nenv.Load('test_env.xml')\nenv.SetViewer('qtcoin')\n\nurdf_path = \"package://ur5controller/ur5_description/ur5.urdf\"\nsrdf_path = \"package://ur5controller/ur5_description/ur5.srdf\"\n\nmodule = RaveCreateModule(env, 'urdf')\nwith env:\n  name = module.SendCommand('LoadURI {} {}'.format(urdf_path, srdf_path))\n  robot = env.GetRobot(name)\n\nenv.Add(robot, True)\n```\n\n\u003c/details\u003e\n\n2. You now need to attach the controllers (UR5 and the Robotiq controllers) to\nthe robot using the `MultiController`.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow code\u003c/summary\u003e\n\u003c/br\u003e\n\n```python\nmulticontroller = RaveCreateMultiController(env, \"\")\nrobot.SetController(multicontroller)\n\nrobot_controller = RaveCreateController(env,'ur5controller')\nhand_controller = RaveCreateController(env, 'robotiqcontroller')\n\nmulticontroller.AttachController(robot_controller, [2, 1, 0, 4, 5, 6], 0)\nmulticontroller.AttachController(hand_controller, [3], 0)\n\nIPython.embed()\n```\n\nYou are now set. The OpenRAVE robot should update as you change the configuration\nof the actual robot, and should also execute trajectories from OpenRAVE to \nthe actual robot.\n\u003c/details\u003e\n\n## 7. Other Notes\n\u003cdetails\u003e\n\u003csummary\u003eChecking ROS topics for attaching controllers\u003c/summary\u003e\n\u003c/br\u003e\n\nThis package will check (in ur5_factory.py) if certain topics are being published\n(i.e `CModelRobotInput` and `CModelRobotOutput`) if you chose a gripper name \nequal to \"robotiq_two_finger_\" and will not attach the corresponding controller\nif those topics are not being published. This is a defensive mechanism to avoid\n`IsDone()` method of the end-effector gripper returning false and blocking the\nprogram execution. For more discussion, see [here](https://stackoverflow.com/questions/49552755/openrave-controllerbase-is-blocking-at-the-isdone-method-and-never-returns/49552756#49552756)\n\n\u003c/details\u003e\n    \n## 8. Troubleshooting\n\u003cdetails\u003e\n\u003csummary\u003eRuntimeError: maximum recursion depth exceeded while calling a Python object\u003c/summary\u003e\n\u003c/br\u003e\n\nIf you get this error while the IK are being generated, then you probably have a version of sympy \u003e 0.7.1. Downgrade your sympy version to 0.7.1:\n\n```\npip install --upgrade sympy==0.7.1\n```\n\nThis should fix this issue.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTypeError: argument of type 'Poly' is not iterable\u003c/summary\u003e\n\u003c/br\u003e\n\nIf you get this error while the IK are being generated, then you probably have a version of sympy \u003e 0.7.1. Downgrade your sympy version to 0.7.1:\n\n```\npip install --upgrade sympy==0.7.1\n```\n\nThis should fix this issue.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eExecuting the trajectory on the real robot causes unintended actions\u003c/summary\u003e\n\u003c/br\u003e\n\n**Issue:** While OpenRAVE generates a trajectory that is smooth and valid in simulation during real execution the robot is strangely executing the trajectory.\n\n**Possible solution:** We came across this issue and the problem is probably down to the UR modern driver. When UR modern driver is installed using `apt-get` the problem appeared. The solution was to install UR modern driver as a catkin package (make sure to checkout the branch `kinetic-devel` although is kinetic is also working with indigo).\n\n\u003c/details\u003e\n","funding_links":[],"categories":["Tools for Robotics","Robotics Tools and Frameworks"],"sub_categories":["In-memory data grids"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboticsleeds%2Fur5controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froboticsleeds%2Fur5controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboticsleeds%2Fur5controller/lists"}