diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2015-04-12 17:13:30 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2015-04-12 17:13:30 +0200 |
commit | 3b89a2533f8671504db6799eedeb058033434ac3 (patch) | |
tree | 581b7ccfb10ccef40e30a80e7fd5a0fb94239444 /src/systemcmds | |
parent | 7761e461e94d6055b57f9dcaadbfa1943ecfb247 (diff) | |
download | px4-firmware-3b89a2533f8671504db6799eedeb058033434ac3.tar.gz px4-firmware-3b89a2533f8671504db6799eedeb058033434ac3.tar.bz2 px4-firmware-3b89a2533f8671504db6799eedeb058033434ac3.zip |
test_mathlib fixed
Diffstat (limited to 'src/systemcmds')
-rw-r--r-- | src/systemcmds/tests/test_mathlib.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/systemcmds/tests/test_mathlib.cpp b/src/systemcmds/tests/test_mathlib.cpp index 3a890c30b..7460f6f55 100644 --- a/src/systemcmds/tests/test_mathlib.cpp +++ b/src/systemcmds/tests/test_mathlib.cpp @@ -300,7 +300,7 @@ int test_mathlib(int argc, char *argv[]) R.from_euler(roll, pitch, yaw); q.from_euler(roll, pitch, yaw); vector_r = R * vector; - vector_q = q.rotate(vector); + vector_q = q.conjugate(vector); for (int i = 0; i < 3; i++) { if (fabsf(vector_r(i) - vector_q(i)) > tol) { @@ -315,7 +315,7 @@ int test_mathlib(int argc, char *argv[]) // test some values calculated with matlab tol = 0.0001f; q.from_euler(M_PI_2_F, 0.0f, 0.0f); - vector_q = q.rotate(vector); + vector_q = q.conjugate(vector); Vector<3> vector_true = {1.00f, -1.00f, 1.00f}; for (unsigned i = 0; i < 3; i++) { @@ -326,7 +326,7 @@ int test_mathlib(int argc, char *argv[]) } q.from_euler(0.3f, 0.2f, 0.1f); - vector_q = q.rotate(vector); + vector_q = q.conjugate(vector); vector_true = {1.1566, 0.7792, 1.0273}; for (unsigned i = 0; i < 3; i++) { @@ -337,7 +337,7 @@ int test_mathlib(int argc, char *argv[]) } q.from_euler(-1.5f, -0.2f, 0.5f); - vector_q = q.rotate(vector); + vector_q = q.conjugate(vector); vector_true = {0.5095, 1.4956, -0.7096}; for (unsigned i = 0; i < 3; i++) { @@ -348,7 +348,7 @@ int test_mathlib(int argc, char *argv[]) } q.from_euler(M_PI_2_F, -M_PI_2_F, -M_PI_F / 3.0f); - vector_q = q.rotate(vector); + vector_q = q.conjugate(vector); vector_true = { -1.3660, 0.3660, 1.0000}; for (unsigned i = 0; i < 3; i++) { @@ -359,4 +359,4 @@ int test_mathlib(int argc, char *argv[]) } } return rc; -}
\ No newline at end of file +} |