I am trying to provide external position and heading to Ardupilot. I used ArduSub framework as it seems it is often used in that case.
I got GPS_Input working as described in ardusub book GPS_INPUT , however the last Extension parameter provided in latest Mavlink GPS_INPUT ( #232 ) (pymavlink 2.4.39), which is Yaw, does not seem to be used by the ardupilot for heading.
And this is the problem. I need to use external heading to run the vehicle.
I can see via Mavlink inspector that the yaw is decoded in Ardupilot, but the vehicle is not using it for navigation.
By the way, using the GPS_INFO mavlink message is not the recommended way to get an external position and attitude estimate into ArduPilot. Instead we recommend using the AP_VisualOdometry library that accepts many similarly but slightly different mavlink messages including VISION_POSITION_ESTIMATE and VISION_SPEED_ESTIMATE. The advantage of doing it this way is that GPS/Non-GPS transitions will work.
I enabled the EK3_SRC1_YAW = 2 (GPS) and there is no change it seems.
But I am starting to think that what I see on the screen is a bit confusing, as it could be that KF is fusing the internal gyros with externally provided yaw from GPS_Input. And what I see on the screen is just some sort of combination of these two.
I tried to play with other parameters forcing the GPS yaw to be more dominant, but this effort failed.
Is there a way to completely disable internal gyro and only use external yaw?
How do I see what EKF uses for it’s computation? Is there any hook for that?
I think I got that working. The key for me was to understand that the internal gyro cannot be disabled (this link) and it is always blended with the externally provided yaw. So the KF will just take its time to blend them and I was not patient enough to see that happening.
I still would like to demote the internal gyro and promote externally provided yaw if you knew how to do that?
You don’t do that. The internal gyro doesn’t have its own yaw reference and aligns to due north without an external one. Once aligned, it helps fill in the gaps between external updates. That’s the crux of EKF sensor fusion.
It is possible to change the balance between the absolute yaw sensor (e.g. compass, external yaw) and the gyro so that one or the other has more of an impact. The parameter is EK3_YAW_M_NSE (I think). So lowering it says that the yaw measurement can be trusted more so it will have a large impact on the attitude estimate. That’s the theory at least… I haven’t played with it myself.