ros2 / ros2/ros2cli

A few of `ros2 doctor hello` enhancement.

Open
#1,077 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
262
Forks
228
Avg merge
23h 15m
Merged PRs (30d)
12

Description

Description

The following enhancement can be added to ros2 doctor hello command.

  • include localhost connectivity check for the topic and multicast. currently it excludes the localhost (same hostname) connectivity check intentionally, but i do not find any reason to exclude this localhost connection check.
  • UDP multicast group/port should be configurable via command line argument. Usually in practical environment, users would have specified multicast group and port number to be configured for their requirements, having those optional argument available, ros2 doctor hello can help the multicast connectivity check without code change.
  • we could add service and action connectivity check aligned with topics.
Motivation

motivation are described above.

Design / Implementation Considerations
  • localhost inclusion: we can simply remove the following if statement to include the same hostname information in the summary table.
diff --git a/ros2doctor/ros2doctor/verb/hello.py b/ros2doctor/ros2doctor/verb/hello.py
index 04fd666..cf5d483 100644
--- a/ros2doctor/ros2doctor/verb/hello.py
+++ b/ros2doctor/ros2doctor/verb/hello.py
@@ -160,8 +160,7 @@ class HelloSubscriber:
     def _callback(self, msg):
         msg_data = msg.data.split()
         pub_hostname = msg_data[-1]
-        if pub_hostname != socket.gethostname():
-            self._summary_table.increment_sub(pub_hostname)
+        self._summary_table.increment_sub(pub_hostname)


 class HelloMulticastUDPSender:
@@ -225,8 +224,7 @@ class HelloMulticastUDPReceiver:
                 data, _ = self._socket.recvfrom(4096)
                 data = data.decode('utf-8')
                 sender_hostname = data.split()[-1]
-                if sender_hostname != socket.gethostname():
-                    self._summary_table.increment_receive(sender_hostname)
+                self._summary_table.increment_receive(sender_hostname)
         except socket.timeout:
             pass

  • Adding service and action check: we need to check if there is service server and action server is online in the ROS 2 network 1st. and if there isn't, we can start the service and action server on that host, otherwise skip creating servers because they will conflict. it would be probably nice to run the MultiThreadedExecutor, so that it can process the requests concurrently.
Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ros2doctor/ros2doctor/verb/hello.py, especially HelloSubscriber and HelloMulticastUDPReceiver, to understand the existing connectivity summaries and multicast handling. Review the requested localhost inclusion, configurable multicast arguments, and service/action checks as separate scope items. Done requires an agreed implementation scope and corresponding checks in ros2 doctor hello.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.