namespace RobotNet10.RobotApp.Motion;
///
/// Configuration for Extended Kalman Filter
///
public class EKFConfiguration
{
///
/// Device ID của IMU sensor
///
public string ImuDeviceId { get; set; } = string.Empty;
///
/// Frame ID của odometry frame (thường là "odom")
///
public string FrameId { get; set; } = "odom";
///
/// Child frame ID (thường là "base_link")
///
public string ChildFrameId { get; set; } = "base_link";
///
/// Tần số cập nhật EKF (Hz)
///
public double UpdateRateHz { get; set; } = 20.0;
// Process noise covariance (diagonal values)
///
/// Process noise cho position (m^2)
///
public double ProcessNoisePosition { get; set; } = 0.01;
///
/// Process noise cho orientation (rad^2)
///
public double ProcessNoiseOrientation { get; set; } = 0.01;
///
/// Process noise cho velocity (m^2/s^2 hoặc rad^2/s^2)
///
public double ProcessNoiseVelocity { get; set; } = 0.1;
// Measurement noise covariance
///
/// Measurement noise cho position từ odometry (m^2)
///
public double MeasurementNoisePosition { get; set; } = 0.05;
///
/// Measurement noise cho orientation từ IMU (rad^2)
///
public double MeasurementNoiseOrientation { get; set; } = 0.01;
// Initial state uncertainty
///
/// Initial uncertainty cho position (m^2)
///
public double InitialPositionUncertainty { get; set; } = 0.1;
///
/// Initial uncertainty cho orientation (rad^2)
///
public double InitialOrientationUncertainty { get; set; } = 0.1;
///
/// Initial uncertainty cho velocity (m^2/s^2 hoặc rad^2/s^2)
///
public double InitialVelocityUncertainty { get; set; } = 0.5;
// Slip Detection Configuration
///
/// Enable wheel slip detection
///
public bool EnableSlipDetection { get; set; } = true;
///
/// Enable wheels-in-air detection (uses Z-axis IMU)
///
public bool EnableWheelsInAirDetection { get; set; } = true;
///
/// Enable adaptive noise scaling when slip detected
/// If false, noise scale always stays at 1.0
///
public bool EnableAdaptiveNoise { get; set; } = true;
///
/// Enable slip event logging
///
public bool EnableSlipLogging { get; set; } = true;
///
/// Acceleration mismatch threshold for slip detection (m/s²)
///
public double AccelerationMismatchThreshold { get; set; } = 0.5;
///
/// Innovation threshold for slip detection (sigma/standard deviations)
///
public double InnovationThreshold { get; set; } = 3.0;
///
/// Maximum process noise scale factor when slip detected
///
public double MaxNoiseScale { get; set; } = 10.0;
///
/// Z-axis acceleration threshold for freefall detection (m/s²)
/// Value close to 9.81 indicates wheels in air
///
public double ZAxisFreefallThreshold { get; set; } = 0.15;
///
/// Horizontal motion threshold for slip classification (m/s²)
///
public double HorizontalMotionThreshold { get; set; } = 0.1;
///
/// Process noise scale factor for wheels in air scenario
/// Very high value effectively freezes position estimation
///
public double WheelsInAirNoiseScale { get; set; } = 100.0;
}