Core motion attitude reference frame

I am working on an iOS application that relies on CoreMotion Attitude, and I need clarification regarding the behavior of reference frames.

According to the documentation, when setting the attitude reference frame to CMAttitudeReferenceFrameXTrueNorthZVertical:

  • The Z-axis of the reference frame is vertical (aligned with gravity).
  • The X-axis of the reference frame points to the geographic North Pole (True North).
  • When a device’s orientation matches this reference frame, the roll, pitch, and yaw values reported by CMAttitude should be (0,0,0).

However, in my testing:

  • When I align the device’s position with the CMAttitudeReferenceFrameXTrueNorthZVertical reference frame by orienting the screen (device Z-axis) upward and the right side (device X-axis) toward north, the yaw value reported by CMAttitude is 90 degrees instead of the expected 0 degrees.
  • To have CMAttitude report yaw as 0, I must instead orient the top side (device Y-axis) toward north.

This seems to contradict my understanding that the X-axis of the device should be aligned with True North, to have the device match the attitude reference frame and have roll, pitch, and yaw values reported by CMAttitude should be (0,0,0).

What I'm missing?

Thank you for your time and assistance.

Answered by DTS Engineer in 822530022

When I align the device’s position with the CMAttitudeReferenceFrameXTrueNorthZVertical reference frame by orienting the screen (device Z-axis) upward and the right side (device X-axis) toward north, the yaw value reported by CMAttitude is 90 degrees instead of the expected 0 degrees.

My recollection is that 0,0,0 in CMAttitudeReferenceFrameXTrueNorthZVertical would mean:

  • The device is screen up.
  • Perpendicular to the force of gravity/"level"/Parallel to the ground.
  • The "top"/"camera end" of the device point at true north.

However, my actual advice is to set up a controlled test and then move the device carefully monitoring the CoreMotion data returned until you comfortable with how the axis shift. In my experience, it's extremely difficult to create a description or diagram that accurately conveys the exact behavior and that everyone understands*. The device behavior itself has never changed, it's simply that describing that behavior seems to be quite difficult.

*I include myself in that category. The longer I look at the diagram in "Choose a frame of reference for interpreting attitude data", the less confident I am that I actually understand the axis.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

When I align the device’s position with the CMAttitudeReferenceFrameXTrueNorthZVertical reference frame by orienting the screen (device Z-axis) upward and the right side (device X-axis) toward north, the yaw value reported by CMAttitude is 90 degrees instead of the expected 0 degrees.

My recollection is that 0,0,0 in CMAttitudeReferenceFrameXTrueNorthZVertical would mean:

  • The device is screen up.
  • Perpendicular to the force of gravity/"level"/Parallel to the ground.
  • The "top"/"camera end" of the device point at true north.

However, my actual advice is to set up a controlled test and then move the device carefully monitoring the CoreMotion data returned until you comfortable with how the axis shift. In my experience, it's extremely difficult to create a description or diagram that accurately conveys the exact behavior and that everyone understands*. The device behavior itself has never changed, it's simply that describing that behavior seems to be quite difficult.

*I include myself in that category. The longer I look at the diagram in "Choose a frame of reference for interpreting attitude data", the less confident I am that I actually understand the axis.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Core motion attitude reference frame
 
 
Q