XML launch `<include>` can pass implicit arguments
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia con la documentazione di ROS2 launch XML e riproduci gli esempi forniti parent.launch.xml e child.launch.xml usando ros2 launch. Traccia il modo in cui gli elementi include e arg gestiscono un argomento child non dichiarato, quindi determina se il comportamento è intenzionale e documentalo o correggilo in modo che il risultato previsto sia esplicito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The ROS2 launch XML format documentation (http://design.ros2.org/articles/roslaunch_xml.html) states that:
<arg>Tag
The tag allows for launch file configuration via the command-line or when including it via an tag. Arguments are launch configuration variables just like the ones defined by tags. Arguments are limited to the scope of their definition and thus have to be explictly passed to included files if any.
If I understand the documentation correctly, if a launch file includes another with the <include> tag, the <arg> parameters are not passed to the other launch file implicitly.
So for example, with these 2 files:
<!-- parent.launch.xml -->
<launch>
<arg name="foo" default="there!"/>
<include file="child.launch.xml"/>
</launch>
<!-- child.launch.xml -->
<launch>
<arg name="foo"/>
<executable cmd="echo Hello $(var foo)" output="screen" shell="true" />
</launch>
We get an error if we try to launch the parent.launch.xml, because foo is not set for the included file:
$ ros2 launch parent.launch.xml
[INFO] [launch]: All log files can be found below /home/sig/.ros/log/2023-01-20-01-08-28-929056-vr-desktop-1016
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Included launch description missing required argument 'foo' (description: 'no description given'), given: []
So far so good.
However, if we change the child launch file to:
<!-- child.launch.xml -->
<launch>
<!-- <arg name="foo"/> -->
<executable cmd="echo Hello $(var foo)" output="screen" shell="true" />
</launch>
Then, not only no error occurs, but the argument is passed to the child launch file:
$ ros2 launch parent.launch.xml
[INFO] [launch]: All log files can be found below /home/sig/.ros/log/2023-01-20-01-08-16-842624-vr-desktop-961
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [echo-1]: process started with pid [972]
[INFO] [echo-1]: process has finished cleanly [pid 972]
[echo-1] Hello there!
Is it a bug? an undocumented feature?
Bug report
Required Info:
- Operating System:
- Ubuntu 20.04 (galactic) and 22.04 (humble)
- Installation type:
- binary
- Version or commit hash:
- N/A
- DDS implementation:
- N/A?
- Client library (if applicable):
- N/A
Steps to reproduce issue
Run ros2 launch parent.launch.xml with:
<!-- parent.launch.xml -->
<launch>
<arg name="foo" default="there!"/>
<include file="child.launch.xml"/>
</launch>
<!-- child.launch.xml -->
<launch>
<!-- <arg name="foo"/> -->
<executable cmd="echo Hello $(var foo)" output="screen" shell="true" />
</launch>
Expected behavior
Error because foo is undefined?
Actual behavior
The command outputs [echo-1] Hello there!, so not only foo is defined, but it is also passed implicitely from the parent file.
Additional information
- Lingua principale
- Python
- Stelle
- 156
- Fork
- 200
- Merge medio
- 2g 11h
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ros2/launch
-
Use a relative target for the `latest` log symlink so it survives different absolute mount paths (host/Docker)Forse già presa @Old-Ding l’ha presa 139 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ros2/launch#978 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Add OpaqueFunction to list at docs.ros.orgForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ros2/launch#826 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
[launch_testing] pytest>8.1 dropped the legacy "path" argument from its internal hooks on humbleForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
ros2/launch#979 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
hive size:simple
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
backend enhancement priority:P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
geolens-io/geolens#4161 ·
I maintainer di solito rispondono entro 1 giorno