PX4 / DriverFramework

Operating system and flight stack agnostic driver framework for POSIX (Linux, NuttX, Mac OS, QNX, VxWorks).
82 stars 132 forks source link

Increase priority #231

Closed bartslinger closed 6 years ago

bartslinger commented 6 years ago

When running heavy calculations (opencv) on the Bebop 2 in a low priority thread (35), I got a lot of Accel TIMEOUT warnings. The root cause is because the DriverFramework priority is way too low.

This PR increases DriverFramework priority from 10 to SCHED_PRIORITY_MAX (99).

I also added an interval perf counter on the compass, but could not include that because of dependencies. With this, I noticed something strange with the bebop range finder. Without the bebop range finder, the compass interval would at max be 7524us (target is 5000). When I enable the range finder, this goes up to 16635us. I suppose this is a problem with the range finder, which doesn't work now anyway (https://github.com/PX4/DriverFramework/issues/179).

Fixes https://github.com/PX4/DriverFramework/issues/230

LorenzMeier commented 6 years ago

Cool, thanks!

julianoes commented 6 years ago

So SCHED_PRIORITY_MAX is the same as SCHED_FIFO?

bartslinger commented 6 years ago

SCHED_FIFO is the policy. SCHED_PRIORITY_MAX is the maximum priority within this policy.

http://man7.org/linux/man-pages/man7/sched.7.html

julianoes commented 6 years ago

Oh, I should read the whole line :smile: , thanks!