0
$\begingroup$

Rosanswers logo

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).


Originally posted by dantard on ROS Answers with karma: 59 on 2011-05-08

Post score: 4


Original comments

Comment by JonW on 2011-05-10:
You may also want to have a look at the PR2 controller node. http://www.ros.org/wiki/pr2_controller_manager

Comment by raphael favier on 2011-05-08:
Hello, this falls outside of my knowledge but maybe this post can help you: http://answers.ros.org/question/298/a-hard-real-time-ros

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by JonW with karma: 586 on 2011-05-10

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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(internalCallbackQueueThreadFunc);

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.


Originally posted by dantard with karma: 59 on 2011-05-11

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Asomerville on 2011-05-11:
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 http://answers.ros.org/faq/ for more details.

$\endgroup$

Your Answer

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