Strange position oscillations in all vehicles in SITL Gazebo

What is the cause of these strange “half sine wave” oscillations/vibrations in the position data when running a SITL Gazebo simulation? Or how can I find out what causes it?

Command: make px4_sitl_default gazebo_iris
Set 5m apart waypoints in QGC
Execute mission

Ubuntu 18.04
Gazebo 9.18.0
PX4 1.11 (I tried the master branch and it does the same thing)

This shows the vehicle_local_position.x in green and setpoint in pink:

They are consistently 0.4 s apart no matter which vehicle I try.

It affects the flight performance because it causes oscillations in the velocity controller’s commanded acc_sp.
This is the x acceleration setpoint:

It seems to decrease later in the sim:

It is not a fault in the estimator or GPS because it is the same in vehicle_local_position_groundtruth
It is not a PID gains problem because it happens with a custom quadcopter too.

It was happening earlier this month too, but then it went away after a computer restart. Now it is staying.
Could it be a processor problem? Maybe the Gazebo solver cannot complete the calculation in time and gives the wrong result. How could I identify if it is this or not?

the .world solver parameters are set to defaults

Any suggestions where I can look for the cause?

@Murray_Louw This is likely caused by the noise of the accelerometer.

Have you tried comparing ground truth acceleration and the estimated acceleration ?

So is this normal behaviour and happens on your machine too?

I tried to compare groundtruth acceleration but the values in vehicle_local_position_groundtruth for ax, ay, az are constant at 0

The shape in the position log is just very strange to be caused by something like sensor noise. It seems to be a consistent shape and not ragged. Also, it has sharp edges at the bottom peaks but smooth curves at the top. This doesn’t seem like normal behaviour.

But maybe I should just make my controllers more robust to even this