-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_drift_over_time.m
More file actions
74 lines (63 loc) · 2.03 KB
/
export_drift_over_time.m
File metadata and controls
74 lines (63 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
logfilename = './logs/path_1_long_23_10_31_06_27_14.log';
error_file_name = get_error_file_name(logfilename);
file_read_test(logfilename);
file_read_test();
startEndTimes = get_start_end_times();
startidx = 1;
endidx = length(startEndTimes)-1;
xOverTimeAll = cell(endidx-startidx+1, 1);
yOverTimeAll = cell(endidx-startidx+1, 1);
angleOverTimeAll = cell(endidx-startidx+1, 1);
lidarTimesAll = cell(endidx-startidx+1, 1);
%[mouse_gyro_times, xTransformMG, yTransformMG, angleTransformMG, ...
% xOverTimeMG, yOverTimeMG, angleOverTimeMG] = get_mouse_gyro_pos(time1, time2);
parfor idx = 1:endidx-startidx+1
i = idx + startidx - 1;
time1 = startEndTimes{i};
time2 = startEndTimes{i+1};
[lidar_times, xTransform, yTransform, angleTransform, ...
xOverTime, yOverTime, angleOverTime, rmseOvertime] = lidar_icp_4(logfilename, time1, time2);
xOverTimeAll{idx} = xOverTime';
yOverTimeAll{idx} = yOverTime';
angleOverTimeAll{idx} = angleOverTime';
lidarTimesAll{idx} = lidar_times';
disp(['Progress: ' num2str(i) '/' num2str(endidx-startidx+1)]);
end
writecell(xOverTimeAll, 'xovertimeall.csv');
writecell(yOverTimeAll, 'yovertimeall.csv');
writecell(angleOverTimeAll, 'angleovertimeall.csv');
writecell(lidarTimesAll, 'lidartimesall.csv')
%figure(1);
%clf
%hold on;
%title('X');
%plot(lidar_times, xOverTime, 'b');
%plot(mouse_gyro_times, xOverTimeMG, 'r');
%legend('Lidar', 'Mouse+Gyro');
%figure(2);
%clf
%hold on;
%title('Y');
%plot(lidar_times, yOverTime, 'b');
%plot(mouse_gyro_times, yOverTimeMG, 'r');
%legend('Lidar', 'Mouse+Gyro');
%figure(3);
%clf
%hold on;
%title('Rotation');
%grid on;
%plot((lidar_times-0.009*10^10), angleOverTime, 'b');
%plot(mouse_gyro_times, angleOverTimeMG, 'r');
%figure(4);
%clf
%hold on;
%title('Path');
%plot(xOverTime, yOverTime, 'b');
%plot(xOverTimeMG, yOverTimeMG, 'r');
%legend('Lidar', 'Mouse+Gyro');
%figure(5);
%title('RMSE');
%plot(lidar_times(2:end), rmseOvertime);
%fprintf('x: %f\n', xTransform);
%fprintf('y: %f\n', yTransform);
%fprintf('angle: %f\n', angleTransform);