You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -363,7 +363,7 @@ const kFilter = new KalmanFilter({
363
363
});
364
364
```
365
365
366
-
### Extended Kalman Filter
366
+
##Play with Kalman Filter
367
367
368
368
In order to use the Kalman-Filter with a dynamic or observation model which is not strictly a [General linear model](https://en.wikipedia.org/wiki/General_linear_model), it is possible to use `function` in following parameters :
369
369
*`observation.stateProjection`
@@ -375,7 +375,6 @@ In this situation this `function` will return the value of the matrix at each st
375
375
376
376
In this example, we create a constant-speed filter with non-uniform intervals;
377
377
378
-
379
378
```js
380
379
const {KalmanFilter} =require('kalman-filter');
381
380
@@ -446,6 +445,16 @@ const kFilter = new KalmanFilter({
446
445
}
447
446
});
448
447
```
448
+
### Extended
449
+
450
+
If you want to implement an [extended kalman filter](https://en.wikipedia.org/wiki/Extended_Kalman_filter)
451
+
452
+
You will need to put your non-linear functions in the following parameters
* @property {PredictedCallback} [fn=null] for extended kalman filter only, the non-linear state to observation function
28
+
* @property {Array.Array.<Number>> | PreviousCorrectedCallback} stateProjection the matrix to transform state to observation (for EKF, the jacobian of the fn)
29
+
* @property {Array.Array.<Number>> | PreviousCorrectedCallback} covariance the covariance of the observation noise
36
30
*/
37
31
32
+
/**
33
+
* @typedef {Object} DynamicConfig
34
+
* @property {Number} dimension dimension of the state vector
35
+
* @property {PreviousCorrectedCallback} [fn=null] for extended kalman filter only, the non-linear state-transition model
36
+
* @property {Array.Array.<Number>> | PredictedCallback} transition the state-transition model (or for EKF the jacobian of the fn)
37
+
* @property {Array.Array.<Number>> | PredictedCallback} covariance the covariance of the process noise
38
+
*/
39
+
40
+
/**
41
+
* @typedef {Object} CoreConfig
42
+
* @property {DynamicConfig} dynamic the system's dynamic model
43
+
* @property {ObservationConfig} observation the system's observation model
44
+
* @property {Object} [logger=defaultLogger] a Winston-like logger
45
+
*/
38
46
constdefaultLogger={
39
47
info: (...args)=>console.log(...args),
40
48
debug: ()=>{},
41
49
warn: (...args)=>console.log(...args),
42
50
error: (...args)=>console.log(...args)
43
51
};
44
-
45
52
/**
46
-
* @class
47
-
* @property {DynamicConfig} dynamic the system's dynamic model
48
-
* @property {ObservationConfig} observation the system's observation model
49
-
*@property logger a Winston-like logger
53
+
* @param {CoreConfig} options
50
54
*/
51
55
classCoreKalmanFilter{
52
-
/**
53
-
* @param {DynamicConfig} dynamic
54
-
* @param {ObservationConfig} observation the system's observation model
0 commit comments