//! IMU node configuration

use mecha10_core::prelude::*;

/// IMU driver mode selection
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "lowercase")]
pub enum DriverMode {
    /// Use fake IMU driver (for simulation/testing)
    #[default]
    Fake,
    /// Use real IMU driver (for actual hardware - not implemented yet)
    Real,
}

/// IMU node configuration
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ImuConfig {
    /// Driver mode: "fake" for simulation, "real" for hardware
    #[serde(default)]
    pub driver: DriverMode,

    /// IMU update rate in Hz
    #[serde(default = "default_update_rate")]
    pub update_rate_hz: f32,
}

fn default_update_rate() -> f32 {
    100.0
}

impl Default for ImuConfig {
    fn default() -> Self {
        Self {
            driver: DriverMode::default(),
            update_rate_hz: default_update_rate(),
        }
    }
}
