PX4 Firmware
PX4 Autopilot Software http://px4.io
MatrixTest Class Reference
Inheritance diagram for MatrixTest:
Collaboration diagram for MatrixTest:

Public Member Functions

virtual bool run_tests ()
 Override to run your unit tests. More...
 
- Public Member Functions inherited from UnitTest
 UnitTest ()=default
 
virtual ~UnitTest ()=default
 
void print_results ()
 Prints results from running of unit tests. More...
 

Private Member Functions

bool attitudeTests ()
 
bool filterTests ()
 
bool helperTests ()
 
bool integrationTests ()
 
bool inverseTests ()
 
bool matrixAssignmentTests ()
 
bool matrixMultTests ()
 
bool matrixScalarMultTests ()
 
bool setIdentityTests ()
 
bool sliceTests ()
 
bool squareMatrixTests ()
 
bool transposeTests ()
 
bool vectorTests ()
 
bool vector2Tests ()
 
bool vector3Tests ()
 
bool vectorAssignmentTests ()
 
bool dcmRenormTests ()
 
bool pseudoInverseTests ()
 

Additional Inherited Members

- Protected Member Functions inherited from UnitTest
virtual void _init (void)
 Run before each unit test. Override to provide custom behavior. More...
 
virtual void _cleanup (void)
 Run after each unit test. Override to provide custom behavior. More...
 
void _print_assert (const char *msg, const char *test, const char *file, int line)
 
void _print_compare (const char *msg, const char *v1_text, int v1, const char *v2_text, int v2, const char *file, int line)
 
- Protected Attributes inherited from UnitTest
int _tests_run {0}
 The number of individual unit tests run. More...
 
int _tests_failed {0}
 The number of unit tests which failed. More...
 
int _tests_passed {0}
 The number of unit tests which passed. More...
 
int _assertions {0}
 Total number of assertions tested by all unit tests. More...
 

Detailed Description

Definition at line 48 of file test_matrix.cpp.

Member Function Documentation

◆ attitudeTests()

bool MatrixTest::attitudeTests ( )
private

Referenced by run_tests().

Here is the caller graph for this function:

◆ dcmRenormTests()

bool MatrixTest::dcmRenormTests ( )
private

Definition at line 720 of file test_matrix.cpp.

References err, f(), matrix::Vector< Type, M >::length(), matrix::Dcm< Type >::renormalize(), matrix::Matrix< Type, M, N >::row(), and ut_test.

Here is the call graph for this function:

◆ filterTests()

bool MatrixTest::filterTests ( )
private

Definition at line 332 of file test_matrix.cpp.

References data, matrix::isEqual(), P, matrix::Matrix< Type, M, N >::setIdentity(), and ut_test.

Here is the call graph for this function:

◆ helperTests()

bool MatrixTest::helperTests ( )
private

Definition at line 355 of file test_matrix.cpp.

References f(), matrix::isEqual(), M_PI, ut_test, and matrix::wrap_pi().

Here is the call graph for this function:

◆ integrationTests()

bool MatrixTest::integrationTests ( )
private

Definition at line 378 of file test_matrix.cpp.

References matrix::integrate_rk4(), matrix::isEqual(), and ut_test.

Here is the call graph for this function:

◆ inverseTests()

bool MatrixTest::inverseTests ( )
private

Definition at line 392 of file test_matrix.cpp.

References matrix::abs(), data, matrix::inv(), matrix::max(), and ut_test.

Here is the call graph for this function:

◆ matrixAssignmentTests()

bool MatrixTest::matrixAssignmentTests ( )
private

Definition at line 417 of file test_matrix.cpp.

References matrix::Matrix< Type, M, N >::col(), data, f(), matrix::isEqual(), matrix::Matrix< Type, M, N >::min(), matrix::Matrix< Type, M, N >::row(), matrix::Matrix< Type, M, N >::setZero(), matrix::Matrix< Type, M, N >::swapCols(), matrix::Matrix< Type, M, N >::swapRows(), and ut_test.

Here is the call graph for this function:

◆ matrixMultTests()

bool MatrixTest::matrixMultTests ( )
private

Definition at line 499 of file test_matrix.cpp.

References data, matrix::Matrix< Type, M, N >::emult(), matrix::isEqual(), matrix::Matrix< Type, M, N >::setIdentity(), and ut_test.

Here is the call graph for this function:

◆ matrixScalarMultTests()

bool MatrixTest::matrixScalarMultTests ( )
private

Definition at line 523 of file test_matrix.cpp.

References data, matrix::isEqual(), and ut_test.

Here is the call graph for this function:

◆ pseudoInverseTests()

bool MatrixTest::pseudoInverseTests ( )
private

Definition at line 763 of file test_matrix.cpp.

References A0, matrix::abs(), matrix::geninv(), matrix::inv(), matrix::max(), and ut_test.

Here is the call graph for this function:

◆ run_tests()

bool MatrixTest::run_tests ( )
virtual

Override to run your unit tests.

Unit tests should be called using ut_run_test macro.

Returns
true: all unit tests succeeded, false: one or more unit tests failed

Implements UnitTest.

Definition at line 74 of file test_matrix.cpp.

References attitudeTests(), matrix::Quaternion< Type >::derivative1(), f(), matrix::Quaternion< Type >::from_axis_angle(), matrix::Quaternion< Type >::inversed(), matrix::Quaternion< Type >::invert(), matrix::isEqual(), M_PI, matrix::Vector< Type, M >::normalize(), matrix::Quaternion< Type >::rotate(), test_matrix(), matrix::Quaternion< Type >::to_axis_angle(), matrix::Vector< Type, M >::unit(), ut_declare_test_c, ut_run_test, and ut_test.

Here is the call graph for this function:

◆ setIdentityTests()

bool MatrixTest::setIdentityTests ( )
private

Definition at line 538 of file test_matrix.cpp.

References matrix::Matrix< Type, M, N >::setIdentity(), and ut_test.

Here is the call graph for this function:

◆ sliceTests()

bool MatrixTest::sliceTests ( )
private

Definition at line 557 of file test_matrix.cpp.

References data, matrix::isEqual(), matrix::Matrix< Type, M, M >::slice(), and ut_test.

Here is the call graph for this function:

◆ squareMatrixTests()

bool MatrixTest::squareMatrixTests ( )
private

Definition at line 592 of file test_matrix.cpp.

References matrix::abs(), data, matrix::SquareMatrix< Type, M >::diag(), dt, matrix::expm(), matrix::isEqual(), matrix::max(), and ut_test.

Here is the call graph for this function:

◆ transposeTests()

bool MatrixTest::transposeTests ( )
private

Definition at line 619 of file test_matrix.cpp.

References data, matrix::isEqual(), matrix::Matrix< Type, M, N >::transpose(), and ut_test.

Here is the call graph for this function:

◆ vector2Tests()

bool MatrixTest::vector2Tests ( )
private

Definition at line 649 of file test_matrix.cpp.

References data, f(), and ut_test.

Here is the call graph for this function:

◆ vector3Tests()

bool MatrixTest::vector3Tests ( )
private

Definition at line 676 of file test_matrix.cpp.

References matrix::Vector3< Type >::cross(), data, f(), matrix::isEqual(), and ut_test.

Here is the call graph for this function:

◆ vectorAssignmentTests()

bool MatrixTest::vectorAssignmentTests ( )
private

Definition at line 693 of file test_matrix.cpp.

References matrix::diag(), f(), and ut_test.

Here is the call graph for this function:

◆ vectorTests()

bool MatrixTest::vectorTests ( )
private

Definition at line 631 of file test_matrix.cpp.

References matrix::Vector< Type, M >::dot(), matrix::isEqual(), matrix::Vector< Type, M >::norm(), matrix::Vector< Type, M >::normalize(), matrix::Vector< Type, M >::sqrt(), and ut_test.

Here is the call graph for this function:

The documentation for this class was generated from the following file: