Run EKF using custom log data

I have been exploring the code base and SITL but I haven’t found what I am looking for so that’s why I post here. What I want to do is feed my own data to the EKF implementation of ardupilot. It seems to be the best open source implementation around. My data is of the form of IMU measurements and GPS updates (with the IMU measurements having a higher frequency than the GPS updates). How would I run a simulation where the sensor data is taken from my custom log file? What I am interested in is to see how the EKF fuses the measurements of GPS and IMU. I don’t necessarily want to visualize it using the map provided by SITL, I would just want to have the adjusted positions and velocities as a text output.

Apologies if this is the wrong place to post.


I am trying to solve the same problem.

I had some success using the code in
However, there was some drift between the output from this code and the original estimates on the dataflashlog. This happened perhaps because of data format mismatch between the flash logs from my latest firmware and the input format of this code (although I tried do the appropriate modifications). Hope this might be helpful to you.

Wondering if you had any progress getting the custom log data run through the EKF in the main code base.


I will be sure to update if I manage to resolve it. The main problem seems to be getting the filter to accept the GPS measurements. My moving objects are on land, so there’s less danger of strange GPS measurements crashing the system.

I looked at the github you sent, it seems to require in addition to GPS, IMU and MAG (which I have) also NTUN and ATT messages which I don’t have. Can I do without them? The attitude is what I’m trying to compute with the EKF.