# How do I handle yaw wrapping when implementing a simple GPS lever arm correction?

I am trying to implement a lever arm correction. I have an aircraft with a gps antenna which is displaced from an on-board sensor whose GPS position I would like to know.

I have the distance from the antenna to the sensor in body coordinates (NOSE-RIGHTWING-DOWN) which I am calling a lever arm:

$$LA^{body} = [x_{body} , y_{body} , z_{body}]$$

My methodology is:

First convert gps trajectory of the antenna to NED: $$Antenna^{NED}$$.
Second obtain a DCM rotation matrix $$C_{body}^{NED}$$ using Yaw, Pitch, Roll
Third transform $$LA^{body}$$ to $$LA^{NED}$$ by $$LA^{NED} = C_{body}^{NED} LA^{body}$$
Finally find NED position of sensor by adding $$LA^{NED}$$ to $$Antenna^{NED}$$ \

However, after doing this I am noticing that the NED position of the sensor will jump whenever the yaw goes below -180, since in that case it wraps to +180, and vice versa. How do I handle this problem?

• If your position is jumping then it likely means that there is a problem somewhere else in the system. Since wrapping should not cause such a jump. As for how to solve it. This is one of the reasons why everyone tends to use quaternions. So I would say convert your implementation to use them. Commented Apr 25, 2022 at 7:45