ans =
0 -0.6000 0.5000 0.1000
0.6000 0 -0.4000 0.2000
-0.5000 0.4000 0 0.3000
0 0 0 1.0000
m =
0 -0.6000 0.5000 0.1000
0.6000 0 -0.4000 0.2000
-0.5000 0.4000 0 0.3000
0 0 0 1.0000
m =
0 -0.7000 0.6000 0.1000
0.7000 0 -0.5000 0.2000
-0.6000 0.5000 0 0.3000
0 0 0 0
ans =
0.1000
0.2000
0.3000
0.5000
0.6000
0.7000
ans =
0.1 <0, 0, 0>
ans =
0.99875 <0.013357, 0.026715, 0.040072>
Robotics Toolbox
for Matlab
(Release 8)
Peter I. Corke
Peter.I.Corke@gmail.com
December 2008
http://www.petercorke.com
c
2008 by Peter I. Corke.
3
1
Preface
1 Introduction
This, the eighth release of the Toolbox, represents nearly a decade of tinkering and a sub-
stantial level of maturity. This release is largely a maintenance one, tracking changes in
Matlab/Simulink and the way Matlab now handles help and demos. There is also a change
in licence, the toolbox is now released under LGPL.
The Toolbox provides many functions that are useful in robotics including such things as
kinematics, dynamics, and trajectory generation. The Toolbox is useful for simulation as
well as analyzing results from experiments with real robots.
The Toolbox is based on a very general method of representing the kinematics and dynam-
ics of serial-link manipulators. These parameters are encapsulated in Matlab objects. Robot
objects can be created by the user for any serial-link manipulator and a number of examples
are provided for well know robots such as the Puma 560 and the Stanford arm. The Toolbox
also provides functions for manipulating and converting between datatypes such as vec-
tors, homogeneous transformations and unit-quaternions which are necessary to represent
3-dimensional position and orientation.
The routines are written in a straightforward manner which allows for easy understanding,
perhaps at the expense of computational efficiency. My guide in all of this work has been
the book of Paul[1], now out of print, but which I grew up with. If you feel strongly about
computational efficiency then you can always rewrite the function to be more efficient,
compile the M-file using the Matlab compiler, or create a MEX version.
1.1 What’s new
This release is primarily fixing issues caused by changes in Matlab and Simulink R2008a.
• Simulink blockset and demos 1–6 all work with R2008a
• Some additional robot models were contributed by Wynand Swart of Mega Robots
CC: Fanuc AM120iB/10L, Motoman HP and S4 ABB 2.8.
• The toolbox is now released under the LGPL licence.
• Some functions have disappeared: dyn, dh
• Some functions have been redefined, beware:
– The toolbox used to use roll/pitch/yaw angles as per the book by Paul[1] in
which the rotations were: roll about Z, pitch about Y and yaw about X. This
is different to the more common robot conventions today, and as used in the
vehicular and aerospace industry in which roll is about X, pitch about Y and yaw
about Z. The functions tr2rpy and rpy2tr have been changed accordingly.
1 INTRODUCTION
4
– The functions rotx, roty and rotz all used to return a 4×4 transform matrix.
They now return a 3× 3 rotation matrix. Use the functions trotx, troty and
trotz instead if you want a 4×4 transform matrix.
• Some functions have been added:
– r2t, t2r, isvec, isrot.
• HTML format documentation is provided in the directory htmldoc which was gen-
erated using the package m2html. This help is accessible through MATLAB’s inbuilt
help browser, but you can also point your browser at htmldoc/index.html.
All code is now under SVN control which should eliminate many of the versioning problems
I had previously due to developing the code across multiple computers. A first cut at a test
suite has been developed to aid in pre-release testing.
1.2 Other toolboxes
Also of interest might be:
• A python implementation of the toolbox. All core functionality is present including
kinematics, dynamics, Jacobians, quaternions etc. It is based on the python numpy
class. The main current limitation is the lack of good 3D graphics support but people
are working on this. Nevertheless this version of the toolbox is very usable and of
course you don’t need a MATLAB licence to use it.
• Machine Vision toolbox (MVTB) for MATLAB. This was described in an article
@article{Corke05d,
Author = {P.I. Corke},
Journal = {IEEE Robotics and Automation Magazine},
Month = nov,
Number = {4},
Pages = {16-25},
Title = {Machine Vision Toolbox},
Volume = {12},
Year = {2005}}
It provides a very wide range of useful computer vision functions beyond the Mathwork’s
Image Processing Toolbox. However the maturity of MVTB is less than that of the robotics
toolbox.
1.3 Contact
The Toolbox home page is at
http://www.petercorke.com/robot
1 INTRODUCTION
5
This page will always list the current released version number as well as bug fixes and new
code in between major releases.
A Google Group called “Robotics Toolbox” has been created to handle discussion. This
replaces all former discussion tools which have proved to be very problematic in the past.
The URL is
http://groups.google.com.au/group/robotics-tool-box
.
1.4 How to obtain the Toolbox
The Robotics Toolbox is freely available from the Toolbox home page at
http://www.petercorke.com
or the CSIRO mirror
http://www.ict.csiro.au/downloads.php
The files are available in either gzipped tar format (.gz) or zip format (.zip). The web page
requests some information from you regarding such as your country, type of organization
and application. This is just a means for me to gauge interest and to help convince my
bosses (and myself) that this is a worthwhile activity.
The file
robot.pdf
is a comprehensive manual with a tutorial introduction and details
of each Toolbox function. A menu-driven demonstration can be invoked by the function
rtdemo
.
1.5 MATLAB version issues
The Toolbox should in principle work with MATLAB version 6 and greater. However fea-
tures of Matlab keep changing so it best to use the latest versions R2007 or R2008.
The Toolbox will not function under MATLAB v3.x or v4.x since those versions do not
support objects. An older version of the Toolbox, available from the Matlab4 ftp site is
workable but lacks some features of this current Toolbox release.
1.6 Acknowledgements
I am grateful for the support of my employer, CSIRO, for supporting me in this activity and
providing me with access to the Matlab tools.
I have corresponded with a great many people via email since the first release of this Tool-
box. Some have identified bugs and shortcomings in the documentation, and even better,
some have provided bug fixes and even new modules, thankyou. See the file CONTRIB for
details.
1.7 Support, use in teaching, bug fixes, etc.
I’m always happy to correspond with people who have found genuine bugs or deficiencies
in the Toolbox, or who have suggestions about ways to improve its functionality. However
I draw the line at providing help for people with their assignments and homework!