rename method and wrap it
parent
5b71e14424
commit
f34b1cd1eb
2
gtsam.h
2
gtsam.h
|
@ -370,6 +370,8 @@ class KalmanFilter {
|
||||||
const gtsam::SharedDiagonal& model);
|
const gtsam::SharedDiagonal& model);
|
||||||
gtsam::GaussianDensity* update(gtsam::GaussianDensity* p, Matrix H, Vector z,
|
gtsam::GaussianDensity* update(gtsam::GaussianDensity* p, Matrix H, Vector z,
|
||||||
const gtsam::SharedDiagonal& model);
|
const gtsam::SharedDiagonal& model);
|
||||||
|
gtsam::GaussianDensity* updateQ(gtsam::GaussianDensity* p, Matrix H, Vector z,
|
||||||
|
Matrix Q);
|
||||||
};
|
};
|
||||||
|
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
|
|
|
@ -145,7 +145,7 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
KalmanFilter::State KalmanFilter::update(const State& p, const Matrix& H, const Vector& z,
|
KalmanFilter::State KalmanFilter::updateQ(const State& p, const Matrix& H, const Vector& z,
|
||||||
const Matrix& Q) {
|
const Matrix& Q) {
|
||||||
Index k = step(p);
|
Index k = step(p);
|
||||||
Matrix M = inverse(Q), Ht = trans(H);
|
Matrix M = inverse(Q), Ht = trans(H);
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace gtsam {
|
||||||
* physical property, such as velocity or acceleration, and G is derived from physics.
|
* physical property, such as velocity or acceleration, and G is derived from physics.
|
||||||
* This version allows more realistic models than a diagonal covariance matrix.
|
* This version allows more realistic models than a diagonal covariance matrix.
|
||||||
*/
|
*/
|
||||||
State update(const State& p, const Matrix& H, const Vector& z,
|
State updateQ(const State& p, const Matrix& H, const Vector& z,
|
||||||
const Matrix& Q);
|
const Matrix& Q);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -272,8 +272,8 @@ TEST( KalmanFilter, QRvsCholesky ) {
|
||||||
|
|
||||||
// do the above update again, this time with a full Matrix Q
|
// do the above update again, this time with a full Matrix Q
|
||||||
Matrix modelQ = diag(emul(sigmas,sigmas));
|
Matrix modelQ = diag(emul(sigmas,sigmas));
|
||||||
KalmanFilter::State pa3 = kfa.update(pa, H, z, modelQ);
|
KalmanFilter::State pa3 = kfa.updateQ(pa, H, z, modelQ);
|
||||||
KalmanFilter::State pb3 = kfb.update(pb, H, z, modelQ);
|
KalmanFilter::State pb3 = kfb.updateQ(pb, H, z, modelQ);
|
||||||
|
|
||||||
// Check that they yield the same mean and information matrix
|
// Check that they yield the same mean and information matrix
|
||||||
EXPECT(assert_equal(pa3->mean(), pb3->mean()));
|
EXPECT(assert_equal(pa3->mean(), pb3->mean()));
|
||||||
|
|
Loading…
Reference in New Issue