我有一个主bringup.launch.py
启动文件,其中启动描述符包含child.launch.py
作为子启动文件,如下所示:
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
def generate_launch_description():
package_prefix = get_package_share_directory('child_package')
argument_for_child = "lala"
return LaunchDescription([
# include the child launch file
IncludeLaunchDescription(
PythonLaunchDescriptionSource([package_prefix, '/launch/child.launch.py'])
),
])
如何从bringup.launch.py
to传递参数child.launch.py
?