RSDMotionRecorderType
public enum RSDMotionRecorderType : String, Codable, RSDStringEnumSet
RSDMotionRecorderType
is used to enumerate the sensors and calculated measurements
that can be recorded by the RSDMotionRecorder
.
RSDMotionRecorder
records each sample from either the raw CoreMotion sensors
(accelerometer, gyro, and magnetometer) or the calculated vectors returned when requesting
CMDeviceMotion
data updates. The CMDeviceMotion
data is split into the components
enumerated by this enum into a single vector (sensor or calculated) per type.
By default, the requested types are are saved to a single logging file as instances of
RSDMotionRecord
structs.
Spliting the device motion into components in this manner stores the data in using a consistent JSON schema that can represent the sensor data returned by both iOS and Android devices. Thus, allowing research studies to target a broader audience. Additionally, this schema allows for a single table to be used to store the data which can then be filtered by type to perform calculations and DSP on the input sources.
-
Raw accelerometer reading.
CMAccelerometerData
accelerometer.Declaration
Swift
case accelerometer
-
Raw gyroscope reading.
CMGyroData
rotationRate.Declaration
Swift
case gyro
-
Raw magnetometer reading.
CMMagnetometerData
magneticField.Declaration
Swift
case magnetometer
-
Calculated orientation of the device using the gyro and magnetometer (if appropriate).
This is included in the
CMDeviceMotion
data object.Note
If the
magneticField
is included in the configuration’s list of desired recorder types then the reference frame is.xMagneticNorthZVertical
. Otherwise, the motion recorder will use.xArbitraryZVertical
.Declaration
Swift
case attitude
-
Calculated vector for the direction of gravity in the coordinates of the device.
This is included in the
CMDeviceMotion
data object.Declaration
Swift
case gravity
-
The magnetic field vector with respect to the device for devices with a magnetometer. Note that this is the total magnetic field in the device’s vicinity without device bias (Earth’s magnetic field plus surrounding fields, without device bias), unlike
CMMagnetometerData
magneticField.This is included in the
CMDeviceMotion
data object.Note
If this recorder type is included in the configuration, then the attitude reference frame will be set to
.xMagneticNorthZVertical
. Otherwise, the magnetic field vector will be returned as{ 0, 0, 0 }
.Declaration
Swift
case magneticField
-
The rotation rate of the device for devices with a gyro.
This is included in the
CMDeviceMotion
data object.Declaration
Swift
case rotationRate
-
Calculated vector for the participant’s acceleration in the coordinates of the device. This is the acceleration component after subtracting the gravity vector.
This is included in the
CMDeviceMotion
data object.Declaration
Swift
case userAcceleration
-
A list of all the enum values.
Declaration
Swift
public static var all: Set<RSDMotionRecorderType> { get }
-
List of the device motion types that are calculated from multiple sensors and returned by listening to device motion updates.
Declaration
Swift
public static var deviceMotionTypes: Set<RSDMotionRecorderType> { get }
-
List of the raw motion sensor types.
Declaration
Swift
public static var rawSensorTypes: Set<RSDMotionRecorderType> { get }