This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
forked from andybarry/simflight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlightLog.m
147 lines (131 loc) · 4.02 KB
/
FlightLog.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
classdef FlightLog
properties
date;
log_number;
stabilization_trajectory = 0;
hostname;
trajlib_path;
trajlib;
name = 'field-test';
% data
MAV_STATE_EST_INITIALIZER
MAV_STATE_EST_INIT_COMPLETE
STATE_ESTIMATOR_STATE
airspeed
airspeed_unchecked
altimeter
altitude_reset
arm_for_takeoff
battery
beep
cpu
est
git_status_AAAZZZA
git_status_odroid_cam
git_status_odroid_gps
gps
imu
log_info_odroid_cam
log_info_odroid_gps
rad_to_servo
rc_switch_action
rc_trajectory_commands
servo_minmaxtrim
servo_to_rad
sideslip
state_machine_state
stereo
stereo_control
stereo_monitor
tvlqr
tvlqr_out
u
log
t_start;
t_end;
end
methods
function obj = FlightLog(date, plane_number, log_number, trajlib)
obj.date = date;
obj.log_number = log_number;
obj.hostname = ['odroid-gps' num2str(plane_number)];
obj.trajlib = trajlib;
% load the data
%disp(['Loading ' obj.trajlib_path '...']);
%load(obj.trajlib_path);
%obj.trajlib = lib;
dir = [obj.date '-' obj.name '/' obj.hostname '/'];
filename = ['lcmlog_' strrep(obj.date, '-', '_') '_' obj.log_number '.mat'];
dir_prefix = '/home/abarry/rlg/logs/';
dir = [ dir_prefix dir ];
addpath('/home/abarry/realtime/scripts/logs');
disp(['Loading ' filename '...']);
loadDeltawing
% save data
if (exist('MAV_STATE_EST_INITIALIZER', 'var'))
obj.MAV_STATE_EST_INITIALIZER = MAV_STATE_EST_INITIALIZER;
end
if (exist('MAV_STATE_EST_INIT_COMPLETE', 'var'))
obj.MAV_STATE_EST_INIT_COMPLETE = MAV_STATE_EST_INIT_COMPLETE;
end
if (exist('STATE_ESTIMATOR_STATE', 'var'))
obj.STATE_ESTIMATOR_STATE = STATE_ESTIMATOR_STATE;
end
obj.airspeed = airspeed2;
obj.airspeed_unchecked = airspeed_unchecked;
obj.altimeter = altimeter;
obj.altitude_reset = altitude_reset;
obj.arm_for_takeoff = arm_for_takeoff;
obj.battery = battery;
obj.beep = beep;
obj.cpu = cpu;
obj.est = est;
obj.git_status_AAAZZZA = git_status_AAAZZZA;
if (exist('git_status_odroid_cam1', 'var'))
obj.git_status_odroid_cam = git_status_odroid_cam1;
obj.git_status_odroid_gps = git_status_odroid_gps1;
end
if (exist('git_status_odroid_cam2', 'var'))
obj.git_status_odroid_cam = git_status_odroid_cam2;
obj.git_status_odroid_gps = git_status_odroid_gps2;
end
if (exist('git_status_odroid_cam3', 'var'))
obj.git_status_odroid_cam = git_status_odroid_cam3;
obj.git_status_odroid_gps = git_status_odroid_gps3;
end
obj.gps = gps;
obj.imu = imu;
if (exist('log_info_odroid_cam1', 'var'))
obj.log_info_odroid_cam = log_info_odroid_cam1;
obj.log_info_odroid_gps = log_info_odroid_gps1;
end
if (exist('log_info_odroid_cam2', 'var'))
obj.log_info_odroid_cam = log_info_odroid_cam2;
obj.log_info_odroid_gps = log_info_odroid_gps2;
end
if (exist('log_info_odroid_cam3', 'var'))
obj.log_info_odroid_cam = log_info_odroid_cam3;
obj.log_info_odroid_gps = log_info_odroid_gps3;
end
obj.log_number = log_number;
obj.rad_to_servo = rad_to_servo;
obj.rc_switch_action = rc_switch_action;
obj.rc_trajectory_commands = rc_trajectory_commands;
obj.servo_minmaxtrim = servo_minmaxtrim;
obj.servo_to_rad = servo_to_rad;
obj.sideslip = sideslip;
obj.state_machine_state = state_machine_state;
obj.stereo = stereo2;
if (exist('stereo_control', 'var'))
obj.stereo_control = stereo_control;
end
obj.stereo_monitor = stereo_monitor;
obj.tvlqr = tvlqr;
obj.tvlqr_out = tvlqr_out;
obj.u = u;
obj.log = log42;
% compute start and end for the flight
[obj.t_start, obj.t_end] = FindAutonomousFlight(obj);
end
end
end