Hello,

I’m trying to extract high frequency batach log data for analysis in MatLab. I tried using this tool pymavlink/tools/extract_batch_imu.py at master · ArduPilot/pymavlink · GitHub. But the resulting file can’t be opened in ArduPilog (Could not find the FMT message to extract its length. Leaving the default 89) and in plot.ardupilot there is an error message (TypeError: Cannot read properties of undefined (reading ‘changeArray’)).

Could someone elaborate how the batch data is implemented? I can read the ISBD and ISBH fields with ArduPilog but I’m a bit clueless on how I can get the acceleration measurements out of there just by looking at the extract_batch_imu.py…

Edit:

I tried simply porting the python code to Matlab and arrived at this:

clear;

clc;

log = Ardupilog(‘Conv_11ms.bin’);

time_us = zeros(0,0);

acc_x = zeros(0,0);

for i =1:numel(log.ISBH.TimeUS)

if log.ISBH.type(i) == 0

%acc data

sample_us = 1.0e6/log.ISBH.smp_rate(i);

tbase = log.ISBH.SampleUS(i) + log.ISBD.seqno(i)32sample_us;

mul = 1.0/log.ISBH.mul(i);

for j = 1:32

time_us(end+1) = tbase + (j-1)*sample_us;

acc_x(end+1) = log.ISBD.x(i,j)*mul;

end

end

end

figure;

plot(time_us/1000000,acc_x);

But the resulting graph returns this, which seems unlikely: