ros2 / ros2/ros2cli

[ros2lifecycle] set verb help message doesnt give enough information

Open
#122 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

$ ros2 lifecycle set -h
usage: ros2 lifecycle set [-h] [--spin-time SPIN_TIME]
                          [--include-hidden-nodes]
                          node_name transition

Trigger lifecycle state transition

positional arguments:
  node_name             Name of the ROS node
  transition            The lifecycle transition

Users don't know is a transition / acceptable transition.
You need to call and fail to get more information:

$ ros2 lifecycle set lc_talker garbage
Unknown transition requested, available ones are:
- configure [1]
- configure_success [10]
- configure_failure [11]
- configure_error [22]
- cleanup [2]
- cleanup_success [20]
- cleanup_failure [21]
- cleanup_error [22]
- activate [3]
- activate_success [30]
- activate_failure [31]
- activate_error [32]
- deactivate [4]
- deactivate_success [40]
- deactivate_failure [41]
- deactivate_error [42]
- unconfigured_shutdown [50]
- inactive_shutdown [51]
- active_shutdown [52]
- shutdown_success [53]
- shutdown_failure [54]
- shutdown_error [55]
- errorprocessing_success [60]
- errorprocessing_failure [61]
- errorprocessing_error [62]

And that list gives all transitions, not only the ones that are available from the current state.

Suggestions to improve user experience:

  • Provide the list of all transition in the helps message
    • If we want an up to date list it;s tricky as we need to create a lifecycle node and get the list of all transitions
    • Static hard-coded list for the help message as we don't expect the list to change
  • Provide a way to get the list of only available transitions from the current state:
    • Expose get_available_transitions through ros2 lifecycle (as a new verb?) and update the set help message to advise users to call that to know the possible transitions.

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 with the ros2 lifecycle set verb's help output and the lifecycle transition handling described in the issue. Compare the options of listing all transitions in help and exposing available transitions from the current state; done criteria should include clearer guidance and a way to identify valid transitions without intentionally triggering a failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.