Skip to content

Tutorial: Setting up and running the UR5 Robotic Arm

Minh-Khang Vu edited this page Mar 27, 2019 · 20 revisions

Prerequisites

This tutorials allows you to set up your environment to use the UR5 arm. It assumes that you have the following things already completed:

  • Using Ubuntu 16.04
  • ROS kinetic installed, catkin_ws set up and in use

Assuming you have the above ready to go, follow these steps:

Permissions

  1. Before anything else, if this is your time doing this, or if your computer has a new paritition of Ubuntu: Check if you're in the correct groups:
    sudo usermod -a -G dialout,tty $USER

If you completed step 0, then MAKE SURE TO LOG OUT and LOG BACK IN (one time thing), then continue the below steps:

Dependencies + Build

  1. Install UR packages
    sudo apt-get install ros-kinetic-universal-robot and sudo apt-get install ros-kinetic-ur-driver

  2. Install ros-industrial/ur_modern_driver and olinrobotics/universal_robot

  • Clone ur_modern_driver and universal_robot into your src folder in ROS workspace
  • Go back to the catkin_ws folder and catkin_make to install both packages

Connecting to the Arm

  1. Open reverse port 50001 for communication with robot. In a terminal:
sudo ufw disable
sudo ufw enable
sudo ufw allow 50001/tcp

Open another port 50002 if you want to control two robot arms

  1. Setup a custom wired network for the UR5 robot communication. This is located in the Wifi menu, go to Edit Connections, add the below information under IPv4 Settings
  • Edit Connections
  • Add
  • Ethernet
  • Name the connection something you'll remember
  • In IPv4, select Method > Shared with other computers
  • Save
  1. Connection to UR5 through direct ethernet connection

Running the Arm

  1. Launch connection
    roslaunch ur_bringup ur5_bringup.launch robot_ip:=IP_OF_THE_ROBOT [reverse_port:=REVERSE_PORT]

IP_OF_THE_ROBOT Check the arm's control panel to verify the robot IP.

REVERSE_PORT reverse port is the port you open in Step 3: either 50001 or 50002

Currently, the IPs are: 10.42.1.175 and 10.42.0.54

  1. Test command
    rosrun ur_driver test_move.py
    PLEASE MAKE SURE THE ARM IS CLEAR BEFORE MOVING

  2. Launch ROS topic

One robotic arm:

rosrun hiro ur5_arm_node.py robot_ip:=10.42.0.54
PLEASE MAKE SURE THE ARM IS CLEAR BEFORE MOVING
The arm can be controlled either by joint-based behavior through behaviors_cmd_%arm_name or by xyz coordinates through coordinates_cmd%arm_name For a complete example about how to control the arm, please reference this code.

UR5 Firmware Update

If you need to update UR5 firmware to work with the newest ROS packages, please follow the steps below:

  • Go to this website and download the newer version of the firmware: https://www.universal-robots.com/download/?option=16460#section16459

  • Then, copy the downloaded file to a USB stick and insert the USB stick to the control panel. Click on Setup Robot > Update Robot and choose the file. Finally click Update.

  • After the reboot, please make sure to go to Initialization Screen and click Start to update joint firmware.

Video: https://www.youtube.com/watch?v=-z_0hAgY948

Notes:

  • Robot series: CB-Series/CB3 (Polyscope)
  • Installing new hardware components may require updating of software.
  • Backward compatibility is not supported.
  • Software updates must be done in steps i.e. 3.2.1, 3.2.2, 3.3.0, 3.3.1, etc.

To enable debug message output to the terminal window:
http://wiki.ros.org/rosconsole#Configuration