ros2 / ros2/ros2cli

Incorrect service autocompletion

Open
#682 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

It seems that the service autocomplete is not behaving entirely correctly. I have moved this issue from https://github.com/ros/ros_tutorials/issues/136#issue-1040427338, opened by @kurshakuz.

Typing following command and trying autocompletion (tab) produces following output:

ros2 service call /spawn turtlesim/srv/Spawn 
-r
--rate
x:\ 0.0\^Jy:\ 0.0\^Jtheta:\ 0.0\^Jname:\ \'\'\

However, adding an x after above statement, produces different output:

ros2 service call /spawn turtlesim/srv/Spawn x
ros2 service call /spawn turtlesim/srv/Spawn x:\ 0.0\
y:\ 0.0\
theta:\ 0.0\
name:\ \'\'\ 

Executing any of them produces errors:

yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 1, column 8:
    x: 0.0y: 0.0theta: 0.0name: '' 
           ^

The expected and working example should look like the one below.

ros2 service call /spawn turtlesim/srv/Spawn "{x: 0.0, y: 0.0, theta: 0.0, name: ''}"

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 service call autocompletion path described in the issue and reproduce the tab-completion commands using turtlesim/srv/Spawn. Compare the generated multiline output with the expected quoted mapping, and verify that the corrected command executes without the reported YAML scanner error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.