ros2 / ros2/ros2cli

Suggestions for Improved Ergonomics on ros2 action send_goal.

Open
#696 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug report

Required Info:

  • Operating System:
    Ubuntu 20.04
  • Installation type:
    Binaries
  • Version or commit hash:
    Galactic
  • DDS implementation:
    All
    Client library (if applicable):
    CLI

Feature request

This is a general request to improve the action send_goal CLI ergonomics. I was trying to put together a TB4 tutorial and I spent a good hour wrestling with the CLI. In particular, I was trying to call an action with an empty message type for it's input. The short of it is that there is no way that a new user would be able to easily and correctly use the action send_goal command.

Feature description

ros2 action send_goal takes in three parameters: the action, the action type, and the goal value to send. The empty message case is both particularly common and confusing.

Implementation considerations

Here are my recommendations:

For the second parameter, the action type:

  • The action type should be implicit in the action name. For most cases, the CLI should look up the action type for the user. E.g. ros2 action send_goal /simple_thing '{x:1,y:2}' should just work.
  • When the user specifies a goal type the CLI should be forgiving. Things like leading slashes, .action at the end of the parameter, and other modifications should be ignored. Copying most path variants into send_goal should just work.
  • When the send_goal action fails, the CLI should output an example of what a correctly formed action type looks like from the action file. E.g. "my_ws/src/my_package/action/my_action.action => my_package/my_action"
  • The default case should be assumed to be an empty message. This would make it trivial to call simple action servers that require no input.

For the third parameter (the goal value):

  • If the user does not specify the third parameter the command should exit and output the goal type and an example of the goal message. E.g. '{foo:3,bar:1}'
  • If the action goal is of type Empty, the user should not have to specify it. Make the common case fast E.g. ros2 action send_goal /simple_thing
  • Bonus feature, allowing the goal to be input from a yaml file with a flag (e.g. ros2 action send_goal /simple_thing -f ./goal.yaml)

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 at the ros2 action send_goal CLI entry point and reproduce the documented empty-message and omitted-argument cases on Galactic. Review how action types and goal values are currently parsed. Done means the requested inference, forgiving type forms, helpful failure examples, empty-goal shortcut, and optional YAML input are defined and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.