ROS2+ROS_DOMAN_ID

The ROS_DOMAIN_ID?

Table of Contents

  • Overview

  • Choosing a domain ID (short version)

  • Choosing a domain ID (long version)

    • Platform-specific constraints

    • Participant constraints

    • Domain ID to UDP Port Calculator

Overview?

As explained elsewhere, the default middleware that ROS 2 uses for communication is DDS. In DDS, the primary mechanism for having different logical networks share a physical network is known as the Domain ID. ROS 2 nodes on the same domain can freely discover and send messages to each other, while ROS 2 nodes on different domains cannot. All ROS 2 nodes use domain ID 0 by default. To avoid interference between different groups of computers running ROS 2 on the same network, a different domain ID should be set for each group.

如果在不同的電腦上面的node要互相通訊,因為ROS_DOMANI_ID都是默認=0,是沒有問題的,如果希望某一臺電腦不連接到ros2網絡中,可以設置不同的ROS_DOMAIN_ID值,或者可以使用100電腦,組成10個不同的網絡,互相不干擾,只要設置10個不同的ROS_DOMAN_ID值就可以了

Choosing a domain ID (short version)?

The text below explains the derivation of the range of domain IDs that should be used in ROS 2. To skip that background and just choose a safe number, simply choose a domain ID between 0 and 101, inclusive.

我覺得只要在Ubuntu電腦上面的終端輸入

ROS_DOMAIN_ID=0/1/2/...101

?只要是0-101間的數值就可以了,不能超出這個范圍,也就是說可以組100個互不干擾的網絡

Choosing a domain ID (long version)?

The domain ID is used by DDS to compute the UDP ports that will be used for discovery and communication. See?this article?for details on how the ports are computed. Remembering our basic networking, the UDP port is an?unsigned 16-bit integer. Thus, the highest port number that can be allocated is 65535. Doing some math with the formula in the article above, this means that the highest domain ID that can possibly be assigned is 232, while the lowest that can be assigned is 0.

Platform-specific constraints?

For maximum compatibility, some additional platform-specific constraints should be followed when choosing a domain ID. In particular, it is best to avoid allocating domain IDs in the operating system’s?ephemeral port range. This avoids possible conflicts between the ports used by the ROS 2 nodes and other networking services on the computers.

Here are some platform-specific notes about ephemeral ports.

LinuxmacOSWindows

By default, the Linux kernel uses ports 32768-60999 for ephemeral ports. This means that domain IDs 0-101 and 215-232 can be safely used without colliding with ephemeral ports. The ephemeral port range is configurable in Linux by setting custom values in?/proc/sys/net/ipv4/ip_local_port_range. If a custom ephemeral port range is used, the above numbers may have to be adjusted accordingly.

Participant constraints?

For each ROS 2 process running on a computer, one DDS “participant” is created. Since each DDS participant takes up two ports on the computer, running more than 120 ROS 2 processes on one computer may spill over into other domain IDs or the ephemeral ports.

To see why, consider the domain IDs 1 and 2.

  • Domain ID 1 uses port 7650 and 7651 for multicast.

  • Domain ID 2 uses port 7900 and 7901 for multicast.

  • When creating the 1st process (zeroth participant) in domain ID 1, the ports 7660 and 7661 are used for unicast.

  • When creating the 120th process (119th participant) in domain ID 1, the ports 7898 and 7899 are used for unicast.

  • When creating the 121st process (120th participant) in domain ID 1, the ports 7900 and 7901 are used for unicast and overlap with domain ID 2.

If it is known that the computer will only ever be on a single domain ID at a time, and the domain ID is low enough, it is safe to create more ROS 2 processes than this.

When choosing a domain ID that is near the top of the range of platform-specific domain IDs, one additional constraint should be considered.

For instance, assume a Linux computer with a domain ID of 101:

  • The zero’th ROS 2 process on the computer will connect to ports 32650, 32651, 32660, and 32661.

  • The first ROS 2 process on the computer will connect to ports 32650, 32651, 32662, and 32663.

  • The 53rd ROS 2 process on the computer will connect to ports 32650, 32651, 32766, and 32767.

  • The 54th ROS 2 process on the computer will connect to ports 32650, 32651, 32768, and 32769, running into the ephemeral port range.

Thus the maximum number of processes that should be created when using domain ID 101 on Linux is 54. Similarly, the maximum number of processes that should be created when using domain ID 232 on Linux is 63, as the maximum port number is 65535.

The situation is similar on macOS and Windows, though the numbers are different. On macOS and Windows, when choosing a domain ID of 166 (the top of the range), the maximum number of ROS 2 processes that can be created on a computer before running into the ephemeral port range is 120.

Domain ID to UDP Port Calculator?

Domain ID:
Participant ID:

Discovery Multicast Port:
User Multicast Port:
Discovery Unicast Port:
User Unicast Port:

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/214249.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/214249.shtml
英文地址,請注明出處:http://en.pswp.cn/news/214249.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Dockerfile模板和Docker Compose模板

記錄一下Dockerfile模板和Docker Compose模板, 基礎的系統加JDK環境來構建一個Java應用,其Dockerfile內容如下: # 基礎鏡像 FROM openjdk:11.0-jre-buster # 設定時區 ENV TZAsia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/local…

如何搭建廢品上門回收小程序

如今,隨著環境保護意識的增強,廢品的回收和再利用變得越來越重要。為了方便人們進行廢品回收,搭建一個廢品上門回收的小程序成為了一個不錯的選擇。本文將介紹如何從零開始搭建一個廢品上門回收小程序。 …

vue寶典之項目結構介紹

文章目錄 🍁前言🍁Vue.js基本概念🍁Vue.js核心特性🍁Vue.js應用場景🍁Vue項目結構🍁Vue開發流程 目前在學習vue項目,之前只是學習vue中基本語法,當接觸項目時發現vue項目結構之間配置…

【Go自學版】02-goroutine

利用時間片分割進程,致使宏觀上A,B,C同時執行(并發) CPU利用率包含了執行和切換,進程/線程的數量越多,切換成本也會增大 最大并行數:GOMAXPROCS work stealing: 偷其他隊列的G hand off: 當前G1阻塞&#…

css 修改滾動條樣式,解決Windows瀏覽器中滾動條不美觀問題

Windows環境中的瀏覽器中滾動條默認是直接顯示了,不管光標是否進入該區域,這樣就很不美觀,如下圖: 之前樣式為 .well {display: block;background-color: #f2f2f2;border: 1px solid #ccc;margin: 5px;width: calc(100% - 12px);h…

mycat部署和配置讀寫分離(二)

說明: MyCAT 是使用 JAVA 語言進行編寫開發,使用前需要先安裝 JAVA 運行環境(JRE),由于 MyCAT 中使用了 JDK7 中的一些特性,所以要求必須在 JDK7 以上的版本上運行。 1. jdk1.8安裝 詳見jdk環境安裝 2. Mysql安裝 詳見mysql8.0.11源碼安裝…

websoket 的使用

WebSocket是HTML5的API之一,允許瀏覽器和服務器之間進行雙向通信。Vue.js可以輕松地與WebSocket API集成,使用原生WebSocket API或其他WebSocket庫(如socket.io)都是可行的。 下面是一個使用Vue.js實現WebSocket的簡單示例&#…

【lesson11】數據類型之string類型

文章目錄 數據類型分類string類型set類型測試 enum類型測試 string類型的內容查找找所有女生(enum中)找愛好有游泳的人(set中)找到愛好中有足球和籃球的人 數據類型分類 string類型 set類型 說明: set:集…

SL9008 3.6-60V輸入 LED降壓恒流芯片 內置MOS管 帶PWM調光

SL9008是一款內置MOS管、具有PWM調光功能的LED降壓恒流芯片,適用于3.6-60V的輸入電壓范圍。它采用了先進的電路設計,確保了高效率和長壽命,同時具有寬電壓輸入范圍和優異的負載調整率。 SL9008的主要特點包括: 1. 寬輸入電壓范圍&…

C語言中常用的庫函數和頭文件

下面是C語言中常用的一部分庫函數和頭文件,不同編譯器或操作系統可能會有所差異。 1. 字符串相關函數 (string.h): - strlen:獲取字符串長度。 - strcpy、strncpy:復制字符串。 - strcat、strncat:連接字符串…

HarmonyOS4.0開發應用——【ArkUI組件使用】

ArkUI組件使用 這里會詳細演示以下組件使用: ImageTextTextInputButtonSliderColumn&&RowList自定義組件以及相關函數使用 Image 可以是網絡圖片、可以是本地圖片、也可以是像素圖 Image("https://ts1.cn.mm.bing.net/th?idOIP-C.cYA-_PINA-ND9OeBaolDTwHaHa&…

MySQL GTID詳解

概念 GTID 全局事務唯一標識( global transaction identifier) 格式 單個GTID由兩部分組成 ,用冒號分割;前面一部分為server_uuid,后面一部分transaction_id是由事務在源上提交的順序確定的序列號 GTID server_u…

免費熱門的API大全整理

實人認證(人像三要素):輸入姓名、身份證號碼和一張人臉照片,與公安庫身份證頭像進行權威比對,返回比對分值。實名認證(身份證二要素):核驗身份證二要素(姓名和身份證號碼…

CLIP在Github上的使用教程

CLIP的github鏈接:https://github.com/openai/CLIP CLIP Blog,Paper,Model Card,Colab CLIP(對比語言-圖像預訓練)是一個在各種(圖像、文本)對上進行訓練的神經網絡。可以用自然語…

鴻蒙HarmonyOS(ArkTS)語法 聲明變量及注意事項

好 今天我們來看一個基礎的harmonyOS語法 變量聲明 這里 我們還是用 ArkTS項目 我們聲明變量的語法并不是ArkTS的 而是 javaScript 和 TypeScript的 可以看一下下面一張圖 js是最初弱類型語言 于是TS作為js的副類 是一種更嚴謹的數據限定語法 而ArkTS 是TS的改良版 其實我們…

算法通關村第十八關 | 白銀 | 回溯熱門問題

1.組合總和問題 原題&#xff1a;力扣39. 元素可以重復拿取&#xff0c;且題目的測試用例保證了組合數少于 150 個。 class CombinationSum {List<List<Integer>> res new ArrayList<>();List<Integer> path new ArrayList<>();public List…

一篇文章教你快速弄懂 web自動化測試中的三種等待方式

前言 現在的網頁很多都是動態加載的&#xff0c;如果頁面的內容發生了改變&#xff0c;就需要時間來渲染。在咱們做web自動化測試的時候&#xff0c;由于代碼是自動執行的&#xff0c;代碼在執行的時候&#xff0c;有可能上一步操作而加載的元素還沒加載出來&#xff0c;就會報…

配置本地端口鏡像示例(1:1)

本地端口鏡像簡介 本地端口鏡像是指觀察端口與監控設備直接相連&#xff0c;觀察端口直接將鏡像端口復制來的報文轉發到與其相連的監控設備進行故障定位和業務監測。 配置注意事項 觀察端口專門用于鏡像報文的轉發&#xff0c;因此不要在上面配置其他業務&#xff0c;防止鏡像…

建筑學VR虛擬仿真情景實訓教學

首先&#xff0c;建筑學VR虛擬仿真情景實訓教學為建筑學專業的學生提供了一個身臨其境的學習環境。通過使用VR仿真技術&#xff0c;學生可以在虛擬環境中觀察和理解建筑結構、材料、設計以及施工等方面的知識。這種教學方法不僅能幫助學生更直觀地理解復雜的建筑理論&#xff0…

記錄 | ubuntu源碼編譯安裝/更新boost版本

一、卸載當前的版本 1、查看當前安裝的boost版本 dpkg -S /usr/include/boost/version.hpp通過上面的命令&#xff0c;你就可以發現boost的版本了&#xff0c;查看結果可能如下&#xff1a; libboost1.54-dev: /usr/include/boost/version.hpp 2、刪除當前安裝的boost sudo …