File: viewPTG.m

package info (click to toggle)
mrpt 1%3A2.15.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 92,456 kB
  • sloc: cpp: 555,366; ansic: 36,840; xml: 3,872; python: 2,195; sh: 524; makefile: 232
file content (39 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (6)
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
% Usage: viewPTG('./reactivenav.logs/PTGs',1) 
function [] = viewPTG(dir, nPTG)

% Load data
xs=load(sprintf('%s/PTG%i_x.txt',dir,nPTG));
ys=load(sprintf('%s/PTG%i_y.txt',dir,nPTG));
phis=load(sprintf('%s/PTG%i_phi.txt',dir,nPTG));
ds=load(sprintf('%s/PTG%i_d.txt',dir,nPTG));

% Dims:
nTrajs  = size(xs,1);
nPoints = size(xs,2);

% Check sizes:
assert(size(ys,1)==nTrajs);
assert(size(phis,1)==nTrajs);
assert(size(ds,1)==nTrajs);

% Draw paths:
DECIM = 1;  % Decimation (dont draw all)

figure(1);
clf;
for alpha=1:DECIM:nTrajs,
  x=xs(alpha,:);
  y=ys(alpha,:);
  plot(x,y,'-k'); hold on; 
end
axis equal;
title('Paths (x,y)');

figure(2);
clf;
for alpha=1:50:nTrajs,
  plot(ds(alpha,:)); hold on; 
end
title('distance over timesteps for each path');

end