-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
PreFlightCheck: add checks for CPU load #14570
Conversation
if (hrt_elapsed_time(&cpuload_sub.get().timestamp) < 200_ms) { | ||
|
||
// avionics rail | ||
// Check avionics rail voltages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
A few notes that immediately come to mind.
|
@dagar Good points, thanks for your ideas. I'll try to cover them. |
Right, it needs to be added. Similarly something could be added here to require an sd card for operation (optionally) and possibly the offboard logging scenario as well (#13200). |
I just wanted to add a filter and checked the sampling of the cpu load in |
Ok, thanks for looking into it. I might look into getting a higher rate cpuload published (maybe with average included) later. Those occasional cpu spikes are now somewhat more concerning... |
c4567d8
to
17778ee
Compare
I added a parameter that lets you set the threshold and disable the check. So it doesn't silently pass but has to be disabled for SITL. Can we iterate in a separate pr on adding the |
Yes. |
1d076c5
to
21d8583
Compare
I rebased again after a conflict with #14633. Still ready in my eyes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_~
_~ )_)_~
)_))_))_)
_!__!__!_
\______t/
~~~~~~~~~~~~~
Ship it!
Describe problem solved by this pull request
We had cases where people were accidentally taking of with a too highly loaded system even already when it was disarmed. There can be a lot of reasons like custom WIP changes or a combination of board and configuration that exceeds the expected load.
Describe your solution
I add a preflight check that will prevent arming depending on CPU load because it's a low hanging fruit and would have saved crashes before.
Test data / coverage
Untested so far, SITL doesn't provide
cpuload
, not even fake so I'll test it on a pixhawk 4.