-
Notifications
You must be signed in to change notification settings - Fork 35
/
TrimU.m
38 lines (27 loc) · 1.91 KB
/
TrimU.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
37
38
function u = TrimU(start_time, end_time, u_in)
u.utime = TrimTimes(start_time, end_time, u_in.logtime, u_in.utime);
u.throttle = TrimTimes(start_time, end_time, u_in.logtime, u_in.throttle);
u.elevonL = TrimTimes(start_time, end_time, u_in.logtime, u_in.elevonL);
u.elevonR = TrimTimes(start_time, end_time, u_in.logtime, u_in.elevonR);
u.is_autonomous = TrimTimes(start_time, end_time, u_in.logtime, u_in.is_autonomous);
u.video_record = TrimTimes(start_time, end_time, u_in.logtime, u_in.video_record);
u.trim = u_in.trim;
u.rad.elevonL = TrimTimes(start_time, end_time, u_in.logtime, u_in.rad.elevonL);
u.rad.elevonR = TrimTimes(start_time, end_time, u_in.logtime, u_in.rad.elevonR);
u.rad.throttle = TrimTimes(start_time, end_time, u_in.logtime, u_in.rad.throttle);
u.rad.trim = u_in.rad.trim;
for i = 1 : 3
u.rad.zeroed_vector(:,i) = TrimTimes(start_time, end_time, u_in.logtime, u_in.rad.zeroed_vector(:,i));
end
u.cmd.utime = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.utime);
u.cmd.throttle = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.throttle);
u.cmd.elevonL = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.elevonL);
u.cmd.elevonR = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.elevonR);
u.cmd.is_autonomous = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.is_autonomous);
u.cmd.video_record = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.video_record);
u.cmd.rad.elevonL = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.rad.elevonL);
u.cmd.rad.elevonR = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.rad.elevonR);
u.cmd.rad.throttle = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.rad.throttle);
u.cmd.logtime = TrimTimes(start_time, end_time, u_in.cmd.logtime, u_in.cmd.logtime);
u.logtime = TrimTimes(start_time, end_time, u_in.logtime, u_in.logtime);
end