Incorrect service autocompletion

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

Description

bug help wanted

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: ''}"
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.