XML launch `<include>` can pass implicit arguments
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 ROS2 launch 的 XML 文档开始,使用 ros2 launch 复现所提供的 parent.launch.xml 和 child.launch.xml 示例。跟踪 include 和 arg 元素如何处理未声明的子参数,然后确定这种行为是否是有意设计的,并记录或修正它,使预期结果明确。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Python
- 星标
- 156
- 派生
- 200
- 平均合并
- 2 天 11 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ros2/launch 的其他 Issue
-
Use a relative target for the `latest` log symlink so it survives different absolute mount paths (host/Docker)可能已有人在做 @Old-Ding 于 139 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
ros2/launch#978 · 1 个 reaction ·
维护者通常 1 天内回复
-
Add OpaqueFunction to list at docs.ros.org可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug help wanted
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
[launch_testing] pytest>8.1 dropped the legacy "path" argument from its internal hooks on humble可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
gke-labs/kube-agents#7441 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 76/100
open-webui/open-webui#35142 · 1 条评论 ·
维护者通常 1 天内回复