TugProcessor class

Processor class for Timed Up and Go (TUG) test data.

Implements signal processing and event detection algorithms for TUG tests, including stand-up detection, sit-down detection, and turn detection using IMU sensor data. Used by TugTestStep for post-processing sensor data after test completion.

The algorithm applies low-pass filtering and smoothing to detect key movement phases:

  • Stand-up: Detected using accelerometer y-axis peaks after gravity removal
  • Sit-down: Similar to stand-up but with timing constraints after walking phase
  • Turning: Detected using gyroscope y-axis integration with angle thresholds

Returns a TugResult after test completion and data processing.

Inheritance

Constructors

TugProcessor.new({required TugConfig config})

Properties

config TugConfig
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateTurn(List<SensorEvent> gyroData) double
Calculates the total turning angle from gyroscope data.
decimateData<T>(List<T> input, double targetRate, double actualRate) List<T>
Decimates input data by reducing the sampling rate.
detectSitDown({required List<SensorEvent> accData, required double accActualRate, required DateTime startTime, required DateTime minimumTime}) int
Detects the sit-down event in TUG test using accelerometer data.
detectStandUp({required List<SensorEvent> accData, required double accActualRate}) int
Detects the stand-up event in TUG test using accelerometer data.
detectTurn({required List<SensorEvent> gyroData, required double gyroActualRate, required DateTime startTime, required double angleThreshold}) Turning
Detects the turning event in TUG test using gyroscope data.
lowPassFilter(List<double> input, double cutoff) List<double>
Applies a low-pass filter to reduce noise in sensor data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processData({required List<SensorEvent> accData, required List<SensorEvent> gyroData, required List<SensorEvent> magData, required double accActualRate, required double gyroActualRate, required double magActualRate}) Future<List<TugResult>>
Processes raw sensor data and returns a list of TugResults.
override
toString() String
A string representation of this object.
inherited

Operators

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