File Exchange

image thumbnail


version (208 MB) by Michael Kutzer
UR Toolbox


Updated 08 Jan 2021

From GitHub

View Version History

View license on GitHub

This toolbox wraps functionality from the URX Python library and includes functions for calculating forward/inverse kinematics, DH parameters, Jacobians, etc. This toolbox also includes URScript code allowing the user to command manipulators smoothly using a set of waypoints.

Cite As

Michael Kutzer (2021). kutzer/URToolbox (, GitHub. Retrieved .

Comments and Ratings (15)

Mahdi Zouaghi

Hello Kutzer,
Is there any way to control only the joint velocities instead of having to specify the pose with the msg function?

Xiang Wang

Xiang Wang

Dear Kutzer,
Is the toolbox capable of control a real UR robot? How can I use it to control a real UR5 robot?
Best regards,


Hans Dunning

Gabriele Porcelli

Ok, I think I didn't convert degree into radians. Thanks for the help. Just another question. UR provides DH parameters where 'a' is negative while in your code they are turned to be positive. Why?

Michael Kutzer

Gabriele, I cannot speak for the kinematics used by RobotDK as it is a commercial software that is not provided by Universal Robot. The kinematics provided in the UR Toolbox match the end-effector pose information available on your UR teach pendant. Please note that the joint angle units are radians in UR_fkin and the linear units used in the pose are millimeters. As a quick side-note, the manipulator geometry (i.e. link lengths and joint offsets) matches the general documentation for the UR3, UR5, and UR10. It does not account for any small calibration offsets assigned to your specific manipulator when it left the factory. As a test, let's try the following:
(1) Using the teach pendant, set your arm to a configuration (e.g. [0,-90,0,0,90,0] degrees)
(2) In MATLAB, initialize a URsim (e.g. assuming you are using a UR5: sim = URsim; sim.Initialize('UR5'); sim.Joints = [0,-pi/2,0,0,pi/2,0];)
(3) Does the configuration of the arm in the MATLAB figure look like the configuration of your real arm?

If the answer to (3) is yes, my hunch is that at least one of a few things is true:
(1) You have a tool frame offset relative to the end-effector defined either in the UR controller or RobotDK (likely RobotDK).
(2) You have a base frame offset defined either in the UR controller or RobotDK (likely RobotDK).
(3) RobotDK is, by default, assigning a different base frame or tool frame from the UR documentation.

Gabriele Porcelli

I have a problem with UR_fkin. If I put a generic joints vector I obtain a pose which is different from the robot's real one. I'm checking the real pose using RobotDK in which I can choose the single robot joints angle. Does anyone have the same problem?

Michael Kutzer

It looks like you have inadvertently edited the function at least twice! Line 27 of UR_fkin.m *should* read "[bin,msg] = isSE(H_t2e);"

Additionally, UR_fkin.m requires a 6-element array of joint angles. It seems you have provided it with a scalar value of 6.


Dear Kutzer,
whenever i go for calculation of fkine this error shows up in line 28 ,may be there is some issue on syntax ?
>> H_e2o = UR_fkin('UR5',6)
Too many output arguments.

Error in UR_fkin (line 28)
[bin,msg] = (H_t2e);


Dear Kutzer,

Thanks for your prompt and explanatory reply.

We have an UR5 robot in our lab and I just want to control it with Simulink Real Time by using your toolbox.

Any advice will be very appreciated. Maybe you can advice which functions I need to use in Simulink.

Best regards,

Michael Kutzer

I have not implemented a Simulink interface for the URsim class. If you are interested, I would recommend looking at "MATLAB System" blocks in Simulink, or "MATLAB Function" blocks. Note that using "MATLAB Function" blocks may require you to create a series of wrapper functions for the URsim class, but these should be very simple.

As a final reminder, the URsim class is only kinematic! I have not worked through and implemented the arm dynamics. I am not certain how you are planning to use this tool in your work, but I want to make sure you understand what it is, and is not currently capable of.



Thanks for the toolbox. Any advice how to use it with Simulink? How can I access and modify URsim object inside Simulink?

Thanks in advance.

Best regards,

Michael Kutzer

As long as you properly install all of the required toolboxes (in MATLAB using the "install*.m" function for each required toolbox), it should be OK.

You can find examples in the base directory of an unzipped version of URToolbox. There should be a "URToolbox Example SCRIPTS" folder with one or more example scripts. Try running the "SCRIPT_DrawCircle.m" and please note that your IP settings may be different then the ones in the example.

Alen Kolman

we are working on a project in university (The Faculty of Electrical Engineering and Computer Science). We are trying to use your toolbox »URToolbox«.
When installing in MATLAB we get some errors to install manually: PlottingToolbox and Transforamtion Toolbox.

After installing them manually we get next error (pip install math3d, numpy, urx) and install them manually to

Is it okay if errors are still there after manual installation of these toolboxes? ( after new installation of URToolbox)

We also manage to complete installation of URToolboxScript.script on Polyscope.

Are there any examples how to test and start with programming?

Your sincerely and thank you for the answer,

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!