Estimated position EKF Errors

Trying to update PX4 and get v1.6.0 running on SDF and the first thing I noticed was a lot of EKF errors. The innovations_check_flag was showing that the YAW was being rejected. So I recalibrated the mag and noticed that the internal mag (ID 4288784) was not showing up anymore but instead I was getting two external mag (ID 4398600) parameters (image attached). This was odd b/c in the previous version I would get both the internal and external mags. Does this have anything to do with it?

Here is a link the flight log. Flight Review

Anyone else using SDF and v1.6.0 seeing this issue?

Can you try deleting the /usr/share/data/adsp/params file. I don’t think we handle changes in the index value of a parameter and this might account for the strange behavior.

The muORB module synchronizes parameters with the aDSP by index and the aDSP saves them as a blob. If the parameters previously saved with an older version are being loaded they may be restoring saves values to the wrong parameters.

I tried deleting the params file and still got the same result of two external mags. Are you able to replicate this error on your hardware?

I did a test where I calibrated the mag with v1.5.4 and then loaded the params using v1.6.0 and both the internal an external mags appeared. I then calibrated a second time with v1.6.0 the internal mag was replaced with duplicate external mag values. This looks like a bug in v1.6.0 calibration routing for the snapdragon flight.

I still have this issue with v1.6.5 and it could be a bug.

Whenever I calibrate with qgroundcontrol the internal mag calibration is replace with the external mag values. It’s appears twice in the parameters list. Attached is an example and output from the ecl_tool.

calibration with v1.5.4

CAL_MAG0_ID,4398600
CAL_MAG0_ROT,-1
CAL_MAG0_XOFF,0.0420045889914
CAL_MAG0_XSCALE,1.0
CAL_MAG0_YOFF,-0.0336707979441
CAL_MAG0_YSCALE,1.0
CAL_MAG0_ZOFF,0.0498945452273
CAL_MAG0_ZSCALE,1.0
CAL_MAG1_ID,4288784
CAL_MAG1_ROT,-1
CAL_MAG1_XOFF,0.620152294636
CAL_MAG1_XSCALE,1.0
CAL_MAG1_YOFF,0.0276199914515
CAL_MAG1_YSCALE,1.0
CAL_MAG1_ZOFF,0.278819054365
CAL_MAG1_ZSCALE,1.0
CAL_MAG2_ID,0
CAL_MAG2_ROT,-1
CAL_MAG2_XOFF,0.0
CAL_MAG2_XSCALE,1.0
CAL_MAG2_YOFF,0.0
CAL_MAG2_YSCALE,1.0
CAL_MAG2_ZOFF,0.0
CAL_MAG2_ZSCALE,1.0
CAL_MAG_PRIME,4398600

calibration with 1.6.5

CAL_MAG0_ID,4398600
CAL_MAG0_ROT,0
CAL_MAG0_XOFF,0.0415548346937
CAL_MAG0_XSCALE,1.0
CAL_MAG0_YOFF,-0.0413397215307
CAL_MAG0_YSCALE,1.0
CAL_MAG0_ZOFF,0.0507863648236
CAL_MAG0_ZSCALE,1.0
CAL_MAG1_ID,4398600
CAL_MAG1_ROT,-1
CAL_MAG1_XOFF,0.0415548346937
CAL_MAG1_XSCALE,1.0
CAL_MAG1_YOFF,-0.0413397215307
CAL_MAG1_YSCALE,1.0
CAL_MAG1_ZOFF,0.0507863648236
CAL_MAG1_ZSCALE,1.0
CAL_MAG2_ID,0
CAL_MAG2_ROT,-1
CAL_MAG2_XOFF,0.0
CAL_MAG2_XSCALE,1.0
CAL_MAG2_YOFF,0.0
CAL_MAG2_YSCALE,1.0
CAL_MAG2_ZOFF,0.0
CAL_MAG2_ZSCALE,1.0
CAL_MAG3_ID,0
CAL_MAG3_ROT,-1
CAL_MAG3_XOFF,0.0
CAL_MAG3_XSCALE,1.0
CAL_MAG3_YOFF,0.0
CAL_MAG3_YSCALE,1.0
CAL_MAG3_ZOFF,0.0
CAL_MAG3_ZSCALE,1.0
CAL_MAG_PRIME,4398600

20171107T180212.ulg.pdf (640.6 KB)
20171107T181838.ulg.pdf (604.1 KB)

I found a bug in mag_calibration.cpp . I’ve opened an issue.
To summarize, for all platform other than NUTTX, it always uses same orb handle for all mag subscriptions.