Add --timeout alias to ros2 topic pub and ros2 param list

Open Beginner friendly
#1,305 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@1cbyc is already working on this.

Since Sep 24, 2026.

  • #1309 by @1cbyc — open
  • #1330 by @sujanchalla0510 — closed without merging
  • #1344 by @fazfa28 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
92/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Start by reading argument definitions in ros2topic/ros2topic/verb/pub.py and ros2param/ros2param/verb/list.py, then inspect the existing tests in ros2topic/test/ and ros2param/test/test_verb_list.py. Run the relevant verb tests and add coverage showing that --timeout sets the existing destination attributes. Done means both commands accept the alias while preserving their current option names and behavior.

Written by the indexing model from the issue text.

Description

good first issue

Most ros2cli commands use --timeout to specify a maximum wait time in seconds, but ros2 topic pub uses --max-wait-time-secs and ros2 param list only accepts --service-timeout.

Modify the following files to accept --timeout as an alias:

  • ros2topic/ros2topic/verb/pub.py
  • ros2param/ros2param/verb/list.py
Example: How to add the alias

Keep the existing option name first (so the args attribute name stays the same) and add '--timeout':

# Before (in ros2topic/ros2topic/verb/pub.py):
parser.add_argument(
    '--max-wait-time-secs',
    dest='max_wait_time_secs', type=positive_float, default=None,
    help=...)

# After:
parser.add_argument(
    '--max-wait-time-secs', '--timeout',
    dest='max_wait_time_secs', type=positive_float, default=None,
    help=...)
Example: How to add a test

Add a test in ros2topic/test/ (and ros2param/test/test_verb_list.py) to check that --timeout sets the expected attribute:

import argparse
from ros2topic.verb.pub import PubVerb


def test_pub_timeout_alias():
    parser = argparse.ArgumentParser()
    verb = PubVerb()
    verb.add_arguments(parser, 'ros2 topic pub')
    args = parser.parse_args(['/chatter', 'std_msgs/msg/String', '--timeout', '2.5'])
    assert args.max_wait_time_secs == 2.5
Dominant language
Python
Stars
274
Forks
246
Avg merge
1d 14h
Merged PRs (30d)
12

Getting set up

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.

More from ros2/ros2cli

All issues in ros2/ros2cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.