Features and fixes

* added the trace function for a SquareMatrix

* added Vector3.hat() and it's counterpart Dcm.vee()
for skewsymskew symmetric matrix operations in relation to the cross product
see https://en.wikipedia.org/wiki/Hat_operator

* Matrix::write_string produced runtime errors when I used it in PX4 posix simulation, i simplified it

* a Matrix3f is a SquareMatrix

* added tests for SquareMatrix.trace, Vector3.hat and Dcm.vee

* added a test for quaternion initialisation from array

* preventing buffer overflows in Matrix.write_string method
This commit is contained in:
Matthias Grob
2016-04-28 21:16:36 +02:00
committed by James Goppert
parent 07fba8322a
commit 65679fbcbb
8 changed files with 73 additions and 20 deletions
+6
View File
@@ -231,6 +231,12 @@ int main()
TEST(fabsf(q(2) - q_true(2)) < eps);
TEST(fabsf(q(3) - q_true(3)) < eps);
// Quaternion initialisation per array
float q_array[] = {0.9833f, -0.0343f, -0.1060f, -0.1436f};
Quaternion<float>q_from_array(q_array);
for(int i = 0; i < 4; i++)
TEST(fabsf(q_from_array(i) - q_array[i]) < eps);
};
/* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */