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 15:16:36 -04:00
committed by James Goppert
parent 07fba8322a
commit 65679fbcbb
8 changed files with 73 additions and 20 deletions
+9
View File
@@ -83,6 +83,15 @@ public:
dcm(2, 1) = sinPhi * cosThe;
dcm(2, 2) = cosPhi * cosThe;
}
Vector<Type, 3> vee() const { // inverse to Vector.hat() operation
const Dcm &A(*this);
Vector<Type, 3> v;
v(0) = -A(1,2);
v(1) = A(0,2);
v(2) = -A(0,1);
return v;
}
};
typedef Dcm<float> Dcmf;