-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun.m
34 lines (29 loc) · 803 Bytes
/
run.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
out = []
for i = 1:1000
fscale = 25000
fk = [0 fscale 0]'
tac = mod( randi(100), 3)
switch tac
% straight
case 0
fk = [0 0 0]'
% left
case 1
fk = [0 fscale 0]'
% right
case 2
fk = [0 -fscale 0]'
otherwise
warning('Unexpected')
end
% add up some variance with gaussion distribution
var = fscale/4
r = -var + (var+var)*rand(3,1)
fk =fk+r
%run
sim('maneuver_generator')
%downsampling, getting 10 time step samles makes a more sparse sample
%ts1 = getsamples(ts, ts.time([2 3]))
sample = [ traj.data(:,1), traj.data(:,2), traj.data(:,3), traj.data(:,4), traj.time ]
out = [out;sample];
end