ros2 / ros2/launch

LaunchDescriptionSource does not expand substitution

Open
#703 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Python
Stars
155
Forks
182
Avg merge
2d 14h
Merged PRs (30d)
6

Description

https://github.com/ros2/launch/blob/1c006346a91d0e1056c3226dc395a2cfe50dff8d/launch/launch/launch_description_source.py#L106

When using some code:

act = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(PathJoinSubstitution([FindPackageShare(package), "launch", launch_file]))

Trying to determine the file being included doesn't seem to work properly due to substitutions not being properly expanded:

test/launch_ext/test_include_package_launch_file.py:11: in test_include_package_launch_file
    assert act.launch_description_source.location == 'launch/launch_file.py'
E   AssertionError: assert '<launch.subs...7fe35e8126b0>' == 'launch/launch_file.py'
E     - launch/launch_file.py
E     + <launch.substitutions.path_join_substitution.PathJoinSubstitution object at 0x7fe35e8126b0>

Contributor guide

Open the contributing guide

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.

Research direction

Start at launch/launch/launch_description_source.py around line 106 and inspect how IncludeLaunchDescription handles the PathJoinSubstitution shown in the issue. Run test/launch_ext/test_include_package_launch_file.py, then verify that the launch description source location is the resolved path rather than the substitution object's representation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.