# External Yaw in GPS\_Input does not seem to work

**URL:** <https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794>\
**Category:** ArduSub\
**Tags:** ardusub, pymavlink\
**Created:** [July 28, 2023, 4:22pm UTC](https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794 "2023-07-28T16:22:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@Pawel](https://discuss.bluerobotics.com/u/Pawel)\
**Post date:** [July 28, 2023, 4:22pm UTC](https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794/1 "2023-07-28T16:22:10Z")

</div>

Hello

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](https://mavlink.io/en/messages/common.html#GPS_INPUT) , however the last Extension parameter provided in latest Mavlink GPS\_INPUT ([#232](https://mavlink.io/en/messages/common.html#GPS_INPUT)) (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.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/8/8bf2ec0b56ba04e45c22a8e0092f8ba280631d66.png)

Over the past few days I fiddled with several parameters below at no avail.

GPS\_TYPE = MAV(14)  
EK3\_SRC1\_YAW 6 - External Nav  
AHRS\_EKF\_TYPE 11 tried 0 and 3  
FS\_EKF\_THRESH 0  
AHRS\_GPS\_USE 1, tried 2 as well

Also tried  
GPS\_type2 14 - 2nd GPSExternal MAV  
FS\_EKF\_THRESH 0 (changed to 0 just to Off failsafe actions)  
GPS\_AUTO\_CONFIG 0 - disable automatic GPS config

I can disable the onboard INS with  
INS\_USE 0  
INS\_USE2 0  
INS\_USE3 0  
All it did is to disabled the internal yaw, but still is not using the one provided by GPSP\_INPUT.

Also tried  
COMPASS\_ENABLE 0  
COMPASS\_USE 0  
COMAPSS\_USE2 0  
COMAPSS\_USE3 0  
COMPASS\_EXTERNAL 2  
COMPASS\_EXTERN 0 - force internal compass  
COMPASS\_EXTERN2 2 - force use extremal compass  
COMPASS\_EXTERN3 2 - force use extremal compass

EK3\_ENABLE 0 tried with 1  
EK2\_ENABLE 0 tried with 1

Nothing what I do seems to force the vehicle to use the heading coming from external GPS\_Input message.

Can anybody help? How to make ardupilot using the yaw from GPS\_Input?  
I have been spinning wheels for days now.

thanks in advance.  
Pawel

---

<div class="post-metadata">

**Author:** ![Pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@Pawel](https://discuss.bluerobotics.com/u/Pawel)\
**Post date:** [July 28, 2023, 4:24pm UTC](https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794/2 "2023-07-28T16:24:55Z")

</div>

Related to [this](https://discuss.bluerobotics.com/t/external-gps-ardusub-mavlink/8164) discussion

---

<div class="post-metadata">

**Author:** ![Pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@Pawel](https://discuss.bluerobotics.com/u/Pawel)\
**Post date:** [July 31, 2023, 3:54pm UTC](https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794/3 "2023-07-31T15:54:52Z")

</div>

I think I got that working. The key for me was to understand that the internal gyro cannot be disabled ([this link](https://discuss.ardupilot.org/t/gps-and-nav-data-over-mavlink-and-pymavlink/104235/6)) 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?

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [August 2, 2023, 5:06am UTC](https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794/4 "2023-08-02T05:06:33Z")

</div>

Hi @Pawel, welcome to the forum 🙂

If you’re wanting the autopilot to preferentially use GPS messages for its yaw input then I suspect you’ll need to set [`EK3_SRC1_YAW`](https://docs.bluerobotics.com/ardusub-zola/software/autopilot/ArduSub-4.1/developers/parameters/#ek3-src1-yaw-yaw-source) to `GPS (2)`, which from your description doesn’t seem to be an option you’ve tried yet.

Note that the gyroscope is used for all three rotation axes (not just the yaw axis), and provides rotation rate measurements (not fixed angles). The magnetometer is what’s normally used for static heading angle determination (since it functions as a compass), but there are still corrections applied from the gyroscope when the vehicle is in motion.

---

<div class="post-metadata">

**Author:** ![Pawel](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@Pawel](https://discuss.bluerobotics.com/u/Pawel)\
**Post date:** [August 2, 2023, 3:13pm UTC](https://discuss.bluerobotics.com/t/external-yaw-in-gps-input-does-not-seem-to-work/14794/5 "2023-08-02T15:13:22Z")

</div>

Hi @EliotBR  
thank you  
I used it as you say and it is working now. I described it [this link](https://discuss.ardupilot.org/t/gps-and-nav-data-over-mavlink-and-pymavlink/104235/6)
