plots: increase font size for better reading in ppt
parent
f4067fe7d2
commit
08a5df3cc7
74
plot_all.m
74
plot_all.m
|
@ -8,6 +8,7 @@ disp('Photos will start in 3s')
|
|||
pause(3)
|
||||
|
||||
PLOT_TESTS = [
|
||||
<<<<<<< HEAD
|
||||
"results-diffdrive/straightline/chill/01-Aug-2024 15-34-03";
|
||||
"results-diffdrive/straightline/chill_errortheta_pisixths/01-Aug-2024 15-56-36";
|
||||
"results-diffdrive/square/01-Aug-2024 16-18-51";
|
||||
|
@ -23,6 +24,16 @@ PLOT_TESTS = [
|
|||
"results-diffdrive/sin/no_start_error/27-Aug-2024 19-29-42";
|
||||
"results-diffdrive/sin/no_start_error/27-Aug-2024 19-31-17";
|
||||
"results-diffdrive/sin/no_start_error/27-Aug-2024 19-38-03";
|
||||
=======
|
||||
"results-uni/straightline/chill/30-08-2024 19-37-07";
|
||||
"results-uni/straightline/chill_errortheta_pisixths/30-08-2024 19-38-37";
|
||||
"results-uni/square/30-08-2024 19-44-27";
|
||||
"results-uni/sin/no_start_error/30-08-2024 19-45-33";
|
||||
"results-uni/circle/start_center/30-08-2024 19-50-23";
|
||||
"results-uni/circle/start_tangent/30-08-2024 19-51-58";
|
||||
"results-uni/circle/toofast/30-08-2024 19-48-47";
|
||||
"results-uni/circle/start_center_plus_tolerance/01-09-2024 19-20-41";
|
||||
>>>>>>> c772cb1 (plots: increase font size for better reading in ppt)
|
||||
]
|
||||
|
||||
s_ = size(PLOT_TESTS)
|
||||
|
@ -36,36 +47,37 @@ for i = 1:s_(1)
|
|||
dir = ['images-diffdrive/', sPLOT_TEST, '/']
|
||||
mkdir(dir);
|
||||
|
||||
%{
|
||||
|
||||
for n=1:3
|
||||
%{
|
||||
clf; plot_trajectory(t{n}, ref_t{n}, q{n})
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_trajectory.eps'])
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_trajectory.png'])
|
||||
clf; plot_error(t{n}, ref_t{n}, q{n})
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_error.eps'])
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_error.png'])
|
||||
clf; plot_doubleinput(t{n}, sim_data{n}.SATURATION, U_track{n}, U_corr{n}, 0)
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_double_input_1x2.eps'])
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_double_input_1x2.png'])
|
||||
clf; plot_doubleinput(t{n}, sim_data{n}.SATURATION, U_track{n}, U_corr{n}, 1)
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_double_input_2x1.eps'])
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_double_input_2x1.png'])
|
||||
clf; plot_tripleinput(t{n}, sim_data{n}.SATURATION, U{n}, U_track{n}, U_corr{n}, 0)
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_triple_input_1x2.eps'])
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_triple_input_1x2.png'])
|
||||
clf; plot_tripleinput(t{n}, sim_data{n}.SATURATION, U{n}, U_track{n}, U_corr{n}, 1)
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_triple_input_2x1.eps'])
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_triple_input_2x1.png'])
|
||||
|
||||
%print([dir, num2str(n), '_error.png'], '-dpng')
|
||||
%clf; plot_input(t{n}, sim_data{n}.SATURATION, U_track{n}, 'track')
|
||||
%export_fig(gcf, '-transparent', [dir, num2str(n), '_track_input.eps'])
|
||||
%print([dir, num2str(n), '_track_input.png'], '-dpng')
|
||||
%export_fig(gcf, '-transparent', [dir, num2str(n), '_track_input.png'])
|
||||
%clf; plot_input(t{n}, sim_data{n}.SATURATION, U_corr{n}, 'corr')
|
||||
%export_fig(gcf, '-transparent', [dir, num2str(n), '_corr_input.eps'])
|
||||
%print([dir, num2str(n), '_corr_input.png'], '-dpng')
|
||||
|
||||
%clf; plot_input(t{n},sim_data{n}.SATURATION, U{n}, '')
|
||||
%export_fig(gcf, '-transparent', [dir, num2str(n), '_total_input.eps'])
|
||||
%print([dir, num2str(n), '_total_input.png'], '-dpng')
|
||||
%export_fig(gcf, '-transparent', [dir, num2str(n), '_corr_input.png'])
|
||||
%}
|
||||
clf; plot_input(t{n},sim_data{n}.SATURATION, U{n}, '', 0)
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_total_input_1x2.png'])
|
||||
clf; plot_input(t{n},sim_data{n}.SATURATION, U{n}, '', 1)
|
||||
export_fig(gcf, '-transparent', [dir, num2str(n), '_total_input_2x1.png'])
|
||||
end
|
||||
%}
|
||||
|
||||
|
||||
|
||||
%{
|
||||
% correction difference (multistep, 1-step)
|
||||
<<<<<<< HEAD
|
||||
clf; plot_input_diff(t{3}, t{2}, U_corr{3}, U_corr{2}, 0, '\textbf{$$\omega_r^{corr, multistep}$$}', '\textbf{$$\omega_r^{corr, 1step}$$}', '\textbf{$$\omega_l^{corr, multistep}$$}', '\textbf{$$\omega_l^{corr, 1step}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'corr_input_diff_1x2.eps'])
|
||||
clf; plot_input_diff(t{3}, t{2}, U_corr{3}, U_corr{2}, 1, '\textbf{$$\omega_r^{corr, multistep}$$}', '\textbf{$$\omega_r^{corr, 1step}$$}', '\textbf{$$\omega_l^{corr, multistep}$$}', '\textbf{$$\omega_l^{corr, 1step}$$}')
|
||||
|
@ -83,4 +95,30 @@ for i = 1:s_(1)
|
|||
clf; plot_input_diff(t{2}, t{3}, U{2}, U{3}, 1, '\textbf{$$\omega_r^{1step}$$}', '\textbf{$$\omega_r^{multistep}$$}', '\textbf{$$\omega_l^{1step}$$}', '\textbf{$$\omega_l^{multistep}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_1step_multistep_2x1.eps'])
|
||||
|
||||
=======
|
||||
clf; plot_input_diff(t{3}, t{2}, U_corr{3}, U_corr{2}, 0, '\textbf{$$v^{corr, multistep}$$}', '\textbf{$$v^{corr, 1step}$$}', '\textbf{$$\omega^{corr, multistep}$$}', '\textbf{$$\omega^{corr, 1step}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'corr_input_diff_1x2.png'])
|
||||
clf; plot_input_diff(t{3}, t{2}, U_corr{3}, U_corr{2}, 1, '\textbf{$$v^{corr, multistep}$$}', '\textbf{$$v^{corr, 1step}$$}', '\textbf{$$\omega^{corr, multistep}$$}', '\textbf{$$\omega^{corr, 1step}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'corr_input_diff_2x1.png'])
|
||||
|
||||
% input difference (saturated track only, 1step)
|
||||
clf; plot_input_diff(t{1}, t{2}, U{1}, U{2}, 0, '\textbf{$$v^{trackonly-sat}$$}', '\textbf{$$v^{1step}$$}', '\textbf{$$\omega^{trackonly-sat}$$}', '\textbf{$$\omega^{1step}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_track_1step_1x2.png'])
|
||||
clf; plot_input_diff(t{1}, t{2}, U{1}, U{2}, 1, '\textbf{$$v^{trackonly-sat}$$}', '\textbf{$$v^{1step}$$}', '\textbf{$$\omega^{trackonly-sat}$$}', '\textbf{$$\omega^{1step}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_track_1step_2x1.png'])
|
||||
|
||||
% input difference (saturated track only, 1step)
|
||||
clf; plot_input_diff(t{1}, t{3}, U{1}, U{3}, 0, '\textbf{$$v^{trackonly-sat}$$}', '\textbf{$$v^{multistep}$$}', '\textbf{$$\omega^{trackonly-sat}$$}', '\textbf{$$\omega^{multistep}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_track_multistep_1x2.png'])
|
||||
clf; plot_input_diff(t{1}, t{3}, U{1}, U{3}, 1, '\textbf{$$v^{trackonly-sat}$$}', '\textbf{$$v^{multistep}$$}', '\textbf{$$\omega^{trackonly-sat}$$}', '\textbf{$$\omega^{multistep}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_track_multistep_2x1.png'])
|
||||
|
||||
|
||||
% input difference (1-step, multistep)
|
||||
clf; plot_input_diff(t{2}, t{3}, U{2}, U{3}, 0, '\textbf{$$v^{1step}$$}', '\textbf{$$v^{multistep}$$}', '\textbf{$$\omega^{1step}$$}', '\textbf{$$\omega^{multistep}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_1step_multistep_1x2.png'])
|
||||
clf; plot_input_diff(t{2}, t{3}, U{2}, U{3}, 1, '\textbf{$$v^{1step}$$}', '\textbf{$$v^{multistep}$$}', '\textbf{$$\omega^{1step}$$}', '\textbf{$$\omega^{multistep}$$}')
|
||||
export_fig(gcf, '-transparent', [dir, 'input_diff_1step_multistep_2x1.png'])
|
||||
%}
|
||||
>>>>>>> c772cb1 (plots: increase font size for better reading in ppt)
|
||||
end
|
|
@ -11,17 +11,17 @@ subplot(2,1,1);
|
|||
end
|
||||
|
||||
hold on
|
||||
plot(t, U_track(:, 1), 'Linewidth', 5, 'DisplayName', '\omega_r^{track}');
|
||||
plot(t, U_corr(:, 1), 'Linewidth', 5, 'DisplayName', '\omega_r^{corr}');
|
||||
legend('FontSize', 12, 'Location', 'east', 'AutoUpdate','off')
|
||||
plot(t, U_track(:, 1), 'Linewidth', 8, 'DisplayName', '\omega_r^{track}');
|
||||
plot(t, U_corr(:, 1), 'Linewidth', 8, 'DisplayName', '\omega_r^{corr}');
|
||||
legend('FontSize', 22, 'Location', 'east', 'AutoUpdate','off')
|
||||
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 22, 'Interpreter','latex');
|
||||
hold off
|
||||
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=22;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
@ -34,15 +34,15 @@ subplot(2,1,2);
|
|||
end
|
||||
|
||||
hold on
|
||||
plot(t, U_track(:, 2), 'Linewidth', 5, 'DisplayName', '\omega_l^{track}');
|
||||
plot(t, U_corr(:, 2), 'Linewidth', 5, 'DisplayName', '\omega_l^{corr}');
|
||||
legend('FontSize', 12, 'Location', 'east', 'AutoUpdate','off')
|
||||
plot(t, U_track(:, 2), 'Linewidth', 8, 'DisplayName', '\omega_l^{track}');
|
||||
plot(t, U_corr(:, 2), 'Linewidth', 8, 'DisplayName', '\omega_l^{corr}');
|
||||
legend('FontSize', 22, 'Location', 'east', 'AutoUpdate','off')
|
||||
plot(t, ones(1,length(t))*sat(2), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
plot(t, -ones(1,length(t))*sat(2), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 22, 'Interpreter','latex');
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=22;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
|
12
plot_error.m
12
plot_error.m
|
@ -5,20 +5,20 @@ function plot_error(t,ref,x)
|
|||
ey = ref(:, 2) - x(:, 2);
|
||||
|
||||
error_norm = sqrt(ex.*ex + ey.*ey);
|
||||
plot(t, error_norm, 'Linewidth', 5, 'DisplayName', 'norm of error [m]');
|
||||
plot(t, error_norm, 'Linewidth', 8, 'DisplayName', 'norm of error [m]');
|
||||
|
||||
avg = ones(1, length(error_norm)) * error_norm / length(error_norm);
|
||||
plot(t, avg*ones(1, length(error_norm)), 'DisplayName', 'average error [m]', 'LineWidth', 3);
|
||||
plot(t, avg*ones(1, length(error_norm)), 'DisplayName', 'average error [m]', 'LineWidth', 4);
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=22;
|
||||
Axes.FontWeight='bold';
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
grid minor;
|
||||
|
||||
legend('FontSize', 12, 'Location', 'northeast', 'AutoUpdate','off')
|
||||
xlabel("\textbf{t [s]}", FontSize=18, Interpreter="latex")
|
||||
ylabel("\textbf{tracking error}", FontSize=18, Interpreter="latex")
|
||||
legend('FontSize', 22, 'Location', 'northeast', 'AutoUpdate','off')
|
||||
xlabel("\textbf{t [s]}", FontSize=22, Interpreter="latex")
|
||||
ylabel("\textbf{tracking error}", FontSize=22, Interpreter="latex")
|
||||
|
||||
hold off
|
||||
end
|
30
plot_input.m
30
plot_input.m
|
@ -1,35 +1,47 @@
|
|||
function plot_input(t, sat, U, type)
|
||||
function plot_input(t, sat, U, type, orient)
|
||||
|
||||
|
||||
tiledlayout(1,1,'Padding','tight', 'TileSpacing','compact')
|
||||
nexttile
|
||||
|
||||
if orient == 0
|
||||
subplot(1,2,1);
|
||||
else
|
||||
subplot(2,1,1);
|
||||
end
|
||||
|
||||
hold on
|
||||
plot(t, U(:, 1), 'Linewidth', 5);
|
||||
plot(t, U(:, 1), 'Linewidth', 8);
|
||||
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 18, 'Interpreter','latex');
|
||||
ylabel(['\textbf{$$w_r^{' type '}$$[rad/s]}'], 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'Interpreter','latex');
|
||||
ylabel(['\textbf{$$v^{' type '}$$[rad/s]}'], 'Interpreter','latex');
|
||||
hold off
|
||||
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=26;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
||||
|
||||
if orient == 0
|
||||
subplot(1,2,2);
|
||||
else
|
||||
subplot(2,1,2);
|
||||
end
|
||||
|
||||
hold on
|
||||
plot(t, U(:, 2), 'Linewidth', 5);
|
||||
plot(t, U(:, 2), 'Linewidth', 8);
|
||||
plot(t, ones(1,length(t))*sat(2), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
plot(t, -ones(1,length(t))*sat(2), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 18, 'Interpreter','latex');
|
||||
ylabel(['\textbf{$$w_l^{' type '}$$[rad/s]}'], 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'Interpreter','latex');
|
||||
ylabel(['\textbf{$$\omega^{' type '}$$[rad/s]}'], 'Interpreter','latex');
|
||||
hold off
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=26;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
|
|
@ -21,11 +21,11 @@ else
|
|||
subplot(2,1,1);
|
||||
end
|
||||
plot(t, U_corr1(:, 1) - U_corr2(:,1), 'Linewidth', 5);
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 24, 'Interpreter','latex');
|
||||
ylabel([name1_1 '-' name1_2], 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'Interpreter','latex');
|
||||
ylabel([name1_1 '-' name1_2], 'Interpreter','latex');
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=26;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
@ -37,11 +37,11 @@ else
|
|||
subplot(2,1,2);
|
||||
end
|
||||
plot(t, U_corr1(:, 2) - U_corr2(:,2), 'Linewidth', 5);
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 24, 'Interpreter','latex');
|
||||
ylabel([name2_1 '-' name2_2], 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'Interpreter','latex');
|
||||
ylabel([name2_1 '-' name2_2], 'Interpreter','latex');
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=26;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
|
|
@ -11,18 +11,18 @@ subplot(2,1,1);
|
|||
end
|
||||
|
||||
hold on
|
||||
plot(t, U_track(:, 1), 'Linewidth', 5, 'DisplayName', '\omega_r^{track}');
|
||||
plot(t, U_corr(:, 1), 'Linewidth', 5, 'DisplayName', '\omega_r^{corr}');
|
||||
plot(t, U(:, 1), 'Linewidth', 2.8, 'DisplayName', '\omega');
|
||||
legend('FontSize', 12, 'Location', 'northeast', 'AutoUpdate','off')
|
||||
plot(t, U_track(:, 1), 'Linewidth', 8, 'DisplayName', '\omega_r^{track}');
|
||||
plot(t, U_corr(:, 1), 'Linewidth',8, 'DisplayName', '\omega_r^{corr}');
|
||||
plot(t, U(:, 1), 'Linewidth', 4, 'DisplayName', '\omega');
|
||||
legend('FontSize', 22, 'Location', 'northeast', 'AutoUpdate','off')
|
||||
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 22, 'Interpreter','latex');
|
||||
hold off
|
||||
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=22;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
@ -35,16 +35,16 @@ subplot(2,1,2);
|
|||
end
|
||||
|
||||
hold on
|
||||
plot(t, U_track(:, 2), 'Linewidth', 5, 'DisplayName', '\omega_l^{track}');
|
||||
plot(t, U_corr(:, 2), 'Linewidth', 5, 'DisplayName', '\omega_l^{corr}');
|
||||
plot(t, U(:, 2), 'Linewidth', 2.8, 'DisplayName', '\omega_l');
|
||||
legend('FontSize', 12, 'Location', 'northeast', 'AutoUpdate','off')
|
||||
plot(t, U_track(:, 2), 'Linewidth', 8, 'DisplayName', '\omega_l^{track}');
|
||||
plot(t, U_corr(:, 2), 'Linewidth', 8, 'DisplayName', '\omega_l^{corr}');
|
||||
plot(t, U(:, 2), 'Linewidth', 4, 'DisplayName', '\omega_l');
|
||||
legend('FontSize', 22, 'Location', 'northeast', 'AutoUpdate','off')
|
||||
plot(t, ones(1,length(t))*sat(2), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
plot(t, -ones(1,length(t))*sat(2), 'Linewidth', 2.5, 'LineStyle', '--');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 18, 'Interpreter','latex');
|
||||
xlabel('\textbf{t[s]}', 'FontSize', 22, 'Interpreter','latex');
|
||||
|
||||
Axes = gca;
|
||||
Axes.FontSize=18;
|
||||
Axes.FontSize=22;
|
||||
Axes.FontWeight='bold';
|
||||
grid minor;
|
||||
Axes.PlotBoxAspectRatio = [1 1 1];
|
||||
|
|
Loading…
Reference in New Issue