1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#![allow(non_snake_case)]
use nalgebra as na;
use na::{allocator::Allocator, DefaultAllocator, Dim, MatrixMN, MatrixN, VectorN};
use na::{SimdRealField};
pub use crate::noise::{CorrelatedNoise};
pub use crate::estimators::ud::UDState;
#[derive(PartialEq, Clone)]
pub struct KalmanState<N: SimdRealField, D: Dim>
where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
{
pub x: VectorN<N, D>,
pub X: MatrixN<N, D>,
}
#[derive(PartialEq, Clone)]
pub struct InformationState<N: SimdRealField, D: Dim>
where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
{
pub i: VectorN<N, D>,
pub I: MatrixN<N, D>,
}
pub trait Estimator<N: SimdRealField, D: Dim>
where
DefaultAllocator: Allocator<N, D>,
{
fn state(&self) -> Result<VectorN<N, D>, &'static str>;
}
pub trait KalmanEstimator<N: SimdRealField, D: Dim>
where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
{
fn init(&mut self, state: &KalmanState<N, D>) -> Result<(), &'static str>;
fn kalman_state(&self) -> Result<KalmanState<N, D>, &'static str>;
}
pub trait ExtendedLinearPredictor<N: SimdRealField, D: Dim>
where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>
{
fn predict(
&mut self,
x_pred: &VectorN<N, D>,
Fx: &MatrixN<N, D>,
noise: &CorrelatedNoise<N, D>,
) -> Result<(), &'static str>;
}
pub trait ExtendedLinearObserver<N: SimdRealField, D: Dim, ZD: Dim>
where
DefaultAllocator:
Allocator<N, ZD, D> + Allocator<N, ZD, ZD> + Allocator<N, ZD>
{
fn observe_innovation(
&mut self,
s: &VectorN<N, ZD>,
Hx: &MatrixMN<N, ZD, D>,
noise: &CorrelatedNoise<N, ZD>,
) -> Result<(), &'static str>;
}