Setting up environment for use with MATLAB for UR development
Install hardware support and configure simulated hardware connection for cobots from Universal Robots
The purpose of this document is to highlight the MATLAB available connectivity options to connect with the UR Cobot in Simulation or Hardware.
This document guides how to set up a connection between MATLAB and a physical UR robot or URSim. This guide solely focuses on establishing a connection of a UR arm through MATLAB using any of the three available methods of connectivity RTDE, ROS or ROS2.
IMAGE
MATLAB |
Connectivity |
APIs |
Universal Robots |
RTDE |
|||
ROS 2 |
|||
ROS |
PREREQUISITES / SOFTWARE INSTALLATION
Controlling and Connecting with UR Cobot
1. Installation MATLAB – And required Addons
Install MATLAB – from the MathWorks site. The support for 3 modes of connectivity is available from the below mentioned releases
Feature Support |
MAtlab version |
Required toolbox |
RTDE Support for urRTDEClient |
From R2024a |
- Robotics System Toolbox |
ROS 2 Support for urROS2Node |
From R2024a |
- Robotics System Toolbox - ROS Toolbox |
ROS Support for urROSNode |
From R2023a |
Install the Support package – “Robotics System Toolbox Support Package for Universal Robots UR Series Manipulators” from the Get and Manage Add-Ons.
2. SEtUP
The high-level overview of the required steps to connect to the UR cobot can be seen below.
Depending on the required mode of communication, user can follow the MATLAB provided setup Wizard and complete the steps and verify if the test connection is successful by fetching the joint configuration from the UR cobot.
The setup wizard can be accessed in the following way,
- Select the mange Add-ons
2. Click the Gear icon on the support package
This wizard allows the user to connect using RTDE, ROS 2, or ROS. The instructions for the selected communication farmwork are available the setup screens.
The following support is available to connect to the UR cobot:
- RTDE Installation options
Connection Option |
Operating System with MATLAB® and the Support Package |
UR Series Cobot or the Operating System with URSim Installed |
Description |
Connect to URSim |
Linux® |
URSim on Linux |
Direct connection to URSim running on Linux |
Windows® |
URSim on Linux |
Direct connection to URSim running on Linux |
|
Windows |
URSim on Linux VM |
Connection to URSim running on a Linux VM hosted on Windows |
|
Connect to UR Series cobot (see Set Up UR Series Cobot for RTDE) |
Linux |
UR Series cobot |
Connection to the UR Series cobot's Teach Pendant directly from MATLAB |
Windows |
UR Series cobot |
Connection to the UR Series cobot's Teach Pendant directly from MATLAB |
- ROS 2 / ROS - The following options are supported for the available support
Options |
OS |
Documentation |
||
MATLAB |
ROS | ROS 2 |
ROS 2 |
ROS |
|
Connect and control cobot in URSim |
Linux |
Linux |
Set Up URSim Offline Simulator - MATLAB & Simulink - MathWorks India |
|
Windows |
Linux |
|||
Windows |
Linux Virtual Machine |
|||
Connect and control hardware (UR Series cobot) |
Linux |
Linux |
Hardware Setup for UR Series Cobots - MATLAB & Simulink - MathWorks India |
|
Windows |
Linux |
Link to APIs -- Reference List - MATLAB & Simulink - MathWorks
3. EXAMPLE
The simple getting started example can be found in --
- RTDE -- https://mathworks.com/help/robotics/urseries/ug/getting-started-ur5e-rtde-example.html
- ROS 2 -- https://mathworks.com/help/robotics/urseries/ug/getting-started-ros2-example.html
- ROS -- https://mathworks.com/help/robotics/urseries/ug/getting-started-controlling-ur5e.html