Device orientation info

Just working on my first iOS project. Haven’t seen much info on determining device orientation in the docs or here on the forum. Is there a relatively simple and straightforward way to get roll/pitch/yaw data for the device that the app is running on? Errors on these, especially those related to the magnetometer would be nice. Any code snippets to get these euler angles would be very much appreciated!

Thanks.

http://developer.xojo.com/iosmotion

Thanks! Apparently, I was using the wrong search terms (orientation, attitude…). My apologies for not trying harder before pinging the forum.

Do you know whether the reference frame is with respect to magnetic north or true north?

Okay, I even found the Motion example project and have played around with it a bit. It appears that the pitch, roll, and yaw are implemented with

CMAttitudeReferenceFrame.xArbitraryZVertical - initial reference frame is whatever it is when iOSMotion is enabled

Is it possible in Xojo to get these angles with respect to CMAttitudeReferenceFrame.xTrueNorthZVertical, instead? While I’m asking for favors, is it possible to get the rotation matrix and or quaternions in addition to the euler angles?

[quote=307242:@Richard Allmendinger]Thanks! Apparently, I was using the wrong search terms (orientation, attitude…). My apologies for not trying harder before pinging the forum.

Do you know whether the reference frame is with respect to magnetic north or true north?[/quote]
No need to apologize. We are here to help!
Now if you had come storming in, declaring that the documentation didn’t have anything on roll / pitch / yaw you may have gotten a different response :stuck_out_tongue:

Hopefully someone chimes in soon with answers to your other questions!