Tab completion for launch file arguments
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by reading the ros2 launch command and its argument completion setup, then trace how launch files expose argument defaults and choices. The issue asks for completion of argument names and allowed choice values for both package launch files and file paths, across relevant shells. Done means both examples complete as requested; the issue does not name files or tests, so locate the existing completion tests before estimating coverage.
Written by the indexing model from the issue text.
Description
Description
I would like to be able to tab-complete for launch file arguments. For example
<launch>
<arg name="mode" default="fast" description="Operating mode">
<choice value="slow"/>
<choice value="medium"/>
<choice value="fast"/>
</arg>
<arg name="namespace" default="demo"
description="Namespace for the talker node"/>
<arg name="use_sim_time" default="false" description="Use simulation time">
<choice value="true"/>
<choice value="false"/>
</arg>
<node pkg="demo_nodes_cpp" exec="talker" namespace="$(var namespace)">
<param name="use_sim_time" value="$(var use_sim_time)"/>
</node>
</launch>
I would like that
ros2 launch example.launch.xml <TAB>
prints
use_sim_time:= namespace:= mode:=
and
ros2 launch example.launch.xml mode:=<TAB>
prints
mode:=medium mode:=fast mode:=slow
Note: I'm on ZSH, so on bash things might be different, such as <TAB><TAB> and all args in a row and such.
Motivation
Often, I use launch files with arguments that I know, but I don't know exactly how they were written. Tab completion would help there tremendously, where the alternative approach would be cancelling the current launch, call it with --show-args, scroll through a potentially long list of arguments and then continue.
It would be especially useful if launch files use choice statements, e.g. if a robot startup file can be used for multiple models.
Design / Implementation Considerations
Obviously, things should work for all relevant shells (which will be probably easy to achieve since it's using python's argcomplete) and it should work for both ros2 launch <package> <launch_file_in_package> and ros2 launch <launch_file_path>.
I do have a working prototype running locally and I would be happy to work on this. I just wanted to straighten out the requirements first, before blindly opening a PR.
A screencast of my PoC:
https://github.com/user-attachments/assets/3240318a-942a-4dd3-bac8-a288fbbbe6a2
Additional Information
No response
- Dominant language
- Python
- Stars
- 84
- Forks
- 115
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros2/launch_ros
-
yaml.add_representer in Node._create_params_file_from_dict mutates global yaml.Dumper, corrupting unrelated yaml.dump() calls in the same processPossibly taken @dlanov claimed this 73 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ros2/launch_ros#571 · 1 comment ·
-
Unable to specifiy type of parameter when using `set_parameter`Possibly taken @SuperJappie08 claimed this 7 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
ros2/launch_ros#593 · 1 comment · 1 assignee ·
-
WaitForTopics blocks interpreter exit if shutdown() is never calledPossibly taken @aadilkhan085529 claimed this 15 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 53/100
ros2/launch_ros#592 · 1 comment ·
-
0.29.9 introduces a regression on lyricalPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
ros2/launch_ros#550 ·
-
Feature request: ros2 launch --dump-params to statically export resolved node parametersPossibly taken @IdiotCoffee claimed this 55 days ago. Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
ros2/launch_ros#549 · 3 comments · 1 reaction ·
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
hive size:simple
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
backend enhancement priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
geolens-io/geolens#4161 ·
Maintainers usually reply within 1 day