ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How much can I control ROS real-time behavior?

asked 2011-05-08 21:36:22 -0500

dantard gravatar image

Hello all, I'm quite new on ROS and I've a question which answer could not find in the web. The question is originated by this phrase: "ROS is not a realtime framework, though it is possible to integrate ROS with realtime code"

My question is: How can I control ROS real-time behavior? I know I can control process priority with 'nice' and 'renice' commands but not single threads' priority. In short I'd like to know how many "hidden" threads (I refer for example to communication threads, rostcp, etc...) and if it is possible to change their priority and manage their activation in any way.

On the other hand I read about orocos-ros integration. However if I'm right it is limited to visualize orocos' nodes status while all the control work is performed by RTT. Am I right?

Thanks in advance for the answer(s).

edit retag flag offensive close merge delete


Hello, this falls outside of my knowledge but maybe this post can help you:
raphael favier gravatar image raphael favier  ( 2011-05-08 21:50:03 -0500 )edit
You may also want to have a look at the PR2 controller node.
JonW gravatar image JonW  ( 2011-05-10 01:47:44 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-05-10 22:54:58 -0500

JonW gravatar image

Assuming you are using Linux, the function you are looking for may be pthread_setschedparam This appears to allow the priority of individual threads to be set without renicing the parent process.

edit flag offensive delete link more

answered 2011-05-11 03:16:11 -0500

dantard gravatar image

Hello, thanks for the answer. I was aware about this function, but I was referring about internal ROS threads like communication threads, XMLRPC and so on. I'm being investigating a little in the code and I saw that there are at least 3 threads that ROS uses for its internal operations in client library:


boost::thread(&PollManager::threadFunc, this);

boost::thread(boost::bind(&XMLRPCManager::serverThreadFunc, this));

While the task of the last one is clear to me and I can understand of the first one (even if the correspondent queue seems to be always empty), I'd like to know what does the second thread polls :).

On the other hand: there are more than these three threads in the client libraries?

Thanks for the answers.

edit flag offensive delete link more


Dantard, adding answers to continue a discussion is discouraged as it breaks the way answers.ros works. The comments section of individual answers is ok, but in depth discussion is better on the mailing list. See for more details.
Asomerville gravatar image Asomerville  ( 2011-05-11 04:58:04 -0500 )edit

Question Tools


Asked: 2011-05-08 21:36:22 -0500

Seen: 1,502 times

Last updated: May 11 '11