Enable FIFO scheduling by default for RTDE communication thread#536
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #536 +/- ##
==========================================
- Coverage 79.10% 78.90% -0.21%
==========================================
Files 115 115
Lines 6766 6768 +2
Branches 2988 2991 +3
==========================================
- Hits 5352 5340 -12
- Misses 1045 1055 +10
- Partials 369 373 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
urfeex
approved these changes
Jul 6, 2026
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the scheduling configuration of the thread responsible for receiving and processing robot communication data.
RTDE background read thread
When
read_packages_in_backgroundis enabled, the RTDE client creates a dedicated background thread for continuously receiving RTDE data packages.Previously, this thread was executed using the operating system's default scheduling policy. Under system load, scheduling delays could introduce additional latency and timing jitter while processing incoming RTDE data.
This PR configures the RTDE background read thread to request the highest available FIFO scheduling priority using the existing helper functions.
This follows the same approach already used by the producer thread inside
Pipeline::runProducer().Universal_Robots_Client_Library/include/ur_client_library/comm/pipeline.h
Lines 429 to 437 in 8b4495c
Pipeline default scheduling
The
Pipelineconstructor previously defaultedproducer_fifo_schedulingtofalse, meaning that FIFO scheduling was not requested unless explicitly enabled.Universal_Robots_Client_Library/include/ur_client_library/comm/pipeline.h
Lines 305 to 306 in 8b4495c
This PR changes the default value to
true, making the producer thread request FIFO scheduling by default.As a result, both the RTDE background read thread and the pipeline producer thread now consistently request FIFO scheduling unless explicitly disabled.
Note
Low Risk
Change is limited to thread scheduling hints with graceful fallback on failure; no protocol, auth, or data-path logic changes.
Overview
When background RTDE package reading is enabled, the dedicated read thread now requests maximum
SCHED_FIFOpriority at thread entry viasetFiFoScheduling, matching the approach already used in the pipeline producer thread.This adds the
helpers.hinclude needed for that helper. The goal is to reduce scheduling latency and jitter on incoming RTDE data under system load; if the process lacks permission for FIFO scheduling, existing helper behavior applies (warning, thread continues with default scheduling).Reviewed by Cursor Bugbot for commit 8d93a85. Bugbot is set up for automated code reviews on this repo. Configure here.