Select a portion of the log and export a new log file based on this filter

Hi all , I would like to know if there is a script possibly one written in python , that given a log “example.bin” , can export an “example_trimmed.log” , which is a version of example.log but “trimmed” based on a start time and end time.
Example :
The log lasts 20 minutes , but I am interested in getting a log_trimmed.bin from minute 10 to minute 15 from the start of the log . Is it possible to do this ? Thanks to all

It is possible to do it in MATLAB using the adupilog library/script. And pymavlink can probably do it too. Have you tried it?

mavextract.py --mode CRUISE --condition ‘ATT.TimeUS>214384212’ 00000003.BIN

will extract all cruise-mode records from log 00000003.bin which match the condition to binary files named CRUISEnn.bin

2 Likes

Thanks!
I’ll try that right now … so you use TimeUS , the time in Us from the boot of the vehicle .

I have another question , this method works well . But can i combine multiple condition ? To define a start time and end time ?
Like ATT.TimeUS>180000000**&&** ATT.TimeUS<615016724" ?

Example syntax for multiple conditions is:
–condition ‘GPS.TimeUS>6000000 and GPS.TimeUS<8000000’