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

logger causing mavlink manual control dropouts #9009

Closed
dagar opened this issue Mar 4, 2018 · 3 comments
Closed

logger causing mavlink manual control dropouts #9009

dagar opened this issue Mar 4, 2018 · 3 comments
Assignees
Labels

Comments

@dagar
Copy link
Member

dagar commented Mar 4, 2018

When logger is running and you're using mavlink manual control inputs it's common to see RC lost messages that correspond with logger activity, like start/arming (logger writes header, version, parameters, perf data, etc), or later in flight if a PX4_WARN is logged.

image

I'm guessing this is because it's the high priority logger main thread gathering these things which far exceeds the priority of the mavlink receiver thread.

36948901-4c5f4466-1faf-11e8-890a-69765ff2548c

Could we push this back into the the low priority writer thread? https:/PX4/Firmware/blob/master/src/modules/logger/logger.cpp#L1456-L1467

@dagar dagar added the bug label Mar 4, 2018
@LorenzMeier
Copy link
Member

It's actually interfering with the commander monitoring, so we definitely need to fix this. @bkueng At this high priority any activity in the main logger thread has to be limited to pure topic copying. And/or it has to be dropped in priority.

@bkueng
Copy link
Member

bkueng commented Mar 5, 2018

Could we push this back into the the low priority writer thread?

Not really since the mavlink log streaming needs that too. Let me do some testing. A potential easy fix is to insert some usleeps to allow other modules to run.

@bkueng
Copy link
Member

bkueng commented Mar 6, 2018

I could not reproduce this, even when lowering RC loss timeout. Writing log file headers does not use the CPU that long that this alone could trigger RC loss. However what happens is that the main logger thread might need to wait until the full header is written (using usleep so other processes can run in the meanwhile). The duration of this depends on the quality of the SD card, I measured 180ms, and it's a fairly good one.
During that time the semaphore counter used to increase, causing more logger activity afterwards. But this is fixed in #8979, so I'm fairly confident that the root cause here is fixed as well.
If not, please reopen the issue.

I was able to trigger some global position warnings with HIL when increasing the duration that it takes to write the log headers during arming. When applying #8979, these warnings disappeared.

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

No branches or pull requests

3 participants