Python equivalent of xml built-in substitutions for launch files

asked 2020-06-29 00:19:54 -0500

Rufus gravatar image

What is the python equivalent of xml built-in substitutions such as find-pkg-share when using a python launch file?

e.g. if I need to reference a certain file of a certain package in my python based launch file,

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([
        Node(
            package='my_package1',
            node_namespace='my_package1',
            node_executable='node',
            node_name='my_package1',
            parameters=[
                {"nav_graph_file", <find-pkg-share my_package2>/my_nav_file.yml}
            ]
        )
    ])
edit retag flag offensive close merge delete