Big yaw correction on ground during arm

Hey everyone.

I’m working off of a 1.9.2 based branch and when we arm we occasionally see a big yaw correction from the aircraft while it is still sitting on the ground. I’ve seen this happen in Position Control and Manual flight modes. I’ve been trying to trace it down but its very intermittent.

Digging through old issues I found this PR related to Navigator and IDLE set points:

Would the bug corrected by the above PR manifest itself in Position and Manual modes?

Edit: The bug was not corrected…

Here is an example where I was in Manual mode and I rotated the aircraft between each arming. After the disarm the yaw setpoint was not resetting to the current yaw, which I would expect.

Most likely the culprit is the reset_yaw_sp flag in mc_att_control_main.cpp which checks _landed but not disarmed.