Converting data file to CSV or Matlab

Hi, I’m after some help in converting the recorded data file from a BIN to a CSV or a file that can be opened in Matlab. There doesn’t appear to be a function within the Ardupilot mission planner. I’d be grateful for any advice on how to convert. Thanks

A search should help, plenty of people have done this before (except me :slight_smile: )
Check on the Ardupilot forum too.

Hi Daniel,

You can convert ArduPilot .BIN dataflash logs to CSV using the ArduPilot tools.

A common method is using mavlogdump.py:

mavlogdump.py --format csv yourlog.BIN > yourlog.csv

If you only want specific message types, for example GPS, IMU, ATT, etc., you can filter them:

mavlogdump.py --types GPS,IMU,ATT --format csv yourlog.BIN > selected_data.csv

Another practical option is PlotJuggler. It can open ArduPilot .BIN logs and export selected data channels to CSV, which can then be imported into MATLAB.

For MATLAB, I usually find the cleanest workflow is:

  1. Convert .BIN to .csv

  2. Open/import the CSV in MATLAB

  3. Filter the required columns/signals inside MATLAB

Hope this helps.

Dr. Fares Al Dhaheri

Al-Etihad Industrials, UAE

Hi, thank you for your advice I’ll try that.