Robotics
TOOLBOX
for MATLAB
(Release 7.1)
0.6
0.8
Puma 560
x
y
z
!4
!2
0
2
4
!4
!2
0
2
4
2
2.5
3
3.5
4
4.5
5
5.5
q2
q3
I11
Peter I. Corke
Peter.Corke@csiro.au
April 2002
http://www.cat.csiro.au/cmst/staff/pic/robot
Peter I. Corke
CSIRO
Manufacturing Science and Technology
Pullenvale, AUSTRALIA, 4069.
2002
http://www.cat.csiro.au/cmst/staff/pic/robot
c
!2002 by Peter I. Corke.
3
1
Preface
1 Introduction
This, the seventh release of the Toolbox, represents nearly a decade of tinkering and a sub-
stantial level of maturity. It finally includes many of the features I’ve been planning to add
for some time, particularly MEX files, Simulink support and modified Denavit-Hartenberg
support. The previous release has had thousands of downloads and the mailing list has
hundreds of subscribers.
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 has some significant new functionality as well as some bug fixes.
• Full support for modified (Craig’s) Denavit-Hartenberg notation, forward and inverse
kinematics, Jacobians and forward and inverse dynamics.
• Simulink blockset library and demonstrations included, see Section 2
• MEX implementation of recursive Newton-Euler algorithm written in portable C.
Speed improvements of at least 1000. Tested on Solaris, Linux and Windows. See
Section 1.9.
• Fixed still more bugs and missing files in quaternion code.
• Remove ‘@’ notation from
fdyn to allow operation under Matlab 5 and 6.
• Fairly major update of documentation to ensure consistency between code, online
help and this manual.
1 INTRODUCTION
4
All code is now under CVS control which should eliminate many of the versioning problems
I had previously due to developing the code across multiple computers.
1.2 Contact
The Toolbox home page is at
http://www.cat.csiro.au/cmst/staff/pic/robot
This page will always list the current released version number as well as bug fixes and new
code in between major releases.
A Mailing List is also available, subscriptions details are available off that web page.
1.3 How to obtain the Toolbox
The Robotics Toolbox is freely available from the Toolbox home page at
http://www.cat.csiro.au/cmst/staff/pic/robot
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.4 MATLAB version issues
The Toolbox works with MA
TL
A
B
version 6 and greater and has been tested on a Sun with
version 6.
The Toolbox does not function under M
A
TL
A
B
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.5 Acknowledgements
I am grateful for the support of my employer, CSIRO, for supporting me in this activity and
providing me with the Matlab tools and web server.
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.
1 INTRODUCTION
5
1.6 Support, use in teaching, bug fi xes, 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!
Many people are using the Toolbox for teaching and this is something that I would encour-
age. If you plan to duplicate the documentation for class use then every copy must include
the front page.
If you want to cite the Toolbox please use
@ARTICLE{Corke96b,
AUTHOR = {P.I. Corke},
JOURNAL = {IEEE Robotics and Automation Magazine},
MONTH = mar,
NUMBER = {1},
PAGES = {24-32},
TITLE = {A Robotics Toolbox for {MATLAB}},
VOLUME = {3},
YEAR = {1996}
}
which is also given in electronic form in the README file.
1.7 A note on kinematic conventions
Many people are not aware that there are two quite different forms of Denavit-Hartenberg
representation for serial-link manipulator kinematics:
1. Classical as per the original 1955 paper of Denavit and Hartenberg, and used in text-
books such as by Paul[1], Fu etal[2], or Spong and Vidyasagar[3].
2. Modified form as introduced by Craig[4] in his text book.
Both notations represent a joint as 2 translations (A and D) and 2 rotation angles (! and ").
However the expressions for the link transform matrices are quite different. In short, you
must know which kinematic convention your Denavit-Hartenberg parameters conform to.
Unfortunately many sources in the literature do not specify this crucial piece of information.
Most textbooks cover only one and do not even allude to the existence of the other. These
issues are discussed further in Section 3.
The Toolbox has full support for both the classical and modified conventions.
1.8 Creating a new robot definition
Let’s take a simple example like the two-link planar manipulator from Spong & Vidyasagar[3]
(Figure 3-6, p73) which has the following (standard) Denavit-Hartenberg link parameters