mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
*** empty log message ***
This commit is contained in:
@@ -1,24 +1,32 @@
|
||||
|
||||
|
||||
|
||||
function [time, throttle, rpm, amp, thrust, torque] = read_mb_log(filename)
|
||||
|
||||
time=[];
|
||||
rpm_meas=[];
|
||||
throttle=[];
|
||||
rpm=[];
|
||||
amp=[];
|
||||
thrust=[];
|
||||
torque=[];
|
||||
|
||||
no_line = 1;
|
||||
u=mopen(filename,'r');
|
||||
|
||||
while meof(u) == 0,
|
||||
line = mgetl(u, 1);
|
||||
if strindex(line, '#') ~= 1 & length(line) ~= 0,
|
||||
[nb_scan, t, c, p, p_f] = msscanf(1, line, '%f %f %f %f');
|
||||
if nb_scan == 4,
|
||||
time(no_line) = t;
|
||||
throttle(no_line) = c*max_rpm;
|
||||
rpm_sp(no_line) = p;
|
||||
rpm_meas(no_line) =p_f;
|
||||
no_line = no_line + 1;
|
||||
if strindex(line, '#') ~= 1 & length(line) ~= 0,
|
||||
[nb_scan, _time, _throttle, _rpm, _amp, _thrust, _torque] = msscanf(1, line, '%f %f %f %f %f %f');
|
||||
if nb_scan == 6,
|
||||
time = [time _time];
|
||||
throttle = [throttle _throttle];
|
||||
rpm = [rpm _rpm];
|
||||
amp = [amp _amp];
|
||||
thrust = [thrust _thrust];
|
||||
torque = [torque _torque];
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
mclose(u);
|
||||
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user