Introduction To Matlab Robotics Toolbox
Introduction To Matlab Robotics Toolbox
What is MATLAB?
Workspace:
stores all the
active
variables
Command
history:
stores the
previously
executed
commands
Warning: each script of function, in order to be executed, have to be in the matlab search path
Prof. Ferrigno
To add a toolbox or a custom folder with personal functions use the Set
Path command from menu File and save.
Example, add the Robotic toolbox: then Set Path, choose Add with
Sub Folders and select the toolbox folder rvctools
Peter Corke, ROBOTICS TOOLBOX for MATLAB
http://www.petercorke.com/Toolboxes.html
Prof. Ferrigno
In case of problems
Multiple solutions:
help <command>: shows the description of a command;
Doc <command>: shows a pop-up with detailed explanations;
Help menu: shows a fancy description of the command, with also search
fucntionality and examples;
Internet:
Mathworks
Google
Stack Overflow
Prof. Ferrigno
Matlab Tips:
load a file and calculate the mean value
VarName = load(NomeFile.txt');
MeanVarName = mean(VarName);
M = mean(A,dim) returns the mean values for elements along the
dimension of A specified by scalar dim. For matrices, mean(A,2) is a
column vector containing the mean value of each row.
Prof. Ferrigno
Matlab Tips:
3D coordinates graphical representation
scatter3(X,Y,Z,S,C) displays colored circles at the locations specified by the vectors X, Y, and Z (which
must all be the same size).
S determines the size of each marker (specified in points). S can be a vector the same length as X, Y,
and Z or a scalar. If S is a scalar, MATLAB draws all the markers the same size.
C determines the colors of each marker. When C is a vector the same length as X, Y, and Z, the values
in C are linearly mapped to the colors in the current colormap. When C is a length(X)-by-3 matrix, it
specifies the colors of the markers as RGB values. C can also be a color string (see ColorSpec for a
list of color string specifiers).
scatter3(X,Y,Z) draws the markers in the default size and color.
scatter3(X,Y,Z,S) draws markers at the specified sizes (S) in a single color.
scatter3(...,markertype) uses the marker type specified instead of 'o' (see LineSpec for a list of marker
specifiers).
scatter3(...,'filled') fills the markers.
Prof. Ferrigno
Transformations:
using the Robotics Toolbox (MANUAL)
P2
[x2, y2, z2]
P3
P1
[x1, y1, z1]
0 0 0
x p3
y p 3
z p3
Matlab Tips:
vector algebra
10
Matrix multiplication
v1*v2
Dot product
dot(v1,v2)
Cross product
cross(v1,v2)
Norm
norm(v1)
Normalize
v1/norm(v1)
Element-wise
.* ./
Prof. Ferrigno