forked from ZouCheng321/fusion_kitti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_demoVehiclePath.m
36 lines (31 loc) · 975 Bytes
/
run_demoVehiclePath.m
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
function run_demoVehiclePath (base_dir)
% KITTI RAW DATA DEVELOPMENT KIT
%
% Plots OXTS poses of a sequence
%
% Input arguments:
% base_dir .... absolute path to sequence base directory (ends with _sync)
% clear and close everything
clear all; close all; dbstop error; clc;
disp('======= KITTI DevKit Demo =======');
% sequence base directory
if nargin<1
base_dir = '/mnt/karlsruhe_dataset/2011_09_26/2011_09_26_drive_0009_sync';
end
% load oxts data
oxts = loadOxtsliteData(base_dir);
% transform to poses
pose = convertOxtsToPose(oxts);
% plot every 10'th pose
figure; hold on; axis equal;
l = 3; % coordinate axis length
A = [0 0 0 1; l 0 0 1; 0 0 0 1; 0 l 0 1; 0 0 0 1; 0 0 l 1]';
for i=1:10:length(pose)
B = pose{i}*A;
plot3(B(1,1:2),B(2,1:2),B(3,1:2),'-r','LineWidth',2); % x: red
plot3(B(1,3:4),B(2,3:4),B(3,3:4),'-g','LineWidth',2); % y: green
plot3(B(1,5:6),B(2,5:6),B(3,5:6),'-b','LineWidth',2); % z: blue
end
xlabel('x');
ylabel('y');
zlabel('z');