I know that is a question that has been asked too many times, but still its not clear to me. I read online that it isn't but some people say that they control their robots under ROS in applications with hard real time constraints. So, because I need some technical arguments (rather than a plain "ros is not real time") I will be more specific (suppose we have ROS under a RTOS):

  1. I read that ROS uses a TCP/IP-based communication for ROS topics and I know that TCP/IP is not reliable. That means I cannot use topics in a real time loop? For instance send a control signal to my system publishing it to a topic, and the system sending me some feedback via a topic?
  2. If I have a RTOS (eg Linux+Xenomai) can I build a real time control loop for a robot using ROS, or ROS will be a bottleneck?

Maybe the above are naive or I lack some knowledge, so please enlighten me!

Note: I define as a hard real time system (eg in 1KHz), the system that can guarantee that we will not miss a thing (if the control loop fails to run every 1ms the system fails).

  • $\begingroup$ Remind me in a few days when I get to a computer and I'll explain. $\endgroup$
    – Shahbaz
    Commented Jun 6, 2015 at 7:41
  • $\begingroup$ Welcome to robotics jason, but I'm afraid that compound questions like this really aren't a good fit for a stack exchange site. We prefer practical, answerable questions based on actual problems that you face, so you would be more likely to get comprehensive answers if you split them into separate question. Take a look at How to Ask and tour for more information on how stack exchange works. $\endgroup$
    – Mark Booth
    Commented Jun 7, 2015 at 10:29
  • $\begingroup$ Can you please clarify your definition of "real time". I assume you mean that the control updates at faster than 25Hz otherwise. $\endgroup$
    – user9092
    Commented Jun 10, 2015 at 9:50
  • $\begingroup$ @Shahbaz As real time I define a system that updates the control in some high frequency (eg 200Hz+), but the most important is to provide guarantees that every control cycle will be performed in 200Hz, and we don't lose control cycles due to jitter. $\endgroup$
    – jason
    Commented Jun 24, 2015 at 10:15
  • $\begingroup$ @jason, realtime doesn't relate to fast. You are correct that a realtime system guarantees deadlines. I understand that you are searching for a fast system, but I'm clarifying for JamesR that a realtime system could be designed for any speed, even if the cycle time is one day! $\endgroup$
    – Shahbaz
    Commented Jun 24, 2015 at 14:14

1 Answer 1


ROS is not a real-time operating system. The purpose of ROS was not to be like VXWorx (which is what the Mars Curiosity rover uses). ROS was developed to be a simple, generic, reusable platform for everyone to contribute to and use. Developers would be able to add their own abstracted modules, building a rich community of reusable code. The key here is that ROS is meant to save development time, not to ensure real-time operations. This addresses your point #6.

Simplest reason ROS is not real-time: the version of Linux it sits on is not real-time.

To point 1, the unreliability of TCP/IP is a good point, but in itself, that doesn't mean that a system with TCP/IP cannot be a real-time system. "Real-time" simply means that 2 guarantees are always made:

1) a task is guaranteed to have a completion time - an absolute deadline, and 2) if that deadline cannot be achieved, a warning about this failure will be made.

That should also explain points 2 & 3.

Not sure about point 4.

For point 5: Yes, there is a benefit, but for some architectures to be able to accomplish this, we would need a real-time OS slice (also called a base operating layer), and this may be too burdensome for some projects.

I hope that helps, Ryan

  • $\begingroup$ So, If I patch the linux kernel (eg with Xenomai) and have a RTOS underneath ROS, I would be able to use every ROS functionalies (eg ROS topics) without creating a bottleneck, breaking the realtimeness of my control loop? $\endgroup$
    – jason
    Commented Jun 6, 2015 at 17:03
  • 1
    $\begingroup$ @jason, ROS is non-realtime by nature. Making it run on a realtime system doesn't make it real-time at all. $\endgroup$
    – Shahbaz
    Commented Jun 8, 2015 at 8:35

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.