What do the dataflash yaw values represent?

To keep it simple, I am looking for a way to extract both the copters flight direction and heading. I have extracted the flight direction from the NED velocities (atan2(VE/VN)).

I am now wondering what the best way to determine actual copter orientation - the YAW values contained in both ATT and NKF1 don’t seem to reflect this, and I haven’t been able to find any documentation regarding their actual meaning.

Thanks!

The Yaw data in both of those are heading in degrees of the compass.

In that case, the yaw values seem incorrect, unless I’m interpreting them wrong. My actual flight path was approx 10 deg, i.e. slightly ‘clockwise’ from north, and the aircraft was yawed slightly counter-clockwise. The ATT.YAW values for my flight are all in the range of 20-30deg, where I would expect something closer to 350deg - seems negative to me?

@dkemxr Is the compass heading the same as the euler yaw angle computed in the NED reference frame?

Mark-I don’t know the answer to that but by the question I take it they are not? IOW I’m wrong to say that the Yaw data in those fields is as simplistic as I stated?

I believe Euler yaw and compass heading represent the same angle in the NED frame, and I was hoping you would just say “yes” :slight_smile:
I’ll try to verify that by code and/or log inspection.

Vehicle orientation is represented by a body-frame to NED rotation, and the code sends euler yaw as the heading in mavlink message VFR_HUD. The documentation for that message describes heading as “Current heading in compass units (0-360, 0=north)”, so I think @dkemxr is correct.

Thanks, presumably in that case I’m looking at some sort of error/offset in my compass calibration or similar?

That would be my first guess. On the bench I often see compass heading errors of that magnitude, but I would think you’d see toilet-bowling in loiter if the calibration were off a lot.

Makes sense. The flight took place on top of a building, metal absolutely everywhere. The missions seemed to run fine, but not surprised at all if there was significant interference