Using the EKF filter from the python AHRS library I'm trying to estimate the pose of the STEVAL FCU001 board (which has has the LSM6DSL IMU sensor for acceleration + gyro and LIS2MDL for magneto). However the attitude simply never matches up even though the IMU is feeding seemingly perfect good data. In the image below you can see the sensor readout, EKF results both from python (local) and the embedded board EKF version (remote), the latter can be ignored.
The movements I am performing with the board (starting close to the 2000 mark) is 90deg pitch down, neutral, 90deg pitch up, neutral, 90deg roll left, neutral, 90deg roll right, neutral. The euler angles are already wrong at the start (should be x and y close to 0 deg) and never match up.
I'm using the EKF library as follows:
if qpv is None: # qpv is previous quaternion, if any
qpv = [1., 0., 0., 0.]
orientation = ahrs.filters.EKF(frame='NED')
samples = len(acc)
Q = np.tile(qpv, (samples, 1))
for i in range(1, samples):
orientation.Dt = tsd[i][0] / 1000.0 # uses monotonic clock values to calculate time delta between measurements
qp = Q[i - 1]
Q[i] = orientation.update(qp, acc=acc[i], gyr=gyro[i], mag=None)
I've tried every sort of sensor value mapping I could think off (flip x-y axis, flip the sign for one, two or all axis), use the ENU frame instead of NED, using the EKF library with and without the magnetic sensor values ... Sometimes it is correct at the start, but never for the full test sequence.
Additionally I've tried to find a dataset with sample IMU sensor data that would produce the correct results when run through the EKF filter with which I can compare my inputs, but haven't found anything.