40 ColumnVector measNoise_Mu(
meas_size); measNoise_Mu = 0;
41 SymmetricMatrix measNoise_Cov(
meas_size); measNoise_Cov = 0;
43 for (
unsigned int i=1; i<=
meas_size; i++){
44 measNoise_Mu(i) = 9.2-i;
45 measNoise_Cov(i,i) = pow(2.8, 2);
46 meas_matrix(i,i) = 2.8-3*i;
48 Gaussian measurement_Uncertainty(measNoise_Mu, measNoise_Cov);
53 ColumnVector prior_Mu(
state_size); prior_Mu = 0;
54 SymmetricMatrix prior_Cov(
state_size); prior_Cov = 0;
56 prior_Mu(i) = 29+i*i*i;
57 prior_Cov(i,i) = pow(29.34*i+23.23, 2);
59 prior_ =
new Gaussian(prior_Mu,prior_Cov);
78 for (
unsigned int i=1; i<=
meas_size; i++)
80 filter_->Update(meas_model_, meas);
85 expectedvalue(1) = 29.066225;
86 expectedvalue(2) = 0.754136;
87 expectedvalue(3) = -0.160365;
88 expectedvalue(4) = -0.477823;
89 expectedvalue(5) = 154.000000;
90 expectedvalue(6) = 245.000000;
91 CPPUNIT_ASSERT_EQUAL(
approxEqual(expectedvalue, filter_->PostGet()->ExpectedValueGet(),
epsilon),
true);
94 SymmetricMatrix covariance(
state_size); covariance = 0;
95 covariance(1,1) = 183.019889;
96 covariance(2,2) = 0.765538;
97 covariance(3,3) = 0.203951;
98 covariance(4,4) = 0.092627;
99 covariance(5,5) = 28876.204900;
100 covariance(6,6) = 39708.532900;
101 CPPUNIT_ASSERT_EQUAL(
approxEqual(covariance, filter_->PostGet()->CovarianceGet(),
epsilon),
true);
static const unsigned int state_size
Class representing Gaussian (or normal density)
static const unsigned int meas_size
CPPUNIT_TEST_SUITE_REGISTRATION(EKFTest)
Class for linear analytic measurementmodels with additive gaussian noise.
Linear Conditional Gaussian.
static const double epsilon
bool approxEqual(double a, double b, double epsilon)