SimpleUKF constructor

SimpleUKF(
  1. int dimX,
  2. int dimZ,
  3. double dt,
  4. Function hx,
  5. Function fx,
  6. SigmaPointFunction sigmaFn,
  7. int numSigmas, {
  8. Function? xMeanFn,
  9. Function? zMeanFn,
})

Implementation

factory SimpleUKF(int dimX, int dimZ, double dt, Function hx, Function fx,
    SigmaPointFunction sigmaFn, int numSigmas,
    {Function? xMeanFn, Function? zMeanFn}) {
  Matrix x = filledWithZeros(1, columns: dimX);
  Matrix p = Matrix.identity(dimX);
  Matrix q = Matrix.identity(dimX);
  Matrix r = Matrix.identity(dimZ);
  Matrix weightsMean = sigmaFn.weightsMean;
  Matrix weightsCov = sigmaFn.weightsCov;
  Matrix sigmasF = filledWithZeros(numSigmas, columns: dimX);
  Matrix sigmasH = filledWithZeros(numSigmas, columns: dimZ);
  Matrix k = filledWithZeros(dimZ, columns: dimX);
  Matrix y = filledWithZeros(1, columns: dimZ).transpose();
  Matrix z = Matrix.fromRows([Vector.randomFilled(dimZ)]);
  Matrix s = filledWithZeros(dimZ);
  return SimpleUKF._(x, p, dt, hx, fx, sigmaFn, q, r, weightsMean, weightsCov,
      sigmasF, sigmasH, k, y, z, s, dimX, dimZ, numSigmas);
}