Fail to list ros2 topics when ubuntu publish topics with same ros_domain_id and same subnet.
Mostra commenti meno recenti
Env: Ubuntu 20.04 LTS VM; ROS2-Foxy; Middle DDS Implementation: Fast/Cyclone; Topics published by px4_ros_com.
When i set ros_domain_id=0 both in ubuntu and matlab, it seems that matlab or ubuntu local could list topics with same id. However, when i set ros_domain_id to non-zero value, matlab or ubuntu local could only list topics with id=0. For example, i set ros_domain_id to 25 and pulish topics of px4_msgs, matlab and ubuntu local with ros_domain_id = 0 can list topics instead of ros_domain_id = 25.
8 Commenti
Cam Salzberger
il 6 Mag 2022
How are you specifying the domain ID when you try to list topics? In Simulink or in MATLAB Command Window?
Have you tried both of these methods (for MATLAB):
setenv('ROS_DOMAIN_ID', '25')
ros2 topic list
and:
ros2 topic list DomainID 25
-Cam
景宇 刘
il 6 Mag 2022
Cam Salzberger
il 6 Mag 2022
Then let's try to narrow down on the problem. Determine if the issue is specific to the domain even within MATLAB, or if it only applies to external nodes.
% Set up 2 networks
node0 = ros2node('/node_0', 0);
pub0 = ros2publisher(node0, '/topic_0', 'std_msgs/String');
node25 = ros2node('/node_25', 25);
pub25 = ros2publisher(node25, '/topic_25', 'std_msgs/String');
% Check if nodes and topics are visible
ros2('topic', 'list', 'DomainID', 0); % Dummy call - get the introspection node on 0
pause(5) % Wait for introspection node to pick up metacommunication
nodeList0 = ros2('node', 'list', 'DomainID', 0)
topicList0 = ros2('topic', 'list', 'DomainID', 0)
ros2('topic', 'list', 'DomainID', 25); % Dummy call
pause(5) % Wait for metacommunication
nodeList25 = ros2('node', 'list', 'DomainID', 25)
topicList25 = ros2('topic', 'list', 'DomainID', 25)
What are the results of running that code?
-Cam
景宇 刘
il 7 Mag 2022
Cam Salzberger
il 7 Mag 2022
Sounds like it. There are a couple of other posts I've made on ROS 2 communication issues. It's focused on Domain ID and subnet, but there are additional troubleshooting steps too. Give them a look and see if it resolves or helps narrow down on the problem:
-Cam
景宇 刘
il 8 Mag 2022
Cam Salzberger
il 9 Mag 2022
景宇 刘
il 9 Mag 2022
Risposte (1)
Josh Chen
il 10 Gen 2023
0 voti
Hi Jingyu,
I hope you've found a solution to this issue. If not, please also feel free to also reach out to our techinical support team, and we can take a closer look.
For people who might face simimlar issue, as Cam pointed, you may also want to check the following to links to see if they can help resolving the issue or narrowing down the root cause:
Thanks,
Josh
Categorie
Scopri di più su ROS 2 Network Connection and Exploration in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!