Skip to content

Tutorial: Setting up and running the UR5 Robotic Arm

Minh-Khang Vu edited this page Mar 1, 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 ur_modern_driver

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

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: 50001 or 50002

Currently, the IPs are: 10.42.0.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
    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.


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

If you need help, come find Kevin Zhang [email protected] or Khang Vu [email protected]