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

What is the difference between ROS and ROS2 ?

asked 2018-04-04 06:11:25 -0600

aks gravatar image

updated 2023-06-18 10:00:44 -0600

lucasw gravatar image

I know this question has been asked multiple times but i am still unclear about it.

ROS : As per my understanding, ROS is a sort of middleware i.e. between the application layer and the low layer kernels. We have a distributed discovery mechanism i.e. through nodes which registers themselves to the master and communicate with each other.

ROS2 : ROS2 is built up on ROS but uses DDS as a middleware (that means a middleware(ROS) using another middleware (DDS)) for centralized discovery.

My question is what is exactly the difference at this point i.e. distributed vs centralised - what does it mean and the use of middleware(why do we need DDS as a middleware (not the advantages of DDS)) . I know ROS2 is capable of many other things such as real time applications, more flexibility of languages but that does not interest me at the moment. I want to get this simple clarification in my head.

I am sorry for framing this question badly, i know i am myself confused.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
20

answered 2018-04-04 06:48:53 -0600

gvdhoorn gravatar image

updated 2018-04-04 13:38:33 -0600

ROS (1): [..] We have a distributed discovery mechanism [..]

not really. This is already one of the big differences between ROS 1 and 2: ROS 1 has a master, which is central by nature. It's also debatable whether querying the master is really 'discovery', as it's somewhat like a DNS server that returns information in answer to queries submitted to it by clients (it's XML-RPC after all).

ROS 2 does not have this, at all. All nodes are essentially peer-to-peer (barring any partitions and other such 'tricks'). That is a fundamental difference between the two.


Edit:

1 . according to most of the internet sources ROS is as well peer to peer.

You have to realise that p2p data exchange != p2p discovery. The former is possible without the latter. In ROS 1, nodes will ask the master where to find another node that publishes to a particular topic, then use that information to setup a direct connection to that node. The master is then not involved in the data exchange any more. See wiki/Master for more info about this.

But the master is always needed to figure out where other nodes are in ROS 1.

2 . what is the difference bw Distributed Discovery vs Centralised Discovery ?

Briefly: all peers discover each other VS central server keeps list of on-line nodes.

In the former case, every node has the inherent ability to find other nodes, without the help of a central authority. In the latter case, nodes must contact a central authority (ie: the master) to ask it for a list of nodes it knows about.

ROS 1 has a master, ROS 2 does not.

3 . Is ROS a middleware ?

A part of ROS 1 is certainly the middleware, but most people consider ROS to be much more. As described on ros.org/about-ros:

ROS is a flexible framework for writing robot software. It is a collection of tools, libraries, and conventions that aim to simplify the task of creating complex and robust robot behavior across a wide variety of robotic platforms.

The middleware is what makes it possible for those tools and packages to communicate easily. But ROS is definitely more than just the communication infrastructure.

if yes, what is the need to have DDS in ROS2 ?

Similar to ROS 1, part of ROS 2 needs a way for 'the rest' to be able to communicate efficiently. DDS fulfils that role in ROS 2 (ROS 1 uses a custom infrastructure, of which TCPROS is a part). I believe the ROS on DDS article provides some insight into why DDS was considered and why it was eventually chosen.

ROS2 : ROS2 is built up on ROS but uses DDS as a middleware (that means a middleware(ROS) using another middleware (DDS)) for centralized discovery.

ROS 2 is not "built up on ROS (1)". Many of the things we now call "ROS 2" were designed and implemented (almost) from scratch. Some parts were ported (ie: ROS 1 infrastructure removed, ROS 2 ... (more)

edit flag offensive delete link more

Comments

Thanks for your explanation but still unclear

aks gravatar image aks  ( 2018-04-04 06:51:19 -0600 )edit
1

What is "unclear"? If you can be specific, we can try to clarify.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-04 06:52:33 -0600 )edit
  1. according to most of the internet sources ROS is as well peer to peer.
    1. what is the difference bw Distributed Discovery vs Centralised Discovery ?
    2. Is ROS a middleware ? if yes, what is the need to have DDS in ROS2 ?
aks gravatar image aks  ( 2018-04-04 07:49:56 -0600 )edit

Thanks @gvdhoorn for the through answer. We've been trying to capture these things in the design website and we have some technical differences here http://design.ros2.org/articles/chang... , but I'll raise the issue again that we should have a website for ros2.org , ideally with a basic FAQ.

William gravatar image William  ( 2018-04-04 19:44:16 -0600 )edit

If this has answered your question(s) @aakash_sehgal, could I ask you to mark the question as answered by ticking the checkmark to the left of the answer?

gvdhoorn gravatar image gvdhoorn  ( 2018-04-06 03:31:10 -0600 )edit

@gvdhoorn : I will do that...but the following comment is very necessary. This is byfar the BEST explanation i have found after being involved in this topic for a couple of weeks. And as @William said, this must definitely be included in the FAQ. Thanks alot :)

aks gravatar image aks  ( 2018-04-06 03:34:31 -0600 )edit

This is byfar the BEST explanation i have found

I feel this is slightly unfair to the guys at the OSRF and the documentation and design docs they've written. I do believe your comment and questions highlight the need for explanations that perhaps look at things from different perspectives and take different backgrounds and experience into account better.

For me, the (conceptual / architectural) differences between ROS 1 and ROS 2 are actually quite clear. But for someone who is starting fresh it may not all be so apparent.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-06 07:34:41 -0600 )edit

yes...agreed. I might have been a bit too loud in expressing my thoughts. Sorry for that.

aks gravatar image aks  ( 2018-04-08 04:56:49 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2018-04-04 06:11:25 -0600

Seen: 19,201 times

Last updated: Apr 04 '18