As you're probably aware, ROS 2 is built upon the concept of Middleware Interfaces, which abstract from the actual underlying middleware.
One of the main rationales for this design is to allow users / integrators to easily replace whatever middleware is the default with something they want to use. The default right now is DDS, with Fast DDS being the default DDS vendor (this will change to Cyclone DDS in Galactic).
Ultimately, this means that questions such as:
So, is there no TCP transport protocol in ROS2 Foxy ?
do not really have an answer, as there is no direct support in ROS 2 for anything. ROS 2 only supports RMWs, and whatever those RMWs support, ROS 2 supports.
If something is not supported by your configured RMW, ROS 2 will not support it (but again: this is a bit of a strange thing to say, as "ROS 2" will not know what RMW (and ultimately middleware) you have configured).
Perhaps the best answer to your question would be: it depends on what the specific RMW you have configured supports.
My another comprehensive question is: What all transport layer protocols are available in ROS2 Foxy Fitzroy ? (as for example in ROS 1 Noetic, TCP and UDP are supported)
First: please do not include multiple questions in a single post. ROS Answers is a Q&A site (like Stack Overflow), which works best with a 1-to-1 ratio of questions and answers. Multiple questions in a single post have very poor visibility, leading to them getting less answers.
Having written that: I believe what I wrote earlier applies here as well. There is no single answer to your question, as it would depend on what the available RMWs support.
In general you could probably say something like:
- for DDS based RMWs, UDP will be the default, some will allow you to request a TCP transport
- for other RMWs, you'd have to check the documentation of the specific middleware they wrap
Edit:
a) When you say
for DDS based RMWs, UDP will be the default, some will allow you to request a TCP transport
I was having the understanding that all RMWs (i.e. FastRTPS, RTI's Connext, Cyclone etc) are DDS based only. If not, then what are other categories of RMWs beside the DDS-based RMWs ?
Please see my answer to your #q369220. There are a number of non-DDS based middlewares with RMWs available.
b) The following line was not clear to me:
as "ROS 2" will not know what RMW (and ultimately middleware) you have configured
I mean, when we select a particular RMW interface, then can ROS2 not know from it that which RMW we are trying to use ?
seeing as you select an RMW using an environment variable, it's certainly possible to inspect that from any ROS 2 node.
What I meant to say is: by design, apart from the RMWs themselves, ROS 2 code is not supposed to be aware of the specific RMW in use. RMWs ... (more)