Skip to content

Make sleep in ros2_control node optional (backport #3213)#3452

Merged
christophfroehlich merged 2 commits into
jazzyfrom
mergify/bp/jazzy/pr-3213
Jul 13, 2026
Merged

Make sleep in ros2_control node optional (backport #3213)#3452
christophfroehlich merged 2 commits into
jazzyfrom
mergify/bp/jazzy/pr-3213

Conversation

@mergify

@mergify mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

The PR makes the sleep that paces the controller manager loop optional. This can be useful in situations where

  • Hardware sends data from an internal control loop at a fixed rate
  • The hardware interface has a blocking read on that data
  • The blocking hardware interface is the only one running in the controller_manager loop or the other ones aren't significantly affected by that.

I am aware, that this would only cover a subset of all applications facing this issue. I was holding this back because of the efforts made in ros-controls/realtime_tools#478 but since this will require more designing, I wanted to propose this simple fix for simple systems at least.

Did you use Generative AI?

I had help from Cursor to generate the tests, specifically commit 296ae28

Additional Information

I've implemented a PoC using this with the ur_robot_driver in UniversalRobots/Universal_Robots_ROS2_Driver#1760. There, I also describe the impact on joint control that this would have.

TODOs

This is a draft PR for now, as a couple of things aren't finalized, yet. However, I would like some input on the first two points on the list below.

  • Verify concept -- I would like to verify that this concept would be accepted before implementing further
  • Finalize parameter naming -- I just picked a parameter name as I thought it made sense from our use case, but it might not be the best one to describe the behavior.
  • Add tests

This is an automatic backport of pull request #3213 done by [Mergify](https://mergify.com).

(cherry picked from commit 2296fd8)

# Conflicts:
#	controller_manager/CMakeLists.txt
@mergify mergify Bot added the conflicts label Jul 9, 2026
@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 2296fd8 has failed:

On branch mergify/bp/jazzy/pr-3213
Your branch is up to date with 'origin/jazzy'.

You are currently cherry-picking commit 2296fd8.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   controller_manager/doc/userdoc.rst
	new file:   controller_manager/include/controller_manager/sleeping_policies.hpp
	modified:   controller_manager/package.xml
	modified:   controller_manager/src/ros2_control_node.cpp
	new file:   controller_manager/src/sleeping_policies.cpp
	new file:   controller_manager/test/test_sleeping_policies.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   controller_manager/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Removed gmock test for controller manager with resource manager.
@christophfroehlich christophfroehlich requested a review from fmauch July 9, 2026 08:21
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.49%. Comparing base (1a27987) to head (818c345).

Files with missing lines Patch % Lines
controller_manager/src/ros2_control_node.cpp 82.35% 2 Missing and 1 partial ⚠️
controller_manager/src/sleeping_policies.cpp 88.46% 2 Missing and 1 partial ⚠️
controller_manager/test/test_sleeping_policies.cpp 98.38% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            jazzy    #3452      +/-   ##
==========================================
+ Coverage   89.43%   89.49%   +0.06%     
==========================================
  Files         161      163       +2     
  Lines       20568    20651      +83     
  Branches     1630     1633       +3     
==========================================
+ Hits        18395    18482      +87     
+ Misses       1502     1498       -4     
  Partials      671      671              
Flag Coverage Δ
unittests 89.49% <93.33%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
controller_manager/test/test_sleeping_policies.cpp 98.38% <98.38%> (ø)
controller_manager/src/ros2_control_node.cpp 65.62% <82.35%> (+9.74%) ⬆️
controller_manager/src/sleeping_policies.cpp 88.46% <88.46%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fmauch fmauch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested this with UniversalRobots/Universal_Robots_ROS2_Driver#1760 and works as expected :-)

@christophfroehlich christophfroehlich merged commit 0e5ccce into jazzy Jul 13, 2026
15 checks passed
@christophfroehlich christophfroehlich deleted the mergify/bp/jazzy/pr-3213 branch July 13, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants