Location of included launch files cannot be determined
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Reproduce the example with IncludeLaunchDescription, PythonLaunchDescriptionSource, and PathJoinSubstitution, then inspect how the source location is stored and converted. The issue is done when an included launch file built from substitutions can expose its resolved path instead of a Python object representation, while preserving the reported launch-file context.
Written by the indexing model from the issue text.
Description
Bug report
- Operating System:
- Ubuntu 22.04
- Installation type:
binary - Version or commit hash:
humble, from distro - DDS implementation:
- Client library (if applicable):
Steps to reproduce issue
I'm trying to make a tool for examination of launch file structure and to visualize a tree of included launch files (python).
The following code, where ent is IncludeLaunchDescription object, should output a path to the included launch file, but instead it returns a string that refers to Python object pointer, e.g.<launch.substitutions.path_join_substitution.PathJoinSubstitution object at 0x74b241481780>
if isinstance(ent, IncludeLaunchDescription):
print(isinstance(ent.launch_description_source.location, str))
print(ent.launch_description_source.location)
ACTUAL output:
True
<launch.substitutions.path_join_substitution.PathJoinSubstitution object at 0x74b241481780>
EXPECTED output:
True
/home/user/ws/share/...
This should be fixed to enable error reporting for individual launch files included from other launch files. Now it is impossible to automatically determine which launch file has defined a problematic action.
I'm using PAL robotics scripts to build launch files. The function that includes a launch file is:
def include_launch_py_description(
pkg_name: SomeSubstitutionsType,
paths: List[SomeSubstitutionsType],
**kwargs) -> Action:
pkg_dir = FindPackageShare(pkg_name)
full_path = PathJoinSubstitution([pkg_dir] + paths)
return IncludeLaunchDescription(
PythonLaunchDescriptionSource(
full_path),
**kwargs)
Also, it looks like IncludeLaunchDescription convert Substitutions into a string <launch.substitutions.path_join_substitution.PathJoinSubstitution object at ...>:
def include_launch_py_description(
pkg_name: SomeSubstitutionsType,
paths: List[SomeSubstitutionsType],
**kwargs) -> Action:
pkg_dir = FindPackageShare(pkg_name)
full_path = PathJoinSubstitution([pkg_dir] + paths)
print(full_path)
for sub in full_path.substitutions:
print(sub.describe())
incl = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
full_path),
**kwargs)
print(isinstance(incl.launch_description_source.location, str))
print(incl.launch_description_source.location)
return incl
The output:
<launch.substitutions.path_join_substitution.PathJoinSubstitution object at 0x76505beb75e0>
FindPackageShare(pkg='tiago_description')
'launch'
'robot_state_publisher.launch.py'
True
<launch.substitutions.path_join_substitution.PathJoinSubstitution object at 0x76505beb75e0>
- Dominant language
- Python
- Stars
- 156
- Forks
- 200
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 11
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
-
Use a relative target for the `latest` log symlink so it survives different absolute mount paths (host/Docker)Possibly taken @Old-Ding claimed this 139 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ros2/launch#978 · 1 reaction ·
Maintainers usually reply within 1 day
-
Add OpaqueFunction to list at docs.ros.orgMay be free again A pull request for this issue was closed without being merged. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ros2/launch#826 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
[launch_testing] pytest>8.1 dropped the legacy "path" argument from its internal hooks on humblePossibly 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#979 · 6 comments ·
Maintainers usually reply within 1 day
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