Browse Source

update matrix and fix test_matrix (#6524)

sbg
Daniel Agar 8 years ago committed by GitHub
parent
commit
9bc5da6d2d
  1. 2
      src/lib/matrix
  2. 14
      src/systemcmds/tests/test_matrix.cpp

2
src/lib/matrix

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit c31686379c7bbeacb469c3407b5e4ef159098c9c
Subproject commit e2211c586714d0c3175d5d38c28d7f1f677d64a3

14
src/systemcmds/tests/test_matrix.cpp

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
#include <matrix/math.hpp>
#include <matrix/filter.hpp>
#include <matrix/integration.hpp>
#include <matrix/Quaternion.hpp>
using namespace matrix;
@ -58,10 +59,10 @@ bool MatrixTest::run_tests() @@ -58,10 +59,10 @@ bool MatrixTest::run_tests()
ut_declare_test_c(test_matrix, MatrixTest)
template class matrix::Quaternion<float>;
template class matrix::Euler<float>;
template class matrix::Dcm<float>;
using matrix::Dcmf;
using matrix::Quatf;
using matrix::Eulerf;
using matrix::Vector3f;
bool MatrixTest::attitudeTests()
{
@ -207,11 +208,10 @@ bool MatrixTest::attitudeTests() @@ -207,11 +208,10 @@ bool MatrixTest::attitudeTests()
ut_test(isEqual(q_from_m, m4));
// quaternion derivate
Vector<float, 4> q_dot = q.derivative(Vector3f(1, 2, 3));
Vector<float, 4> q_dot = q.derivative1(Vector3f(1, 2, 3));
// quaternion product
Quatf q_prod_check(
0.93394439f, 0.0674002f, 0.20851f, 0.28236266f);
Quatf q_prod_check(0.93394439f, 0.0674002f, 0.20851f, 0.28236266f);
ut_test(isEqual(q_prod_check, q_check * q_check));
q_check *= q_check;
ut_test(isEqual(q_prod_check, q_check));

Loading…
Cancel
Save