IncludeLaunchDescription method allows to include one launch description (essentially a sub-launch file) inside another, enabling better organization and scalability of complex robot systems. This is particularly useful when you want to break down a large system into smaller, reusable components.
Demo: Very simple
Parent launch file include_demo.launch.py include the args_log_demo.launch.py as sub launch
fromlaunchimportLaunchDescriptionfromlaunch.actionsimportIncludeLaunchDescriptionfromlaunch.launch_description_sourcesimportPythonLaunchDescriptionSourcefromament_index_python.packagesimportget_package_share_directoryimportosdefgenerate_launch_description():ld=LaunchDescription()my_robot_pkg=get_package_share_directory('launch_tutorial')robot_launch=IncludeLaunchDescription(PythonLaunchDescriptionSource(os.path.join(my_robot_pkg,'launch','args_log_demo.launch.py')),launch_arguments={'arg1':'call from parent',}.items())ld.add_action(robot_launch)returnld