Main Content

Hardware Setup for UR Series Cobots for ROS 2

Extension to Hardware

Based on our analysis, we recommend that you use a Linux® Host with MATLAB® and ROS for connecting MATLAB with UR Series of cobots. As mentioned in this page, the recommendation from Universal Robots is to use a Linux host with real-time kernel to get the best performance while controlling cobots using ROS.

When you use ROS installed on a virtual machine to establish a connection with cobot hardware, the additional interface between the physical host computer and virtual machine increases the latency of the bi-directional communication. In some cases, ROS drivers error out because of the unreliable communication between ROS and the hardware. Additionally, in this case, computational resources are shared between physical host computer and a virtual machine, which results in a poor performance while using a virtual machine.


For the complete model based design workflow involving MATLAB simulation, verification with URSim, and connectivity with UR Series hardware, we recommend Linux host with MATLAB and ROS. The URSim is installed using the docker. For more details, see Set Up URSim Offline Simulator for ROS 2.

The hardware setup required for connecting and controlling a physical UR Series cobot from MATLAB involves configuration of the Teach Pendant software using an external URCap file. The configuration includes these steps to be performed using the graphical interface of Teach Pendant:

Hardware - Connection Options Between Cobot, MATLAB, and ROS 2

To use the UR Series cobot to execute the bin picking example, the robot needs to be connected to a host Linux machine; MATLAB can be operated from either Linux or separate Windows PC connected to same server.

WorkflowROS 2 DeviceMATLABSchematic

Ubuntu® – Linux




Ubuntu – Linux


The robotAddress is the IP address of the robot hardware.

  • The cobot has a separate IP Address

    • The robotAddress  is the IP address of the UR Cobot

      Example: roslaunch ur_robot_driver ur5e.launch robot_ip:= <robotAddress>

  • The ros2device API uses the ROS2DeviceAddress where the IP address is from ROS 2 device..

    Example: ros2device(ROS2DeviceAddress,username,password)


In the above workflows for simulation and cobot, Workflow 2 using Linux machine is recommended.