Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixer parsing fixes #6226

Closed
wants to merge 21 commits into from
Closed

Mixer parsing fixes #6226

wants to merge 21 commits into from

Conversation

LorenzMeier
Copy link
Member

@LorenzMeier LorenzMeier commented Jan 1, 2017

Fixed a parsing corner case and validated in unit test that the fix holds up independent of the packetization interval.

To run in one command:

make tests

To run from the shell:

make posit_sitl_shell none
pxh> tests mixer

Fixes #5118

@LorenzMeier
Copy link
Member Author

Yeah:

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

pxh> tests mixer
INFO  [tests] RUNNING TEST: loadIOPass
INFO  [tests] TEST PASSED: loadIOPass
INFO  [tests] RUNNING TEST: loadQuadTest
INFO  [tests] TEST PASSED: loadQuadTest
INFO  [tests] RUNNING TEST: loadVTOL1Test
INFO  [tests] TEST PASSED: loadVTOL1Test
INFO  [tests] RUNNING TEST: loadVTOL2Test
INFO  [tests] TEST PASSED: loadVTOL2Test
INFO  [tests] RUNNING TEST: mixerTest
INFO  [tests] TEST PASSED: mixerTest
INFO  [modules__unit_test] ALL TESTS PASSED
INFO  [modules__unit_test]   Tests passed :      5
INFO  [modules__unit_test]   Tests failed :      0
INFO  [modules__unit_test]   Tested assertions : 810
pxh> 

@AndreasAntener Can you try with the hardware with this branch?

@LorenzMeier LorenzMeier changed the title WIP: Mixer tests Mixer parsing fixes Jan 1, 2017
@AndreasAntener
Copy link
Member

Great! I verified this on my bench Pixhawk. I also changed the vtol2 mixer slightly to have the combination that failed for me before (I checked again which one it was exactly). Ran the mixer test on hardware as well.

@@ -0,0 +1,28 @@
M: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O-oh, loading fail when this is set to 5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO  [tests] RUNNING TEST: loadComplexTest
ERROR [tests] Mixer text length overflow
ERROR [tests] Mixer load failed with chunk size 16

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stupid me. I'll fix. Can you test your airframe meanwhile?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Home office today, later this week.

@LorenzMeier
Copy link
Member Author

@AndreasAntener I got a little crazy and I'm now actually linking the test to the IO buffer sizes and I'm loading ALL mixers. That means you now can't contribute a mixer which will not load OK.

And it found corner cases which I fixed with the next commits:

pxh> tests mixer
INFO  [tests] RUNNING TEST: loadIOPass
INFO  [tests] TEST PASSED: loadIOPass
INFO  [tests] RUNNING TEST: loadQuadTest
INFO  [tests] TEST PASSED: loadQuadTest
INFO  [tests] RUNNING TEST: loadVTOL1Test
INFO  [tests] TEST PASSED: loadVTOL1Test
INFO  [tests] RUNNING TEST: loadVTOL2Test
INFO  [tests] TEST PASSED: loadVTOL2Test
INFO  [tests] RUNNING TEST: loadComplexTest
ERROR [tests] Mixer text length overflow for file: ROMFS/px4fmu_test/mixers/complex_test.mix. Is PX4IO_MAX_MIXER_LENGHT too small? (curr len: 220)
ERROR [tests] Mixer load failed with chunk size 55
ERROR [tests] TEST FAILED: loadComplexTest
INFO  [tests] RUNNING TEST: loadAllTest
INFO  [tests] Testing all mixers in ROMFS/px4fmu_common/mixers/
ERROR [tests] Mixer text length overflow for file: ROMFS/px4fmu_common/mixers/blade130.main.mix. Is PX4IO_MAX_MIXER_LENGHT too small? (curr len: 220)
ERROR [tests] Mixer load failed with chunk size 7
ERROR [tests] Error testing mixer ROMFS/px4fmu_common/mixers/blade130.main.mix
ERROR [tests] TEST FAILED: loadAllTest
INFO  [tests] RUNNING TEST: mixerTest
INFO  [tests] TEST PASSED: mixerTest
ERROR [modules__unit_test] SOME TESTS FAILED
INFO  [modules__unit_test]   Tests passed :      5
INFO  [modules__unit_test]   Tests failed :      2
INFO  [modules__unit_test]   Tested assertions : 1390
Command 'tests' failed, returned -1

This is necessary to allow more and better unit testing.
We use the real defines now and test them against every mixer on the system. This means we should catch transfer errors now before even hitting master.
@LorenzMeier
Copy link
Member Author

Here is the output of the fixed test:


______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

pxh> tests mixer
INFO  [tests] RUNNING TEST: loadIOPass
INFO  [tests] TEST PASSED: loadIOPass
INFO  [tests] RUNNING TEST: loadQuadTest
INFO  [tests] TEST PASSED: loadQuadTest
INFO  [tests] RUNNING TEST: loadVTOL1Test
INFO  [tests] TEST PASSED: loadVTOL1Test
INFO  [tests] RUNNING TEST: loadVTOL2Test
INFO  [tests] TEST PASSED: loadVTOL2Test
INFO  [tests] RUNNING TEST: loadComplexTest
INFO  [tests] TEST PASSED: loadComplexTest
INFO  [tests] RUNNING TEST: loadAllTest
INFO  [tests] Testing all mixers in ROMFS/px4fmu_common/mixers/
INFO  [tests] TEST PASSED: loadAllTest
INFO  [tests] RUNNING TEST: mixerTest
INFO  [tests] TEST PASSED: mixerTest
INFO  [modules__unit_test] ALL TESTS PASSED
INFO  [modules__unit_test]   Tests passed :      7
INFO  [modules__unit_test]   Tests failed :      0
INFO  [modules__unit_test]   Tested assertions : 4248
pxh> 

@LorenzMeier
Copy link
Member Author

@AndreasAntener Please review / test on HW and merge if it passes.

@AndreasAntener
Copy link
Member

Merged via #6245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mixer loading corner case
2 participants