2024-09-11 19:34:41 +02:00
|
|
|
clc
|
2024-08-13 11:45:36 +02:00
|
|
|
clear all
|
|
|
|
close all
|
|
|
|
|
|
|
|
disp('Creating figure')
|
2024-08-31 13:31:35 +02:00
|
|
|
figure('units','normalized','outerposition',[0 0 1 1])
|
2024-08-13 11:45:36 +02:00
|
|
|
disp('Photos will start in 3s')
|
|
|
|
pause(3)
|
|
|
|
|
|
|
|
PLOT_TESTS = [
|
2024-09-21 11:46:33 +02:00
|
|
|
"results-unicycle-costfun2-soltraj/circle/start_center/21-09-2024-15-29-40"
|
|
|
|
"results-diffdrive-costfun2-soltraj/circle/start_center/21-09-2024-12-16-00"
|
2024-08-13 11:45:36 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
s_ = size(PLOT_TESTS)
|
|
|
|
for i = 1:s_(1)
|
|
|
|
clearvars -except PLOT_TESTS s_ i
|
|
|
|
|
|
|
|
sPLOT_TEST = convertStringsToChars(PLOT_TESTS(i));
|
|
|
|
PLOT_TEST = [sPLOT_TEST, '/workspace_composite.mat']
|
|
|
|
load(PLOT_TEST)
|
|
|
|
|
2024-09-21 11:46:33 +02:00
|
|
|
dir = ['images-', ROBOT, '-costfun2-soltraj/', sPLOT_TEST, '/']
|
2024-08-13 11:45:36 +02:00
|
|
|
mkdir(dir);
|
2024-09-06 15:49:49 +02:00
|
|
|
|
2024-08-13 11:45:36 +02:00
|
|
|
for n=1:3
|
2024-09-11 19:34:41 +02:00
|
|
|
in1 = sim_data{n}.input1_name;
|
|
|
|
in2 = sim_data{n}.input2_name;
|
|
|
|
m1 = sim_data{n}.m1;
|
|
|
|
m2 = sim_data{n}.m2;
|
|
|
|
|
|
|
|
pause(1); clf; plot_trajectory(t{n}, ref_t{n}, q{n})
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_trajectory.png'])
|
|
|
|
pause(1); clf; plot_error(t{n}, ref_t{n}, q{n})
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_error.png'])
|
2024-09-13 20:25:25 +02:00
|
|
|
|
2024-09-11 19:34:41 +02:00
|
|
|
%pause(1); clf; plot_input(t{n}, sim_data{n}.SATURATION, U_track{n}, 'track')
|
|
|
|
%pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_track_input.png'])
|
|
|
|
%pause(1); clf; plot_input(t{n}, sim_data{n}.SATURATION, U_corr{n}, 'corr')
|
|
|
|
%pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_corr_input.png'])
|
2024-09-11 15:05:20 +02:00
|
|
|
|
2024-09-11 19:34:41 +02:00
|
|
|
pause(1); clf; plot_input(t{n},sim_data{n}.SATURATION, U{n}, 0, '', in1, in2, m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_total_input_1x2.png'])
|
|
|
|
pause(1); clf; plot_input(t{n},sim_data{n}.SATURATION, U{n}, 1, '', in1, in2, m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_total_input_2x1.png'])
|
2024-09-13 20:25:25 +02:00
|
|
|
|
|
|
|
pause(1); clf; plot_trajectory(t{n}, ref_t{n}, y{n})
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_trajectory_out.png'])
|
|
|
|
pause(1); clf; plot_error(t{n}, ref_t{n}, y{n})
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, num2str(n), '_error_out.png'])
|
2024-08-13 11:45:36 +02:00
|
|
|
end
|
2024-09-07 09:43:08 +02:00
|
|
|
|
2024-09-11 19:34:41 +02:00
|
|
|
% input difference (saturated track only, 1-step)
|
|
|
|
pause(1); clf; plot_input_diff(t{1}, t{2}, U{1}, U{2}, 0, ['\textbf{$$' in1 '^{trackonly-sat}$$}'], ['\textbf{$$' in1 '^{1step}$$}'], ['\textbf{$$' in2 '^{trackonly-sat}$$}'], ['\textbf{$$' in2 '^{1step}$$}'], m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, 'input_diff_track_1step_1x2.png'])
|
|
|
|
pause(1); clf; plot_input_diff(t{1}, t{2}, U{1}, U{2}, 1, ['\textbf{$$' in1 '^{trackonly-sat}$$}'], ['\textbf{$$' in1 '^{1step}$$}'], ['\textbf{$$' in2 '^{trackonly-sat}$$}'], ['\textbf{$$' in2 '^{1step}$$}'], m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, 'input_diff_track_1step_2x1.png'])
|
|
|
|
|
2024-09-06 15:49:49 +02:00
|
|
|
% input difference (saturated track only, multistep)
|
2024-09-11 19:34:41 +02:00
|
|
|
pause(1); clf; plot_input_diff(t{1}, t{3}, U{1}, U{3}, 0, ['\textbf{$$' in1 '^{trackonly-sat}$$}'], ['\textbf{$$' in1 '^{multistep}$$}'], ['\textbf{$$' in2 '^{trackonly-sat}$$}'], ['\textbf{$$' in2 '^{multistep}$$}'], m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, 'input_diff_track_multistep_1x2.png'])
|
|
|
|
pause(1); clf; plot_input_diff(t{1}, t{3}, U{1}, U{3}, 1, ['\textbf{$$' in1 '^{trackonly-sat}$$}'], ['\textbf{$$' in1 '^{multistep}$$}'], ['\textbf{$$' in2 '^{trackonly-sat}$$}'], ['\textbf{$$' in2 '^{multistep}$$}'], m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, 'input_diff_track_multistep_2x1.png'])
|
|
|
|
|
2024-09-07 09:43:08 +02:00
|
|
|
% input difference (1-step, multistep)
|
2024-09-11 19:34:41 +02:00
|
|
|
pause(1); clf; plot_input_diff(t{2}, t{3}, U{2}, U{3}, 0, ['\textbf{$$' in1 '^{1step}$$}'], ['\textbf{$$' in1 '^{multistep}$$}'], ['\textbf{$$' in2 '^{1step}$$}'], ['\textbf{$$' in2 '^{multistep}$$}'], m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, 'input_diff_1step_multistep_1x2.png'])
|
|
|
|
pause(1); clf; plot_input_diff(t{2}, t{3}, U{2}, U{3}, 1, ['\textbf{$$' in1 '^{1step}$$}'], ['\textbf{$$' in1 '^{multistep}$$}'], ['\textbf{$$' in2 '^{1step}$$}'], ['\textbf{$$' in2 '^{multistep}$$}'], m1, m2)
|
|
|
|
pause(0.5); export_fig(gcf, '-transparent', [dir, 'input_diff_1step_multistep_2x1.png'])
|
2024-08-13 11:45:36 +02:00
|
|
|
end
|