Skip to content

ESenseSensor

An eSense motion sensor event with accelerometer and gyroscope readings.

Collected by the ESenseSensorProbe for the ESenseSamplingPackage.ESENSE_SENSOR measure. This data is a 1:1 mapping of the esense_flutter SensorEvent.

Inheritance
Annotations

Constructors

ESenseSensor.fromJson

ESenseSensor.fromJson(
  1. Map<String, dynamic> json
)

ESenseSensor.fromSensorEvent

ESenseSensor.fromSensorEvent({
  1. required String deviceName,
  2. required SensorEvent event,
})

Creates an ESenseSensor from an esense_flutter SensorEvent.

ESenseSensor

ESenseSensor({
  1. required String deviceName,
  2. DateTime? timestamp,
  3. int? packetIndex,
  4. List<int>? accel,
  5. List<int>? gyro,
})

Properties

accel

List<int>? accel
getter/setter pair

3-element array with the X, Y and Z axis of the accelerometer, as raw sensor values.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

gyro

List<int>? gyro
getter/setter pair

3-element array with the X, Y and Z axis of the gyroscope, as raw sensor values.

jsonType

String get jsonType
override

Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.

packetIndex

int? packetIndex
getter/setter pair

Sequential number of sensor packets. The eSense device does not have a clock, so this index reflects the order of reading.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.