Difference between revisions of "Advantech Robotic Suite/ROS DOMAIN ID"

From ESS-WIKI
Jump to: navigation, search
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
<span style="font-size:larger;">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.</span>
+
<span style="font-size:larger;">ROS2 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. ROS2 nodes on the same domain can freely discover and send messages to each other, while ROS2 nodes on different domains cannot. All ROS2 nodes use domain ID 0 by default. To avoid interference between different groups of computers running ROS2 on the same network, a different domain ID should be set for each group.</span>
 
<br><br>
 
<br><br>
<span style="font-size: larger;">You'll have to set ROS domain ID while installation, for Advantech ROS2 Suite, you can choose a domain ID between 0 and 101.</span>
+
<span style="font-size: larger;">The Advantech Robotic Suite offers a convenient method for modifying the ROS_DOMAIN_ID (default is 0).</span>
  
 
= Prerequisite =
 
= Prerequisite =
Please make sure that ROS2 Suite v1.3.0 or higher have been installed in your environment.
+
 
 +
Supported Version: Advantech Robotic Suite v1.3.0 or higher.
 +
 
 +
Supported Platform: x86_64
  
 
= How to =
 
= How to =
=== Set ROS_DOMAIN_ID of the ROS2 Suite Application ===
+
 
<span style="font-size:larger;">Command for set ROS_DOMAIN_ID of the ROS2 suite application.</span>
+
=== Set ROS_DOMAIN_ID&nbsp; ===
<span style="color:red;">Note: Currently, this function only supports for ROS2 humble.</span>
+
 
<pre>
+
<span style="font-size:larger;">Script to set ROS_DOMAIN_ID in range 0~101.</span>
$ cd /usr/local/Advantech/ros
+
<pre>$ cd /usr/local/Advantech/ros
$ bash -i change-ros-domain-id.sh
+
$ ./change-ros-domain-id.sh
 
</pre>
 
</pre>
<br>
+
[[File:ROS2 set ROS_DOMAIN_ID.png|none|ROS2 set ROS_DOMAIN_ID]]
  
=== Set ROS_DOMAIN_ID in Host Manually ===
+
<span style="font-size:larger;">Confirm whether the variable is modified successfully in host.</span>
Please refer to [[ROS2_Suite/Q&A#How_to_set_ROS_DOMAIN_ID_in_host|Q&A : How to set ROS_DOMAIN_ID in host]]
+
<pre>$ echo $ROS_DOMAIN_ID
<br><br>
+
</pre>
  
=== Set ROS_DOMAIN_ID in Docker Container Manually ===
+
<span style="font-size:larger;">Confirm whether the variable is modified successfully in container.</span>
Step1: Open docker-compose.yml
+
<pre>$ docker exec -it edge-ros2-foxy bash
<pre>
+
$ echo $ROS_DOMAIN_ID
$ cd /usr/local/Advantech/ros/container/docker/docker-compose/<docker_container_name>
 
$ vim docker-compose.yml
 
</pre>
 
Step2: Set ROS_DOMAIN_ID=<your_domain_id> in docker-compose.yml
 
.
 
.
 
.
 
    environment:
 
    - ROS_DOMAIN_ID=<span style="color:#e74c3c; font-weight:bold;"><your_domain_id></span>
 
.
 
.
 
.
 
Step3: Restart container for update environment variables of docker container
 
<pre>
 
$ cd /usr/local/Advantech/ros/container/docker
 
$ ./stop.sh <docker_container_name>
 
$ ./launch.sh <docker_container_name>
 
 
</pre>
 
</pre>
 +
 +
=== Note ===
 +
 +
If you want to set ROS_DOMAIN_ID in host or container by manually, please refer to [[Advantech_Robotic_Suite/Q&A#How to set ROS_DOMAIN_ID|Q&A : How to set ROS_DOMAIN_ID]]

Latest revision as of 04:09, 5 March 2024

Introduction

ROS2 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. ROS2 nodes on the same domain can freely discover and send messages to each other, while ROS2 nodes on different domains cannot. All ROS2 nodes use domain ID 0 by default. To avoid interference between different groups of computers running ROS2 on the same network, a different domain ID should be set for each group.

The Advantech Robotic Suite offers a convenient method for modifying the ROS_DOMAIN_ID (default is 0).

Prerequisite

Supported Version: Advantech Robotic Suite v1.3.0 or higher.

Supported Platform: x86_64

How to

Set ROS_DOMAIN_ID 

Script to set ROS_DOMAIN_ID in range 0~101.

$ cd /usr/local/Advantech/ros
$ ./change-ros-domain-id.sh
ROS2 set ROS_DOMAIN_ID

Confirm whether the variable is modified successfully in host.

$ echo $ROS_DOMAIN_ID

Confirm whether the variable is modified successfully in container.

$ docker exec -it edge-ros2-foxy bash
$ echo $ROS_DOMAIN_ID

Note

If you want to set ROS_DOMAIN_ID in host or container by manually, please refer to Q&A : How to set ROS_DOMAIN_ID