SensorSamplingPackage class

The built-in sampling package for collecting data from the phone's sensors.

Registered automatically in the SamplingPackageRegistry. Add a Measure with one of the measure types below to a task in your protocol to use it. All measures use the Smartphone primary device. It collects:

  • accelerometer (rate of change in velocity, including and excluding gravity)
  • gyroscope (rotation)
  • magnetometer (compass)
  • acceleration features (e.g. mean, variance, etc. calculated over a sampling period)
  • ambient light (from the phone's light sensor)
  • pedometer (step events)

Ambient light is only available on Android. Step events need the activity recognition permission.

Raw sensor measures emit many events per second. Use ACCELERATION_FEATURES or a short trigger window to limit data volume.

Inheritance

Constructors

SensorSamplingPackage()

Properties

dataTypes → List<DataTypeMetaData>
The data types this package supports.
no setterinherited
deviceManager → DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration>
Get the DeviceManager for the device used by this package.
no setterinherited
deviceType → String
The type of device this package collects data from.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
samplingSchemes → DataTypeSamplingSchemeMap
The default sampling schemes for all dataTypes in this package.
no setteroverride

Methods

create(String type) → Probe?
Creates a new Probe of the specified type. Note that type should be one of the dataTypes that this package supports. Returns null if a probe cannot be created for the type.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onRegister() → void
Called when this package is registered in the SamplingPackageRegistry.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

ACCELERATION → const String
Rate of change in velocity, including gravity, along perpendicular x, y, and z axes in the device's coordinate system.
ACCELERATION_FEATURES → const String
A set of acceleration (non-gravitational) features calculated over a specific sampling period.
AMBIENT_LIGHT → const String
Ambient light from the phone's light sensor.
MAGNETIC_FIELD → const String
Magnetic field around the phone in x,y,z (typically measured by a magnetometer).
NON_GRAVITATIONAL_ACCELERATION → const String
Rate of change in velocity, excluding gravity, along perpendicular x, y, and z axes in the phone's coordinate system.
ROTATION → const String
Rotation of the phone in x,y,z (typically measured by a gyroscope).
STEP_COUNT → const String
Total step count since last system boot from the phone's pedometer. Kept for backwards compatibility with CAMS 1.x protocols (protocol API level < 2.0) - use STEP_EVENT instead.
STEP_EVENT → const String
Step event from the phone's pedometer. Note that this measure type is different from the "stepcount" measure type, which provides aggregated step counts over a time period.