[Launch] Allow ros launch targets to include each other idiomatically #53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a custom Bazel rule (ros_launch_rule) and macro (ros_launch_macro) that automate the process of generating and executing ROS launch scripts, while handling the necessary runtime dependencies for ROS nodes, launch files, and parameter files.
Key Changes
Custom Provider
A custom provider used to propagate information about ROS nodes, launch files, and parameter files through the build graph.
Custom
ros_launch_rule
RuleGenerates a Python launch script by expanding a template.
1, Collects transitive dependencies such as node binaries, launch files, and parameter files from the current target and its dependencies.
2. Exposes these resources via the RosLaunchInfo provider, enabling downstream rules to access them.
3. Uses Bazel’s runfiles mechanism to ensure that the generated script and all required files are available at runtime.
RosLaunchInfo Provider:
Modified
ros_launch
MacroPotential Points of Contention
One potential point of contention I can already see is that the actual
py_binary
target is now named<target_name>_launch
- happy to swap the name of the rule and py_binary if that makes for a cleaner PR (no interface breakage)How was this Tested
Everything builds and ran examples