mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 19:21:35 +08:00
update matrix and fix test_matrix (#6524)
This commit is contained in:
+1
-1
Submodule src/lib/matrix updated: c31686379c...e2211c5867
@@ -4,6 +4,7 @@
|
|||||||
#include <matrix/math.hpp>
|
#include <matrix/math.hpp>
|
||||||
#include <matrix/filter.hpp>
|
#include <matrix/filter.hpp>
|
||||||
#include <matrix/integration.hpp>
|
#include <matrix/integration.hpp>
|
||||||
|
#include <matrix/Quaternion.hpp>
|
||||||
|
|
||||||
using namespace matrix;
|
using namespace matrix;
|
||||||
|
|
||||||
@@ -58,10 +59,10 @@ bool MatrixTest::run_tests()
|
|||||||
|
|
||||||
ut_declare_test_c(test_matrix, MatrixTest)
|
ut_declare_test_c(test_matrix, MatrixTest)
|
||||||
|
|
||||||
|
using matrix::Dcmf;
|
||||||
template class matrix::Quaternion<float>;
|
using matrix::Quatf;
|
||||||
template class matrix::Euler<float>;
|
using matrix::Eulerf;
|
||||||
template class matrix::Dcm<float>;
|
using matrix::Vector3f;
|
||||||
|
|
||||||
bool MatrixTest::attitudeTests()
|
bool MatrixTest::attitudeTests()
|
||||||
{
|
{
|
||||||
@@ -207,11 +208,10 @@ bool MatrixTest::attitudeTests()
|
|||||||
ut_test(isEqual(q_from_m, m4));
|
ut_test(isEqual(q_from_m, m4));
|
||||||
|
|
||||||
// quaternion derivate
|
// 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
|
// quaternion product
|
||||||
Quatf q_prod_check(
|
Quatf q_prod_check(0.93394439f, 0.0674002f, 0.20851f, 0.28236266f);
|
||||||
0.93394439f, 0.0674002f, 0.20851f, 0.28236266f);
|
|
||||||
ut_test(isEqual(q_prod_check, q_check * q_check));
|
ut_test(isEqual(q_prod_check, q_check * q_check));
|
||||||
q_check *= q_check;
|
q_check *= q_check;
|
||||||
ut_test(isEqual(q_prod_check, q_check));
|
ut_test(isEqual(q_prod_check, q_check));
|
||||||
|
|||||||
Reference in New Issue
Block a user