Closed ralph-lange closed 2 years ago
A small question : why are we changing the existing scheduling priority in this example ? Was that causing some problems, or this is just an enhancement ? cc @wjwwood
The motivation of changing the priorities was to have a more realistic example. In Linux, interrupt threads often get priority 50, i.e., exactly (sched_get_priority_min(SCHED_FIFO) + sched_get_priority_max(SCHED_FIFO)) / 2
.
I expect that in most real-world ROS-based application, priorities below this value are sufficient. The original priority of sched_get_priority_max(SCHED_FIFO)
for the high-priority thread in this example is completely exaggerated, cf. my talk at last year's ROS World workshop on execution management (video, slides).
Please note that I implemented the examples_rclcpp_cbg_executor package, i.e., I'm correcting myself with this PR :-)
Chose the configuration of the high prio Executor thread to be below typical threaded interrupt handlers. Explained scheduling configuration in the code.