From cb1528008f66a9239b944b344fa29524f8b89409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20K=2E=20Schr=C3=B6der?= Date: Sun, 3 Jul 2016 12:29:58 +0200 Subject: [PATCH] Update Matrix.hpp (#4966) This was horribly wrong. Matrix is first cast into a matrix of size NxM (which is supposed to be the size of the result - NOT the starting point) so the transpose result becomes garbage. Instead make "Me" an MxN matrix as the original. Took me a whole evening to figure out this problem. Now my Kalman filter finally returns good results. --- src/lib/mathlib/math/Matrix.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/mathlib/math/Matrix.hpp b/src/lib/mathlib/math/Matrix.hpp index 0941f4b7b5..ce27ccfcc3 100644 --- a/src/lib/mathlib/math/Matrix.hpp +++ b/src/lib/mathlib/math/Matrix.hpp @@ -305,7 +305,7 @@ public: * transpose the matrix */ Matrix transposed(void) const { - matrix::Matrix Me(this->arm_mat.pData); + matrix::Matrix Me(this->arm_mat.pData); Matrix res(Me.transpose().data()); return res; }