ros2cli icon indicating copy to clipboard operation
ros2cli copied to clipboard

Suggestions for Improved Ergonomics on ros2 action send_goal.

Open kscottz opened this issue 3 years ago • 0 comments

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)

kscottz avatar Feb 25 '22 01:02 kscottz