How to add support for Universal Robots UR20 and UR30 using loadrobot API?

14 views (last 30 days)
How to add support for Universal Robots UR20 and UR30 using loadrobot API?

Accepted Answer

Jishnu Subramonian
Jishnu Subramonian on 29 Jul 2025
Edited: Jishnu Subramonian on 29 Jul 2025
The URDF files for Universal Robots (UR20/UR30) can be generated using the below steps and use them in MATLAB as follows:
1. Download the ROS VM shipped by MathWorks from:
2. The Universal Robots package is already present in the same VM at:
/home/user/catkin_ws/src/Universal_Robots_ROS2_Description-rolling
3. To generate URDF from Xacro, open a terminal and enter the following commands:
$ cd /home/user/catkin_ws/src/Universal_Robots_ROS2_Description-rolling/urdf/
$ source /opt/ros/noetic/setup.bash
$ ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/catkin_ws/src/Universal_Robots_ROS2_Description-rolling
$ echo $ROS_PACKAGE_PATH
$ xacro ur.urdf.xacro name:=ur20 ur_type:=ur20 > ur20.urdf
$ xacro ur.urdf.xacro name:=ur30 ur_type:=ur30 > ur30.urdf
These commands generate the URDF files in the Universal_Robots_ROS2_Description folder.
4. If MATLAB is on another machine, copy the `Universal_Robots_ROS2_Description-rolling` folder along with the `urdf` and `meshes` folders.
5. Use `importrobot` in MATLAB to load the robot model.
This step can be repeated for the required Cobot model.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!