tracktor 0.4.1

Multi-target tracking with random finite sets
Documentation
//! Tracktor: Multi-Target Tracking Library for Rust
//!
//! A type-safe implementation of Random Finite Set (RFS) based tracking algorithms.
//!
//! # Features
//!
//! - **Type Safety**: Vector spaces and filter phases encoded in the type system
//! - **Compile-Time Checks**: Dimension mismatches caught at compile time
//! - **no_std Support**: Works in embedded environments

#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "alloc")]
extern crate alloc;

pub mod assignment;
pub mod filters;
pub mod models;
pub mod types;
pub mod utils;

pub mod prelude {
    pub use crate::filters::ekf::*;
    #[cfg(feature = "alloc")]
    pub use crate::filters::glmb::{
        FixedGlmbTrack, GlmbDensity, GlmbEstimate, GlmbFilter, GlmbFilterState, GlmbHypothesis,
        GlmbTrack, GlmbTruncationConfig, extract_best_hypothesis as glmb_extract_best_hypothesis,
        extract_map_cardinality as glmb_extract_map_cardinality,
        extract_marginal_states as glmb_extract_marginal_states, glmb_to_lmb, glmb_to_lmb_merged,
        lmb_to_glmb, lmb_to_glmb_full,
    };
    pub use crate::filters::kalman::*;
    #[cfg(feature = "alloc")]
    pub use crate::filters::lmb::*;
    pub use crate::filters::phd::*;
    pub use crate::filters::ukf::*;
    pub use crate::models::*;
    pub use crate::types::gaussian::*;
    pub use crate::types::labels::*;
    pub use crate::types::spaces::*;
    pub use crate::types::transforms::*;
    pub use crate::utils::*;
}

/// Error types for the library
#[derive(Debug, Clone, PartialEq)]
pub enum TracktorError {
    /// Matrix is singular and cannot be inverted
    SingularMatrix,
    /// Numerical computation became unstable
    NumericalInstability,
    /// Maximum number of components exceeded (for fixed-size storage)
    MaxComponentsExceeded,
    /// Assignment algorithm failed to find a solution
    AssignmentFailed,
}

#[cfg(feature = "std")]
impl std::error::Error for TracktorError {}

impl ::core::fmt::Display for TracktorError {
    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        match self {
            TracktorError::SingularMatrix => write!(f, "Matrix is singular"),
            TracktorError::NumericalInstability => write!(f, "Numerical instability detected"),
            TracktorError::MaxComponentsExceeded => write!(f, "Maximum components exceeded"),
            TracktorError::AssignmentFailed => write!(f, "Assignment algorithm failed"),
        }
    }
}

pub type Result<T> = ::core::result::Result<T, TracktorError>;