Skip to content
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

[RTPublisher] use NON_POLLING as default for the realtime pubisher #280

Merged

Conversation

saikishor
Copy link
Member

Fixes: #212

As reported by @bijoua29

I ran some tests with non-polling in some controllers and perf doesn't even report the sleep anymore. Most of the work is now in the DDS publish() method.

I did another test where I compiled realtime_tools from source and set it to non-polling. When I ran my full stack, the CPU usage of ros2 control node reduced from ~75% to ~52% CPU i.e. around a 30% reduction in CPU usage. Note: this is percent of 1 CPU so since I have 32 CPUs the actual usage is 1/32 of that.

@saikishor saikishor added backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS 2 humble. backport-jazzy This label should be used by maintainers only! Label triggers PR backport to ROS 2 humble. labels Feb 18, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.76%. Comparing base (c9639fb) to head (711b973).

Files with missing lines Patch % Lines
include/realtime_tools/realtime_publisher.hpp 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #280      +/-   ##
==========================================
- Coverage   72.25%   71.76%   -0.50%     
==========================================
  Files           8        8              
  Lines         483      471      -12     
  Branches       77       74       -3     
==========================================
- Hits          349      338      -11     
+ Misses         87       86       -1     
  Partials       47       47              
Flag Coverage Δ
unittests 71.76% <87.50%> (-0.50%) ⬇️

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

Files with missing lines Coverage Δ
include/realtime_tools/realtime_publisher.hpp 97.67% <87.50%> (+1.31%) ⬆️

@christophfroehlich christophfroehlich linked an issue Feb 18, 2025 that may be closed by this pull request
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup and even improving it. LGTM, but let's wait for some real-world tests

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Great work! Thanks!

@destogl destogl merged commit 386282f into ros-controls:master Feb 19, 2025
12 checks passed
mergify bot pushed a commit that referenced this pull request Feb 19, 2025
)

* Remove the non_polling tests as they are redundant now
* scope instead of calling unlock method
* Use memory orders with atomic State
* Change the turn_ to be aligned with the corresponding loop

(cherry picked from commit 386282f)

# Conflicts:
#	CMakeLists.txt
mergify bot pushed a commit that referenced this pull request Feb 19, 2025
)

* Remove the non_polling tests as they are redundant now
* scope instead of calling unlock method
* Use memory orders with atomic State
* Change the turn_ to be aligned with the corresponding loop

(cherry picked from commit 386282f)

# Conflicts:
#	CMakeLists.txt
destogl pushed a commit that referenced this pull request Feb 19, 2025
…ackport #280) (#282)

* Remove the non_polling tests as they are redundant now
* scope instead of calling unlock method
* Use memory orders with atomic State
* Change the turn_ to be aligned with the corresponding loop
-----
Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
@saikishor saikishor deleted the use/non_polling/rt_publisher branch February 20, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS 2 humble. backport-jazzy This label should be used by maintainers only! Label triggers PR backport to ROS 2 humble.
Projects
None yet
5 participants