I'm trying to get a simulated magnetometer (B0x, B0y, B0z) via X-Plane. Can magnetic heading be reverse engineered into its components so I can run an EKF on it. I've got it working with the real thing but it'd be nice if everyone could get the EKF to run without hardware.
I've introduced an unrelated bug to my EKF that I've been spending time on so I'm hoping someone can beat me to figuring this out. I realize potentially their could be more than one solution which would make it impossible but if that's the case can someone confirm it?
X, Y, Z = magnetic components in x, y and z axis
Xh = X * cos(roll) + Y * sin(pitch) * sin(roll) - Z * cos(pitch) * sin(roll)
Yh = Y * cos(pitch) + Z * sin(pitch)
Azimuth = arcTan(Yh/Xh)
Summary: The problem is I have Azimuth and I need X, Y, Z. Can it be done?