-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOnlineOwnship.m
30 lines (22 loc) · 1.17 KB
/
OnlineOwnship.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
%% Hasan Hüseyin Sönmez - 01.10.2018
% Online ownship motion generator
% generates ownship states online, can be used with sensor control
% feature. As sensor control vector is estimated during the target state
% estimation process, ownship moves and collects bearing angles (or other
% measurements).
%% Inputs :
% Xown : previous ownship state
% Ucontrol : control vector u consisting ownship motion
% parameters for the next move.
% model : model parameters
% Output : OwnState : New ownship state vector, will be used to collect
% measurements.
function OwnState = OnlineOwnship(Xown, Ucontrol, model)
Heading = Ucontrol(1); % ownship heading for the next step (deg)
Speed = Ucontrol(2); % ownship speed for the next step (m/s)
vx = Speed*sin(Heading*pi/180); % ownship velocity in x coordinate
vy = Speed*cos(Heading*pi/180); % ownship velocity in y coordinate
Xown = [Xown(1), vx, Xown(3), vy]'; % modified ownship state
% new ownship state
OwnState = MarkovTransition(Xown, model, false);
end