Human-Oriented Robotics
- Prof. Kai Arras
Social Robotics Lab
Human-Oriented Robotics Octave/Matlab Tutorial
Kai Arras Social Robotics Lab, University of Freiburg
1
Human-Oriented Robotics Octave/Matlab Tutorial Kai Arras Social - - PowerPoint PPT Presentation
Human-Oriented Robotics Prof. Kai Arras Social Robotics Lab Human-Oriented Robotics Octave/Matlab Tutorial Kai Arras Social Robotics Lab, University of Freiburg 1 Human-Oriented Robotics Contents Prof. Kai Arras Social Robotics Lab
Human-Oriented Robotics
Social Robotics Lab
1
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
2
Human-Oriented Robotics
Social Robotics Lab
3
Human-Oriented Robotics
Social Robotics Lab
4
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
5
Human-Oriented Robotics
Social Robotics Lab
6
Human-Oriented Robotics
Social Robotics Lab
7
Human-Oriented Robotics
Social Robotics Lab
8
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
9
Human-Oriented Robotics
Social Robotics Lab
10
Human-Oriented Robotics
Social Robotics Lab
11
Human-Oriented Robotics
Social Robotics Lab
12
Human-Oriented Robotics
Social Robotics Lab
13
Human-Oriented Robotics
Social Robotics Lab
14
Human-Oriented Robotics
Social Robotics Lab
15
Human-Oriented Robotics
Social Robotics Lab
16
Human-Oriented Robotics
Social Robotics Lab
17
Human-Oriented Robotics
Social Robotics Lab
18
Human-Oriented Robotics
Social Robotics Lab
19
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
20
Human-Oriented Robotics
Social Robotics Lab
21
Human-Oriented Robotics
Social Robotics Lab
22
Human-Oriented Robotics
Social Robotics Lab
23
Human-Oriented Robotics
Social Robotics Lab
24
Human-Oriented Robotics
Social Robotics Lab
25
Human-Oriented Robotics
Social Robotics Lab
26
Human-Oriented Robotics
Social Robotics Lab
27
Human-Oriented Robotics
Social Robotics Lab
28
Human-Oriented Robotics
Social Robotics Lab
29
Human-Oriented Robotics
Social Robotics Lab
30
Human-Oriented Robotics
Social Robotics Lab
31
Human-Oriented Robotics
Social Robotics Lab
32
Human-Oriented Robotics
Social Robotics Lab
33
Human-Oriented Robotics
Social Robotics Lab
34
Human-Oriented Robotics
Social Robotics Lab
35
Human-Oriented Robotics
Social Robotics Lab
36
Human-Oriented Robotics
Social Robotics Lab
37
Human-Oriented Robotics
Social Robotics Lab
38
Human-Oriented Robotics
Social Robotics Lab
39
Human-Oriented Robotics
Social Robotics Lab
40
Human-Oriented Robotics
Social Robotics Lab
41
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
42
Human-Oriented Robotics
Social Robotics Lab
43
Human-Oriented Robotics
Social Robotics Lab
44
Human-Oriented Robotics
Social Robotics Lab
45
Human-Oriented Robotics
Social Robotics Lab
46
Human-Oriented Robotics
Social Robotics Lab
47
Human-Oriented Robotics
Social Robotics Lab
48
Human-Oriented Robotics
Social Robotics Lab
49
Human-Oriented Robotics
Social Robotics Lab
50
Human-Oriented Robotics
Social Robotics Lab
51
Human-Oriented Robotics
Social Robotics Lab
plot(x,cos(x),'r+',x,sin(x),'-x','Color',[1 .4 .8],'MarkerSize',2)
52
Human-Oriented Robotics
Social Robotics Lab
53
Human-Oriented Robotics
Social Robotics Lab
54
Human-Oriented Robotics
Social Robotics Lab
55
Human-Oriented Robotics
Social Robotics Lab
% Load data load MDdata xdata dist1 dist2 dist3 % Plot the first set of data in blue figure; hold on; plot(xdata, dist1, 'bo'); plot(xdata, dist2, 'r+'); plot(xdata, dist3, 'g^'); % Add title, axis labels, legend title('Morse Signal Analysis'); xlabel('Dissimilarities'); ylabel('Distances'); legend({'Stress', 'Sammon Mapping', 'Squared Stress'},'Location','NorthWest');
56
Human-Oriented Robotics
Social Robotics Lab
% Load data load SpectraData massc time spectra; % Create the 3D plot figure; plot3(massc, time, spectra); box on; % Set viewing angle and axis limits view(26, 42); axis([500 900 0 22 0 4e8]); % Add title and axis labels xlabel('Mass/Charge (M/Z)'); ylabel('Time'); zlabel('Ion Spectra'); title('Extracted Spectra Subset');
57
Human-Oriented Robotics
Social Robotics Lab
% Create the plot figure; ezplot('(x^2 + y^2)^2 - x^2 + y^2',... [-1.1, 1.1], [-1.1, 1.1]); % Add a multi-line title title({'Lemniscate Function';... '(x^2 + y^2)^2 - x^2 + y^2'});
58
Human-Oriented Robotics
Social Robotics Lab
% Load data load Datafile measles mumps chickenpox; % Create a stacked bar chart bar figure; bar(1:12, [measles mumps chickenpox],... 0.5, 'stack'); % Adjust the axis limits axis([0 13 0 100000]); % Add title, axis labels, legend title('Childhood diseases by month'); xlabel('Month'); ylabel('Cases (in thousands)'); legend('Measles', 'Mumps', 'Chicken pox');
59
Human-Oriented Robotics
Social Robotics Lab
% Load monthly temperature data load MonthlyTemps temperatures months years; % Create the 3D bar chart figure; bar3(temperatures); axis([0 13 0 12 0 80]); % Add title and axis labels title('Boston Monthly Temps 1900-2000'); xlabel('Month'); ylabel('Year'); zlabel('Temperature'); % Change the x and y axis tick labels set(gca, 'XTickLabel', months); set(gca, 'YTickLabel', years);
60
Human-Oriented Robotics
Social Robotics Lab
% Create data for the function t = 0:0.01:2*pi; r = abs(sin(2*t).*cos(2*t)); % Create a polar plot using polar figure; polar(t, r); % Add a title title('abs(sin(2t)*cos(2t))');
61
Human-Oriented Robotics
Social Robotics Lab
% Load data load OzoneData ozoneidx temp wind rad; % Create a 3D scatter plot figure; scatter3(temp, wind, rad, 30, ...
view(-34, 14); % Add title and axis labels title('Ozone Levels'); xlabel('Temperature'); ylabel('Wind Speed'); zlabel('Radiation'); % Add a colorbar with tick labels colorbar('location', 'EastOutside', 'YTickLabel',... {'2 ppm', '4 ppm', '6 ppm', '8 ppm', '10 ppm', '12 ppm', '14 ppm'});
62
Human-Oriented Robotics
Social Robotics Lab
% Create a grid of x and y data y = -10:0.5:10; x = -10:0.5:10; [X, Y] = meshgrid(x, y); % Create the function Z = f(X,Y) Z = sin(sqrt(X.^2+Y.^2))./sqrt(X.^2+Y.^2); % Create a surface contour plot figure; surfc(X, Y, Z); view(-38, 18); % Add title and axis labels title('Normal Response'); xlabel('x'); ylabel('y'); zlabel('z');
63
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
64
Human-Oriented Robotics
Social Robotics Lab
65
Human-Oriented Robotics
Social Robotics Lab
66
Human-Oriented Robotics
Social Robotics Lab
67
Human-Oriented Robotics
Social Robotics Lab
68
Human-Oriented Robotics
Social Robotics Lab
69
Human-Oriented Robotics
Social Robotics Lab
70
Human-Oriented Robotics
Social Robotics Lab
71
Human-Oriented Robotics
Social Robotics Lab
72
Human-Oriented Robotics
Social Robotics Lab
73
Human-Oriented Robotics
Social Robotics Lab
74
Human-Oriented Robotics
Social Robotics Lab
75
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
76
Human-Oriented Robotics
Social Robotics Lab
77
Human-Oriented Robotics
Social Robotics Lab
78
Human-Oriented Robotics
Social Robotics Lab
79
Human-Oriented Robotics
Social Robotics Lab
80
Human-Oriented Robotics
Social Robotics Lab
81
Human-Oriented Robotics
Social Robotics Lab
82
Human-Oriented Robotics
Social Robotics Lab
%NORMANGLE Put angle into a two-pi interval. % AN = NORMANGLE(A,MIN) puts angle A into the interval % [MIN..MIN+2*pi[. If A is Inf, Inf is returned. % v.1.0, Dec. 2003, Kai Arras. function an = normangle(a,mina); if a < Inf, [...]
83
Human-Oriented Robotics
Social Robotics Lab
84
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
85
Human-Oriented Robotics
Social Robotics Lab
86
Human-Oriented Robotics
Social Robotics Lab
87
Human-Oriented Robotics
Social Robotics Lab
88
Human-Oriented Robotics
Social Robotics Lab
89
Human-Oriented Robotics
Social Robotics Lab
90
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
91
Human-Oriented Robotics
Social Robotics Lab
92
Human-Oriented Robotics
Social Robotics Lab
93
Human-Oriented Robotics
Social Robotics Lab
94
Human-Oriented Robotics
Social Robotics Lab
95
Human-Oriented Robotics
Social Robotics Lab
96
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
97
Human-Oriented Robotics
Social Robotics Lab
98
Human-Oriented Robotics
Social Robotics Lab
99
0.792258 0.325823 0.957683 0.647680 0.498282 0.328679 0.414615 0.270472 0.975753 0.043852 0.601800 0.062914 0.837494 0.621332 0.870605 0.940364 0.036513 0.843801 0.806506 0.804710 0.937506 0.872248 0.134889 0.042745 0.228380
Human-Oriented Robotics
Social Robotics Lab
100
A = [ 0.792258 0.325823 0.957683 0.647680 0.498282 0.328679 0.414615 0.270472 0.975753 0.043852 0.601800 0.062914 0.837494 0.621332 0.870605 0.940364 0.036513 0.843801 0.806506 0.804710 ]; figure(1); clf; hold on; plot(1:size(A,1),A(:,1));
Human-Oriented Robotics
Social Robotics Lab
101
Human-Oriented Robotics
Social Robotics Lab
102
Human-Oriented Robotics
Social Robotics Lab
103
Human-Oriented Robotics
Social Robotics Lab
104
Human-Oriented Robotics
Social Robotics Lab
105
Human-Oriented Robotics
Social Robotics Lab
106
Human-Oriented Robotics
Social Robotics Lab
107
Human-Oriented Robotics
Social Robotics Lab
108
Human-Oriented Robotics
Social Robotics Lab
109
Human-Oriented Robotics
Social Robotics Lab
Matlab GNU Octave
110
Human-Oriented Robotics
Social Robotics Lab
111
Human-Oriented Robotics
Social Robotics Lab
0.5 1 1.5 2 2.5 3 0.5 1 1.5 2 2.5 3
112
Human-Oriented Robotics
Social Robotics Lab
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.5 1 1.5 2 2.5 3 3.5
113
Human-Oriented Robotics
Social Robotics Lab
1 2
0.5 1 1.5 2 2.5 3
114
Human-Oriented Robotics
Social Robotics Lab
1 2 3
0.5 1 1.5 2 2.5 3 3.5 4
115
Human-Oriented Robotics
Social Robotics Lab
0.5 1 1.5 2 2.5 3
0.5 1 1.5 2
x1 x2 x3 x4
116
Human-Oriented Robotics
Social Robotics Lab
1 2 3 4 5
0.5 1 1.5 2 2.5
117
Human-Oriented Robotics
Social Robotics Lab
xWR xWF xRF
118
Human-Oriented Robotics
Social Robotics Lab
119
Human-Oriented Robotics
Social Robotics Lab
120
Human-Oriented Robotics
Social Robotics Lab
Kai Arras, Social Robotics Lab
121