Setting up a new Universal Robot with ROS
Congratulations on acquiring your new Universal Robot! Connecting it to the Robot Operating System (ROS) is an exciting step that will…
Setting up a new Universal Robot with ROS

This document is a summary of setting up the UR5e robot with ROS (Noetic in my case) and MoveIt
Congratulations on acquiring your new Universal Robot! Connecting it to the Robot Operating System (ROS) is an exciting step that will enable you to leverage a vast array of tools and functionalities for your robotic applications.
I wrote this document initially for myself and other members of my lab to help them get started with our new arm. I spent a lot of time searching the internet to get the required data. Now, UR and other collaborators have been kind enough to provide all the steps required, but they exist in different pieces which need to be read in a particular order to get the arm working. This document is an attempt to consolidate all the information and present them in an order which I believe they should be read and implemented.
I assume you have already connected the robot and are able to control it with the Teach Pendant. It is a pretty simple setup, the easiest I have seen till date.
In this document, I will show how to ensure your robot is properly configured for communication. This involves setting up the necessary network connections and installing the appropriate ROS packages. The Universal Robots ROS driver provides a stable interface that supports various models, including the UR3, UR5, and UR10, making it easier to integrate your robot into ROS environments. In this guide, I will walk you through the essential steps to establish a connection between your Universal Robot and ROS, allowing you to control and program your robot effectively. Let’s dive in and unlock the full potential of your new robotic companion!
Do note I was setting up a UR5e when I wrote this document. I have tried to keep the documentation general but do forgive any lapses!
Repositories Used:
The robot driver which needs to be installed on the host PC (or the Docker image, refer below):
The UR Caps External command program. Refer below on steps for how to add to the controller:
Packages Needed:
Now I personally like Docker for creating ready to use images for my robots. Below is one of the lines from my Docker Image Files which I use for my projects. It lists the ROS packages I install. You can install them manually or just add it to your Docker File.
RUN apt-get install -y \
ros-${ROS_DISTRO}-ros-control \
ros-${ROS_DISTRO}-realsense2-camera \
ros-${ROS_DISTRO}-realsense2-description \
ros-${ROS_DISTRO}-catkin \
ros-${ROS_DISTRO}-moveit \
ros-${ROS_DISTRO}-moveit-visual-tools \
ros-${ROS_DISTRO}-rosserial \
ros-${ROS_DISTRO}-rosserial-arduino \
ros-${ROS_DISTRO}-ros-controllers \
ros-${ROS_DISTRO}-industrial-robot-status-interface \
ros-${ROS_DISTRO}-scaled-controllers \
ros-${ROS_DISTRO}-ur-msgs \
ros-${ROS_DISTRO}-ur-client-library \
ros-${ROS_DISTRO}-pass-through-controllers \
ros-${ROS_DISTRO}-trac-ik \
ros-${ROS_DISTRO}-rqt-joint-trajectory-controller
Now you can install the ur-robot-driver along with the rest of these packages. I would recommend skipping that and installing the driver as a standalone in the repository. This allows easier modifications to the source code. If you are planning to use the robot controller as is, you would be better off installing the binaries. If you are planning on updating the robot description or doing something else like that, it is better to have the option of rebuilding the packages as many times as you want.
Installing URCaps on the Robot
Follow the instructions here to install the URCaps program into the Robot Controller. It is quite detailed and explains each step with a corresponding visual.
The result of this should be a program which we can start for enabling external control via Ethernet.
Adding the UR5 Packages to the repository
For my project I set up a new package called ur_robot_ros which will abstract away all the underlying packages needed for the robot. Currently the package looks something like this:

The packages here are from two sources:
- The first set includes the calibration, messages and driver packages, and is from the robot driver repository I linked at the top. Now, I am usually against downloading the repository as a zip file, but I did so in this case for two reasons. Firstly, I just want the three driver packages and not the decoration the main package comes in. Why not clone it in the repository and delete the unwanted stuff? That leads to my second reason, cloning it into my repository would create a sub-module and I am not a fan of sub-modules. They are useful in version control, but are a pain to deal with, so I choose to avoid that headache down the road.
- The second set consisting of the MoveIt config and descriptions are from this repository. Same reasoning as before for the zip download. Note that I have a UR5e in my workspace. Get the config for the robot you have.
Note that both the driver repository and the descriptions repository can be installed using ‘apt’ on Ubuntu and Debian. I plan to mess around with the source code and that is the reason why I created this package. For standard purposes, you would be better off using ‘apt’.
Building the Workspace
The most satisfying and irritating part of the process is building the workspace. On a good system, the process is seamless. On an average system you might be limited by your resources and might have to run the build command multiple time to get stuff working.
While I am no expert, I believe the multiple failed builds before the final successful build has something to do with the order in which the packages are being built and linked. If package A being built refers to package B down the list which has not yet been built, it will throw an error and fail the build. Start again and hopefully package B is built before A this time and B is not dependent on some other package C.

I personally prefer using catkin build when working with ROS1 because of the additional advantages provided by its flags like limiting number of jobs, memory usage and building packages selectively. Refer here for the catkin build documentation. If the builds are failing because of dependencies and references, a good hack is to individually build the dependency before retrying.
The build does have a tendency to freeze your system if the resources are not managed correctly. Check this if the system crashes. This can be a little difficult to manage.
Testing the Communication with ROS
Before we start messing with the source code for the robot control, let’s test the code as is. This should serve as a sanity check and a good milestone to check our work. From my understanding we should be good to go with the three steps:
- Start the URCaps program on the pendant to enable external control.
- Start the robot driver.
- Launch MoveIt control.
For the first step, hookup the robot and your PC to a router. Check in the Settings on the teach pendant if an IP address has been assigned. Once you get the IP, try to ssh login into the robot. The username is root and password is easybot. Once ssh is successful, you are able to access the robot via the network. Exit the connection and transfer the downloaded URCaps external control file to the robot with SCP. For me it looked like this:
scp externalcontrol-1.0.5.urcap [root@192.168.1.172](<mailto:root@192.168.1.172>):/programs/
Follow the steps I linked above to start the external control on the UR Controller.
The rest of the steps are basically from the same manuals. Start the robot driver on the PC, start the program on the Teach Pendant. The terminal will show the robot ready to receive the commands. Go ahead and start your choice of action server interface, that MoveIt or something else. You are good to go!
This is a good video of what we will be doing and what the end result would look like. This is from a channel called Industrial Robotics on YouTube.
[embed]
And that’s it! Using the configuration package you can start talking to the robot through ROS. You can find what files to launch from the repositories I linked. If you have any problems, feel free to send a message or a mail!
References
- UniversalRobots/Universal_Robots_ROS_Driver: Universal Robots ROS driver supporting CB3 and e-Series (github.com)
- UniversalRobots/Universal_Robots_ExternalControl_URCap: Example implementation of how to use ROS driver on-demand in a URCap. (github.com)
- User blog:2Actimv/How to write a technical blog? | Community Central | Fandom
- https://youtu.be/dc6iehJWUBA?si=gn2U-VZ3Yeg-XX_q
메타데이터
- post_id
- c95a80fc22bb
- slug
- setting-up-a-new-universal-robot-with-ros-c95a80fc22bb
- url
- https://medium.com/robots-and-you/setting-up-a-new-universal-robot-with-ros-c95a80fc22bb
- canonical_url
- https://medium.com/robots-and-you/setting-up-a-new-universal-robot-with-ros-c95a80fc22bb
- author_url
- https://medium.com/@nightfuryac30
- status
- ok
- fetched_at
- 2026-07-30 08:21:23