142 lines
3.7 KiB
Dart
142 lines
3.7 KiB
Dart
import '../services/validation/telemetry_validator.dart';
|
|
|
|
class TelemetrySample {
|
|
final DateTime timestamp;
|
|
final int? sequenceNumber;
|
|
final int? monotonicTimestampMs;
|
|
|
|
// Location Data
|
|
final double? latitude;
|
|
final double? longitude;
|
|
final double? altitude;
|
|
final double? speed; // MPH
|
|
final double? heading;
|
|
final double? gpsAccuracy;
|
|
final DateTime? gpsTimestamp;
|
|
final int? gpsAgeMs;
|
|
|
|
// IMU Data
|
|
final DateTime? imuTimestamp;
|
|
final double? leanAngle;
|
|
final double? pitchAngle;
|
|
final double? rollRateDegPerSec;
|
|
final double? accelX;
|
|
final double? accelY;
|
|
final double? accelZ;
|
|
final double? longitudinalG;
|
|
final double? lateralG;
|
|
final double? gyroX;
|
|
final double? gyroY;
|
|
final double? gyroZ;
|
|
|
|
// Raw Preserved Sensors (Unfiltered for forensic analysis)
|
|
final double? rawAccelX;
|
|
final double? rawAccelY;
|
|
final double? rawAccelZ;
|
|
final double? rawGyroX;
|
|
final double? rawGyroY;
|
|
final double? rawGyroZ;
|
|
|
|
// Validation & Quality
|
|
final TelemetryQuality? quality;
|
|
|
|
TelemetrySample({
|
|
required this.timestamp,
|
|
this.sequenceNumber,
|
|
this.monotonicTimestampMs,
|
|
this.latitude,
|
|
this.longitude,
|
|
this.altitude,
|
|
this.speed,
|
|
this.heading,
|
|
this.gpsAccuracy,
|
|
this.gpsTimestamp,
|
|
this.gpsAgeMs,
|
|
this.imuTimestamp,
|
|
this.leanAngle,
|
|
this.pitchAngle,
|
|
this.rollRateDegPerSec,
|
|
this.accelX,
|
|
this.accelY,
|
|
this.accelZ,
|
|
this.longitudinalG,
|
|
this.lateralG,
|
|
this.gyroX,
|
|
this.gyroY,
|
|
this.gyroZ,
|
|
this.rawAccelX,
|
|
this.rawAccelY,
|
|
this.rawAccelZ,
|
|
this.rawGyroX,
|
|
this.rawGyroY,
|
|
this.rawGyroZ,
|
|
this.quality,
|
|
});
|
|
|
|
TelemetrySample copyWith({
|
|
DateTime? timestamp,
|
|
int? sequenceNumber,
|
|
int? monotonicTimestampMs,
|
|
double? latitude,
|
|
double? longitude,
|
|
double? altitude,
|
|
double? speed,
|
|
double? heading,
|
|
double? gpsAccuracy,
|
|
DateTime? gpsTimestamp,
|
|
int? gpsAgeMs,
|
|
DateTime? imuTimestamp,
|
|
double? leanAngle,
|
|
double? pitchAngle,
|
|
double? rollRateDegPerSec,
|
|
double? accelX,
|
|
double? accelY,
|
|
double? accelZ,
|
|
double? longitudinalG,
|
|
double? lateralG,
|
|
double? gyroX,
|
|
double? gyroY,
|
|
double? gyroZ,
|
|
double? rawAccelX,
|
|
double? rawAccelY,
|
|
double? rawAccelZ,
|
|
double? rawGyroX,
|
|
double? rawGyroY,
|
|
double? rawGyroZ,
|
|
TelemetryQuality? quality,
|
|
}) {
|
|
return TelemetrySample(
|
|
timestamp: timestamp ?? this.timestamp,
|
|
sequenceNumber: sequenceNumber ?? this.sequenceNumber,
|
|
monotonicTimestampMs: monotonicTimestampMs ?? this.monotonicTimestampMs,
|
|
latitude: latitude ?? this.latitude,
|
|
longitude: longitude ?? this.longitude,
|
|
altitude: altitude ?? this.altitude,
|
|
speed: speed ?? this.speed,
|
|
heading: heading ?? this.heading,
|
|
gpsAccuracy: gpsAccuracy ?? this.gpsAccuracy,
|
|
gpsTimestamp: gpsTimestamp ?? this.gpsTimestamp,
|
|
gpsAgeMs: gpsAgeMs ?? this.gpsAgeMs,
|
|
imuTimestamp: imuTimestamp ?? this.imuTimestamp,
|
|
leanAngle: leanAngle ?? this.leanAngle,
|
|
pitchAngle: pitchAngle ?? this.pitchAngle,
|
|
rollRateDegPerSec: rollRateDegPerSec ?? this.rollRateDegPerSec,
|
|
accelX: accelX ?? this.accelX,
|
|
accelY: accelY ?? this.accelY,
|
|
accelZ: accelZ ?? this.accelZ,
|
|
longitudinalG: longitudinalG ?? this.longitudinalG,
|
|
lateralG: lateralG ?? this.lateralG,
|
|
gyroX: gyroX ?? this.gyroX,
|
|
gyroY: gyroY ?? this.gyroY,
|
|
gyroZ: gyroZ ?? this.gyroZ,
|
|
rawAccelX: rawAccelX ?? this.rawAccelX,
|
|
rawAccelY: rawAccelY ?? this.rawAccelY,
|
|
rawAccelZ: rawAccelZ ?? this.rawAccelZ,
|
|
rawGyroX: rawGyroX ?? this.rawGyroX,
|
|
rawGyroY: rawGyroY ?? this.rawGyroY,
|
|
rawGyroZ: rawGyroZ ?? this.rawGyroZ,
|
|
quality: quality ?? this.quality,
|
|
);
|
|
}
|
|
}
|