//! Redis topic definitions for simulation bridge

/// Motor commands from framework (linear, angular velocity)
/// Subscribed by simulation bridge, published by teleop node
pub const TOPIC_MOTOR_COMMAND: &str = "/motor/cmd_vel";

/// Camera image data (RGB binary)
/// Published by simulation bridge, subscribed by recording/telemetry nodes
pub const TOPIC_CAMERA_RGB: &str = "/camera/rgb";

/// IMU data (inertial measurement)
/// Published by simulation bridge, subscribed by navigation/localization nodes
pub const TOPIC_IMU_DATA: &str = "/imu/data";

// Re-export shared types from core
pub use mecha10_core::actuator::Twist;
pub use mecha10_core::messages::RedisMessage;

/// Camera image message (binary RGB data)
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct CameraImage {
    pub camera_id: String,
    pub width: u32,
    pub height: u32,
    pub timestamp: u64,
    /// Raw image bytes (JPEG or RGB)
    pub image_bytes: Vec<u8>,
    /// Image format ("jpeg" or "rgb")
    pub format: String,
}

/// IMU data message
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ImuData {
    pub imu_id: String,
    pub timestamp: u64,
    // Orientation (Euler angles in radians)
    pub roll: f32,
    pub pitch: f32,
    pub yaw: f32,
    // Angular velocity (rad/s)
    pub angular_velocity_x: f32,
    pub angular_velocity_y: f32,
    pub angular_velocity_z: f32,
    // Linear acceleration (m/s²)
    pub linear_acceleration_x: f32,
    pub linear_acceleration_y: f32,
    pub linear_acceleration_z: f32,
}
