From b9924820e1ae5be608e67cfc4ac6d7c593a4b439 Mon Sep 17 00:00:00 2001 From: jgoppert Date: Thu, 12 Nov 2015 16:41:07 -0500 Subject: [PATCH] Work on kalman filter interface. --- matrix/Quaternion.hpp | 6 ++++++ matrix/filter.hpp | 10 +++++----- test/filter.cpp | 10 ---------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/matrix/Quaternion.hpp b/matrix/Quaternion.hpp index a0f0441db3..e1067c6bac 100644 --- a/matrix/Quaternion.hpp +++ b/matrix/Quaternion.hpp @@ -98,6 +98,12 @@ public: return r; } + void operator*=(const Quaternion & other) + { + Quaternion &self = *this; + self = self * other; + } + Matrix41 derivative(const Matrix31 & w) const { const Quaternion &q = *this; Type dataQ[] = { diff --git a/matrix/filter.hpp b/matrix/filter.hpp index d075fc0f01..a9d9982b1a 100644 --- a/matrix/filter.hpp +++ b/matrix/filter.hpp @@ -6,12 +6,12 @@ namespace matrix { template int kalman_correct( - const SquareMatrix & P, + const Matrix & P, const Matrix & C, - const SquareMatrix & R, - const Vector &r, - Vector & dx, - SquareMatrix & dP, + const Matrix & R, + const Matrix &r, + Matrix & dx, + Matrix & dP, float & beta ) { diff --git a/test/filter.cpp b/test/filter.cpp index 3470e5f4d4..f8eb01f748 100644 --- a/test/filter.cpp +++ b/test/filter.cpp @@ -5,16 +5,6 @@ using namespace matrix; -template int kalman_correct( - const SquareMatrix & P, - const Matrix & C, - const SquareMatrix & R, - const Vector &r, - Vector & dx, - SquareMatrix & dP, - float & beta -); - int main() { const size_t n_x = 6;