← Back to Docs
  • index.html
  • Clayground
  • Clayground.Algorithm
  • KalmanFilter2D
  • Clayground 2026.7
  • KalmanFilter2D QML Type

    Constant-velocity Kalman filter for 2D position tracking. More...

    Import Statement: import Clayground.Algorithm

    Properties

    Methods

    Detailed Description

    State [x, y, vx, vy]. Call predict(dt) on a fixed tick and correct(zx, zy, sigma) for every position measurement from any sensor; sigma is that sensor's standard deviation, which is how fusion weighs sources by their uncertainty.

    Example usage:

    import Clayground.Algorithm
    
    KalmanFilter2D { id: kf; processNoise: 0.8 }
    // per tick: kf.predict(dt)
    // per fix:  kf.correct(fix.x, fix.y, 3.0)

    Property Documentation

    estX : real [read-only]

    Estimated x position.


    estY : real [read-only]

    Estimated y position.


    processNoise : real

    Acceleration standard deviation of the motion model.


    sigmaX : real [read-only]

    Position uncertainty (std dev) along x.


    sigmaY : real [read-only]

    Position uncertainty (std dev) along y.


    Method Documentation

    void correct(real zx, real zy, real sigma)

    Fuses a position measurement with standard deviation sigma.


    void predict(real dt)

    Advances the state by dt using the constant-velocity model.


    void reset(real px, real py)

    Re-initializes the state at a position with high uncertainty.