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

Public Member Functions

virtual bool run_tests ()
 Override to run your unit tests. More...
 
 MixerTest ()=default
 
- 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 mixerTest ()
 
bool loadIOPass ()
 
bool loadVTOL1Test ()
 
bool loadVTOL2Test ()
 
bool loadQuadTest ()
 
bool loadComplexTest ()
 
bool loadAllTest ()
 
bool load_mixer (const char *filename, unsigned expected_count, bool verbose=false)
 
bool load_mixer (const char *filename, const char *buf, unsigned loaded, unsigned expected_count, const unsigned chunk_size, bool verbose)
 

Private Attributes

MixerGroup mixer_group
 

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 94 of file test_mixer.cpp.

Constructor & Destructor Documentation

◆ MixerTest()

MixerTest::MixerTest ( )
default

Member Function Documentation

◆ load_mixer() [1/2]

bool MixerTest::load_mixer ( const char *  filename,
unsigned  expected_count,
bool  verbose = false 
)
private

Definition at line 224 of file test_mixer.cpp.

References load_mixer_file(), and PX4IO_MAX_TRANSFER_LEN.

Referenced by loadAllTest(), loadComplexTest(), loadQuadTest(), loadVTOL1Test(), loadVTOL2Test(), mixerTest(), and ut_declare_test_c().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_mixer() [2/2]

bool MixerTest::load_mixer ( const char *  filename,
const char *  buf,
unsigned  loaded,
unsigned  expected_count,
const unsigned  chunk_size,
bool  verbose 
)
private

Definition at line 248 of file test_mixer.cpp.

References MixerGroup::count(), MixerGroup::load_from_buf(), mixer_callback(), mixer_group, mixer_text, mixer_text_length, PX4IO_MAX_MIXER_LENGTH, MixerGroup::reset(), and ut_compare.

Here is the call graph for this function:

◆ loadAllTest()

bool MixerTest::loadAllTest ( )
private

Definition at line 155 of file test_mixer.cpp.

References load_mixer(), MIXER_ONBOARD_PATH, and PATH_MAX.

Referenced by run_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadComplexTest()

bool MixerTest::loadComplexTest ( )
private

Definition at line 150 of file test_mixer.cpp.

References load_mixer(), and MIXER_PATH.

Referenced by run_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadIOPass()

bool MixerTest::loadIOPass ( )
private

Referenced by run_tests().

Here is the caller graph for this function:

◆ loadQuadTest()

bool MixerTest::loadQuadTest ( )
private

Definition at line 135 of file test_mixer.cpp.

References load_mixer(), and MIXER_PATH.

Referenced by run_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadVTOL1Test()

bool MixerTest::loadVTOL1Test ( )
private

Definition at line 140 of file test_mixer.cpp.

References load_mixer(), and MIXER_PATH.

Referenced by run_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadVTOL2Test()

bool MixerTest::loadVTOL2Test ( )
private

Definition at line 145 of file test_mixer.cpp.

References load_mixer(), and MIXER_PATH.

Referenced by run_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixerTest()

bool MixerTest::mixerTest ( )
private

Definition at line 341 of file test_mixer.cpp.

References matrix::abs(), actuator_controls, f(), hrt_absolute_time(), hrt_abstime, hrt_elapsed_time(), INIT_TIME_US, load_mixer(), MixerGroup::mix(), MIXER_DIFFERENCE_THRESHOLD, mixer_group, MIXER_PATH, output_limit_calc(), output_limit_init(), output_max, PWM_DEFAULT_MAX, PWM_DEFAULT_MIN, PWM_LOWEST_MIN, PWM_MOTOR_OFF, r_page_servo_control_max, r_page_servo_control_min, r_page_servo_disarmed, r_page_servos, RAMP_TIME_US, should_arm, and should_prearm.

Referenced by run_tests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_tests()

bool MixerTest::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 115 of file test_mixer.cpp.

References UnitTest::_tests_failed, loadAllTest(), loadComplexTest(), loadIOPass(), loadQuadTest(), loadVTOL1Test(), loadVTOL2Test(), mixerTest(), and ut_run_test.

Here is the call graph for this function:

Member Data Documentation

◆ mixer_group

MixerGroup MixerTest::mixer_group
private

Definition at line 112 of file test_mixer.cpp.

Referenced by load_mixer(), and mixerTest().


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