Rosanswers logo

I'm trying to get data from a ROS node at 100 Hz. Unfortunately, although the average is 100 Hz, it degrades sometimes to 25 Hz for a few samples. This wouldn't be a problem if it happened occasionally, but it happens about every 7th sample. My questions are as follows:

1)Is there a way to make the publishing more regular with standard ROS/Linux methods? (higher priority?)

2)Would using the ros realtime tools help at all and if so, can they be used without being run in the pr2_controller_manager?

Looking over documentation and other questions on this forum, it just isn't clear if the ros realtime tools can be used without having to modify the pr2_controller_manager for my specific robot.

I'm aware that orocos rtt is another option and I am already using it for a different part of the same controller. Any thoughts or suggestions would be very much appreciated. Thanks.

EDIT: As a side note, even without using a real-time kernel, if I use orocos rtt components, I get much less jitter and more determinism in my loop (they must be doing good things with the threading and priorities). I'm wondering if the benefit of using the ros realtime tools is the same even without having to install a patched kernel.

Originally posted by mkillpack on ROS Answers with karma: 340 on 2013-01-24

Post score: 1


1 Answer 1


Rosanswers logo

The regularity of your controller is mainly due to the fact that your kernel scheduling strategy is different so in that sense using realtime_tools will not help you.

But otherwise, I have been using the real-time publishers in my non-PR2 related controller without any trouble in the sense that this piece of code is quite simple and just rely on threading to make publishing non-blocking. So I have this code running in both an alternative Linux RT OS (compared to the one used by PR2) and in simulation on my desktop computer with the usual kernel Ubuntu provides.

So if your goal is to have better performances by having a non-blocking publisher then yes it will help but as far as "regularity" goes depending on your code it may or may not help.

Note: realtime_tools package really have nothing to do with PR2 in fact, it could be as well merged into roscpp without any problem so you won't have to touch the pr2_controller_manager to use this package.

Originally posted by Thomas with karma: 4478 on 2013-01-24

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by mkillpack on 2013-01-25:
I guess I was under the misconception that it was the pr2_controller_manager that was enforcing realtime on the controllers if you have a real-time kernel. Thanks.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.