-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotPose.asv
53 lines (35 loc) · 1023 Bytes
/
plotPose.asv
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
function plotPose()
inputFile = 'G:\matlab\data\vio_pose\imupose.txt';
Data = load(inputFile);
poseMat = [];
for i = 1 : size(Data,1)
data = Data(i,:);
xyzw = data(1:4);
trans = data(5:7);
% R2 = quatern2rotMat(xyzw([4 1 2 3]));
R = quat2rotm(xyzw([4 1 2 3]));
poseMat = [poseMat; [reshape(R,1,9), trans]];
% rotm2quat(R)
% rotMat2quatern(R2)
end
inputFile = 'G:\matlab\data\vio_pose\output.txt';
inputFile = 'G:\matlab\data\vio_pose\output_ref.txt';
% inputFile = 'G:\matlab\data\vio_pose\output_ref_cam0.txt';
% inputFile = 'G:\matlab\data\vio_pose\output_direct_cam0.txt';
Data = load(inputFile);
poseMat = [];
T = {};
time = [];
for i = 1 : size(Data,1)
data = Data(i,:);
time = [time; data(1)];
trans = data(2:4);
xyzw = data(5:8);
% R = quatern2rotMat(xyzw([4 1 2 3]));
R2 = quat2rotm(xyzw([4 1 2 3]));
T{i,1} = [R2 trans';0 0 0 1];
poseMat = [poseMat; [reshape(R2,1,9), trans]];
% rotm2quat(R2)
% rotMat2quatern(R)
end
end