ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
124 stars 139 forks source link

LaunchDescriptionSource does not expand substitution #703

Open russkel opened 1 year ago

russkel commented 1 year ago

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>