Structure

CMAttitudeReferenceFrame

Enum constants for indicating the reference frames from which all attitude samples are referenced.

Declaration

struct CMAttitudeReferenceFrame

Overview

Constants of this data type are returned or referenced by the attitudeReferenceFrame property and the startDeviceMotionUpdates(using:to:withHandler:) and startDeviceMotionUpdates(using:) methods of the CMMotionManager class. A bitmask of these constants is returned by the availableAttitudeReferenceFrames() class method.

Topics

Constants

static var xArbitraryZVertical: CMAttitudeReferenceFrame

Describes a reference frame in which the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.

static var xArbitraryCorrectedZVertical: CMAttitudeReferenceFrame

Describes the same reference frame as xArbitraryZVertical except that the magnetometer, when available and calibrated, is used to improve long-term yaw accuracy. Using this constant instead of xArbitraryZVertical results in increased CPU usage.

static var xMagneticNorthZVertical: CMAttitudeReferenceFrame

Describes a reference frame in which the Z axis is vertical and the X axis points toward magnetic north. Note that using this reference frame may require device movement to calibrate the magnetometer.

static var xTrueNorthZVertical: CMAttitudeReferenceFrame

Describes a reference frame in which the Z axis is vertical and the X axis points toward true north. Note that using this reference frame may require device movement to calibrate the magnetometer. It also requires the location to be available in order to calculate the difference between magnetic and true north.

Relationships

Conforms To

See Also

Accessing Attitude Reference Frames

var attitudeReferenceFrame: CMAttitudeReferenceFrame

Returns either the reference frame currently being used or the default attitude reference frame.

class func availableAttitudeReferenceFrames() -> CMAttitudeReferenceFrame

Returns a bitmask specifying the available attitude reference frames on the device.