Skip to main content

STRUCT

ArdkFrameData.CompassData

public struct CompassData: Equatable

Compass and magnetometer data for heading information.

This structure contains orientation data from the device's compass, providing heading information that can be used for location-based AR experiences and waypoint navigation.

Properties​

timestampMs​

public var timestampMs: UInt64

Timestamp when the compass reading was captured (in milliseconds).

headingAccuracy​

public var headingAccuracy: Float

Accuracy of the heading measurement (in degrees).

Lower values indicate more accurate readings. Values above 15-20 degrees may indicate poor compass calibration or magnetic interference.

trueHeading​

public var trueHeading: Float

True heading relative to geographic north (in degrees).

This value is corrected for magnetic declination and represents the actual direction relative to true north (0-360 degrees).

Methods​

init(timestampMs:headingAccuracy:trueHeading:)​

public init(timestampMs: UInt64,
headingAccuracy: Float,
trueHeading: Float)

Creates compass data with the specified parameters.

  • Parameters:
    • timestampMs: Timestamp of the compass reading in milliseconds
    • headingAccuracy: Accuracy of the heading measurement in degrees
    • trueHeading: True heading relative to geographic north in degrees

Parameters​

NameDescription
timestampMsTimestamp of the compass reading in milliseconds
headingAccuracyAccuracy of the heading measurement in degrees
trueHeadingTrue heading relative to geographic north in degrees