EKF2 replay not determenistic

Hey All,

I’ve been messing around with the EKF2 replay functionality. However, I got 2 problems:

  1. When I run the same .ulg multiple times I get different results. I can fix this by turning on the ENABLE_LOCKSTEP_SCHEDULER to yes in the sitl.cmake file. But I don’t think this is desired. What is going on?
  2. When I replay my data through the ekf2, the output is different than than the output of the .ulg itself. This doesn’t make any sense because it copies the settings from the .ulg on setup. How could this be?

Setup:
px4 software v1.14.2
Laptop: Dell Pro Max 14 MC14250
ulg file: https://logs.px4.io/plot_app?log=eeec98c0-b176-446b-94ca-2f80e9bca90e
This .ulg file was recorded inside (no GPS) and was a first step at merging EV data into the EKF2. So we ran our EV, armed the drone and moved the drone around by hand without the props. So it’s also not a “normal” flight.

Steps to reproduce:

  1. Run container:
docker run -it \
 --privileged \
--rm \
--env=LOCAL_USER_ID=“$(id -u)” \
--network=host \
-v <location_of_px4_repo>:/px4-autopilot:rw \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v <location_of_your_ulgs>:/ulgs:rw \
-e DISPLAY=${DISPLAY} \
--name=px4-autopilot \
px4io/px4-dev-simulation-bionic \
/bin/bash
  1. Set replay options:
    export replay_mode=ekf2
    export replay=/ulgs/<name_of_your_ulg>
  2. Build and run
    make px4_sitl none
  3. Look at some state e.g . estimator_states/states.04 and see it’s the same as the original .ulg file.
  4. Repeat step 3&4.

Hopefully some of you can help me.

If you have any questions or I missed some info please let me know! Looking forward to your replies.

-Martijn

Without ENABLE_LOCKSTEP_SCHEDULER, runs aren’t deterministic because timing + scheduler order changes → different fusion results. lockstep just forces determinism.

for replay ≠ original .ulg — EKF2 isn’t replayed bit-for-bit. timing shifts, delayed fusion, and EV alignment (especially no GPS) will cause differences.

Hey Sarahio,

Thanks for your reply. If the replay is not determenistic and not the same as the recording is ekf2 replay usefull at all?

How representative is it of what is happening in the field?