Add xacro support to bazel_ros2_rules - #422
Merged
frneer merged 3 commits intoApr 22, 2026
Merged
Conversation
Closed
julianadrianheine
force-pushed
the
julianadrianheine/add_xacro_support
branch
2 times, most recently
from
April 17, 2026 20:28
0041bf0 to
ca521a8
Compare
julianadrianheine
marked this pull request as ready for review
April 20, 2026 12:03
julianadrianheine
force-pushed
the
julianadrianheine/add_xacro_support
branch
4 times, most recently
from
April 20, 2026 13:04
43610a9 to
9b927d9
Compare
Closed
frneer
force-pushed
the
julianadrianheine/add_xacro_support
branch
from
April 21, 2026 18:49
9b927d9 to
f092114
Compare
frneer
reviewed
Apr 22, 2026
frneer
left a comment
Collaborator
There was a problem hiding this comment.
+a:@frneer
@frneer partially reviewed 9 files and made 1 comment.
Reviewable status: 8 of 12 files reviewed, all discussions resolved.
frneer
approved these changes
Apr 22, 2026
frneer
left a comment
Collaborator
There was a problem hiding this comment.
@frneer made 1 comment.
Reviewable status: 8 of 12 files reviewed, all discussions resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 macro
ros_xacrothat allows generating URDF/SDF artifacts. The implementation was based on #420Summary
bazel_ros2_rules/lib/private/xacro.bzlwith aros_xacromacro that transforms a.urdf.xacrosource file into a.urdfoutput file at build timexacro.bzlinCOMMON_FILES_MANIFESTso it is distributed as@ros2//:xacro.bzlros2_example_xacroas a worked example and test for the new ruleImplementation notes
ros_xacrofollows the same pattern asros_launch: it wraps a generated runner script inros_py_binary, whose dload shim sets upAMENT_PREFIX_PATH(including prefixes for any user-defined packages) before executing the system@ros2//:xacrobinary. Resolved runfiles paths are always absolute, which is required because xacro's$(find <pkg>)expansion joins non-absolute paths with the parent file's directory.Local packages are declared inline via the
ros_packagesdict, mapping a ROS package name to its source files. The macro creates anament_index_share_filestarget for each entry internally, derivingstrip_prefixautomatically fromnative.package_name()so the user never has to compute it.The BUILD file usage is minimal:
This change is