feat(include_launch_description): only check required arguments in the local launch file
Description
In a feature request issue on https://github.com/ros2/launch/issues/745. It suggests that the argument checking mechanism in include_launch_description.py introduces unnecessary overhead for launching large systems.
In this PR, a mechanism is implemented so that the best-effort argument checking is only performed inside the local launch file instance and checks on each included sub-launch file are only performed once.
Methods
Add an argument to the get_launch_arguments_with_include_launch_description_actions function.
Testing
Tested with autoware. If the launch file is OK, we could now launch significantly faster. If the launch file has un-declared arguments even if it is hidden in the sub-sub included files, the launch system can identify the problem and stop the launch operation cleanly (it also keeps up with the cases in CI).
Feedback is welcome.
@Owen-Liuyuxuan Could you check the failing CI? https://build.ros2.org/job/Rpr__launch__ubuntu_jammy_amd64/311/testReport/launch.test.launch.actions/test_include_launch_description/test_include_launch_description_launch_arguments/
@Owen-Liuyuxuan Could you check the failing CI? https://build.ros2.org/job/Rpr__launch__ubuntu_jammy_amd64/311/testReport/launch.test.launch.actions/test_include_launch_description/test_include_launch_description_launch_arguments/
Working on methods to pass this case while keeping the complexity manageable.
For more context, how significant of a speedup are you seeing by only checking the required args?
For more context, how significant of a speedup are you seeing by only checking the required args?
This image showcases how it accelerates the logging simulation of the OSC [autoware] (https://github.com/autowarefoundation/autoware). Numbers are time spent in the execute function of include_launch_description.py in seconds.
To reproduce:
- Build Autoware.
- Manually update the launch file and log the time info.
- Analyse the launch.log and find the most time-consuming parts.
Intuition: Autoware has become a rather huge system with many optional launchable sub-systems. The original code will unfold more than 100k parameters at checking the first launch script (and these parameters will be checked recursively many times by tons of subfiles/sub-subfiles). This update can significantly improve launch speed for huge launch system.
Any updates on the review process? Thanks a lot for the maintenance of the code.
The new commits from main for new the ROS version breaks the CI again. Need to figure out what is new.
Merge commit does not produce any new reports and the CI fails. I will have to push some dummy commit here.
by April 2. The CI errors does not look like to be related to the PR. Waiting for updates.
Would love to hear more information about the CI here, it does not look like related to the PR .
Sorry for the mention @mjcarroll @clalancette .
Added a branch on my personal repo https://github.com/Owen-Liuyuxuan/launch/tree/feat/augment_check_skipping_install for temporary installation.
git clone https://github.com/Owen-Liuyuxuan/launch.git
git checkout feat/augment_check_skipping_install
./install2ros.sh