Add multicast options to ros2 doctor hello - #1267
Open
Miko997 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Miko Parkkinen <141511110+Miko997@users.noreply.github.com>
|
Tick the box to add this pull request to the merge queue (same as
|
fujitatomoya
requested changes
Aug 15, 2026
Comment on lines
+73
to
+78
| parser.add_argument( | ||
| '--group', type=str, default=DEFAULT_GROUP, | ||
| help=f'Multicast group address (default: {DEFAULT_GROUP})') | ||
| parser.add_argument( | ||
| '--port', type=positive_int, default=DEFAULT_PORT, | ||
| help=f'Multicast port (default: {DEFAULT_PORT})') |
Collaborator
There was a problem hiding this comment.
i think we can add some address validation here.
passing a unicast or garbage address will surface as an opaque socket error deep in the sender/receiver.
a small validator (parse with ipaddress and check .is_multicast) would give a proper argparse error instead.
|
|
||
| class TestROS2DoctorCLI(unittest.TestCase): | ||
|
|
||
| def test_hello_single_host(self): |
Collaborator
There was a problem hiding this comment.
why do we have to remove this test? i think we can just add the test for group and port argument?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add optional
--groupand--portarguments toros2 doctor hello. The selected values are used by the multicast sender and receiver and shown in the summary. Existing defaults remain unchanged.This implements the multicast configuration part of #1077. The other enhancements in that issue are outside this PR.
Is this user-facing behavior change?
Yes. Users can select the multicast group and port used by
ros2 doctor hello.Additional Information
Validated in the official
ros:rolling-ros-basecontainer:colcon build --packages-select ros2doctorcolcon test --packages-select ros2doctorcolcon test-result --verbose: 9 tests, 0 errors, 0 failures, 0 skippedros2 doctor hello --help: custom options present with existing defaults