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.
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 equivalents introduced). But overal only a small part of ROS 2 can be said to have any relation to ROS 1.
uses DDS as a middleware [..] for centralized discovery
DDS participants by default will use a decentralised approach for discovering peers, and ROS 2 nodes are no exception, so this is a strange thing to state (if not incorrect).
My question is what is exactly the difference at this point i.e. distributed vs centralised
I don't think this question makes much sense at this point: there is nothing centralised about ROS 2 afaik. Or at least not in the parts that you're asking about. Centralised vs decentralised is also not one of the central themes in either ROS 1 or ROS 2.
what does it mean and the use of middleware (why do we need DDS as a middleware (not the advantages of DDS))
The article I linked to earlier might already answer this, so I won't go into this now. However I do believe part of the explanation of "why DDS" will always be based on the relative merits of DDS compared to the custom middleware in ROS 1.
Finally: the ROS 2 Design website was specifically created to answer the sort of questions that you've posted here. That doesn't mean that you can't post here on ROS Answers, but it might be worthwhile to spend some time reading the articles on that site.
Originally posted by gvdhoorn with karma: 86574 on 2018-04-04
This answer was ACCEPTED on the original site
Post score: 20
Comment by aks on 2018-04-04:
Thanks for your explanation but still unclear
Comment by gvdhoorn on 2018-04-04:
What is "unclear"? If you can be specific, we can try to clarify.
Comment by aks on 2018-04-04:\
- according to most of the internet sources ROS is as well peer to peer.
- what is the difference bw Distributed Discovery vs Centralised Discovery ?
- Is ROS a middleware ? if yes, what is the need to have DDS in ROS2 ?
Comment by William on 2018-04-04:
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/changes.html, but I'll raise the issue again that we should have a website for ros2.org, ideally with a basic FAQ.
Comment by gvdhoorn on 2018-04-06:
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?
Comment by aks on 2018-04-06:
@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 :)
Comment by gvdhoorn on 2018-04-06:\
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.
Comment by aks on 2018-04-08:
yes...agreed. I might have been a bit too loud in expressing my thoughts. Sorry for that.