SKDeviceMotionData Class Reference

Inherits from SKSensorData : NSObject
Declared in SKDeviceMotionData.h

Overview

An instance of SKDeviceMotionData encapsulates measurements related to the Device Motion sensor. The measurements include the device’s Attitude, Magnetic Field, Rotation Rate and a separation of the User Acceleration and the Gravity. For more information, please refer to Apple’s Core Motion Documentation.

– initWithSensorType:withTimestamp:

Returns an SKSensorData object, initialized with the given SKSensorType and SKSensorTimestamp.

- (instancetype)initWithSensorType:(SKSensorType)sensorType withTimestamp:(SKSensorTimestamp *)timestamp

Parameters

sensorType

The type of the sensor that produced this data object.

timestamp

The time were this data log was captured.

Return Value

A new SKSensorData object.

Declared In

SKSensorData.h

– initWithDeviceMotion:

Returns an SKDeviceMotionData object, initialized with a CMDeviceMotion object.

- (instancetype)initWithDeviceMotion:(CMDeviceMotion *)motion

Parameters

motion

The original CMDeviceMotion object.

Return Value

An SKDeviceMotionData object.

Declared In

SKDeviceMotionData.h

  attitude

An attitude object is the orientation of a body relative to a given frame of reference.

@property (nonatomic, readonly, copy) CMAttitude *attitude

Declared In

SKDeviceMotionData.h

  magneticField

The calibrated Magnetic Field vector that contains the magnetic field vector without the device’s bias.

@property (nonatomic, readonly) CMCalibratedMagneticField magneticField

Declared In

SKDeviceMotionData.h

  rotationRate

A structure that contains the device’s rotation rate in 3-axis, excluding the gyroscopes bias using sensor fusion techniques.

@property (nonatomic, readonly) CMRotationRate rotationRate

Declared In

SKDeviceMotionData.h

  userAcceleration

The devices 3-axes acceleration produced by the user, exluding the acceleration of the gravity.

@property (nonatomic, readonly) CMAcceleration userAcceleration

Declared In

SKDeviceMotionData.h

  gravity

The gravities 3-axes acceleration, exluding the acceleration of the user.

@property (nonatomic, readonly) CMAcceleration gravity

Declared In

SKDeviceMotionData.h

+ csvHeader

A string with a CSV formatted header that describes the data of the Device Motion sensor. This method is useful in combination with the csvString instance method of an SKSensorData object.

+ (NSString *)csvHeader

Return Value

A string with a CSV header.

Declared In

SKDeviceMotionData.h