Skip to content

Commit 9da7340

Browse files
committed
Update xacro and use upstream xacro Bazel rule
1 parent 734502e commit 9da7340

File tree

13 files changed

+33
-123
lines changed

13 files changed

+33
-123
lines changed

MODULE.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ bazel_dep(name = "sqlite3", version = "3.42.0.bcr.1")
2323
bazel_dep(name = "tinyxml", version = "2.6.2")
2424
bazel_dep(name = "tinyxml2", version = "10.0.0")
2525
bazel_dep(name = "websocketpp", version = "0.8.2.bcr.3")
26+
bazel_dep(name = "xacro", version = "2.0.12", repo_name = "ros2_xacro")
27+
#local_path_override(
28+
# module_name = "xacro",
29+
# path = "../xacro",
30+
#)
2631
bazel_dep(name = "yaml-cpp", version = "0.8.0")
2732
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
2833
bazel_dep(name = "zstd", version = "1.5.6")
@@ -170,7 +175,6 @@ use_repo(
170175
"ros2_unique_identifier_msgs",
171176
"ros2_urdfdom",
172177
"ros2_urdfdom_headers",
173-
"ros2_xacro",
174178
"ros2cli",
175179
"rules_ros2_config_clang",
176180
)

examples/foxglove_bridge/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@com_github_mvukov_rules_ros2//ros2:cc_defs.bzl", "ros2_cpp_binary")
22
load("@com_github_mvukov_rules_ros2//ros2:launch.bzl", "ros2_launch")
3-
load("@com_github_mvukov_rules_ros2//ros2:xacro.bzl", "xacro")
3+
load("@ros2_xacro//bazel:defs.bzl", "xacro_file")
44
load(
55
"@com_github_mvukov_rules_ros2//third_party:expand_template.bzl",
66
"expand_template",
@@ -17,9 +17,9 @@ ros2_cpp_binary(
1717
)
1818

1919
# Creates a URDF representation from the given xacro file.
20-
xacro(
20+
xacro_file(
2121
name = "sam_bot",
22-
srcs = ["sam_bot.xacro"],
22+
src = "sam_bot.urdf.xacro",
2323
)
2424

2525
expand_template(

repositories/repositories.bzl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ def ros2_workspace_repositories():
234234
],
235235
)
236236

237+
maybe(
238+
http_archive,
239+
name = "ros2_xacro",
240+
sha256 = "6df0d44af8a6bf9f23f0536ce167a0cd7b4c01281100dfea7e17d504363b424d",
241+
strip_prefix = "xacro-2.0.13",
242+
urls = ["https://github.com/ros/xacro/archive/refs/tags/2.0.13.tar.gz"],
243+
)
244+
237245
def ros2_repositories():
238246
"""Import ROS 2 repositories."""
239247

@@ -267,15 +275,6 @@ def ros2_repositories():
267275
urls = ["https://github.com/foxglove/ros-foxglove-bridge/archive/refs/tags/0.7.9.tar.gz"],
268276
)
269277

270-
maybe(
271-
http_archive,
272-
name = "ros2_xacro",
273-
build_file = "@com_github_mvukov_rules_ros2//repositories:xacro.BUILD.bazel",
274-
sha256 = "a8802a5b48f7479bae1238e822ac4ebb47660221eb9bc40a608e899d60f3f7e4",
275-
strip_prefix = "xacro-2.0.9",
276-
urls = ["https://github.com/ros/xacro/archive/refs/tags/2.0.9.tar.gz"],
277-
)
278-
279278
# Version copied from https://github.com/ros2/orocos_kdl_vendor/blob/0.2.5/orocos_kdl_vendor/CMakeLists.txt#L58.
280279
maybe(
281280
http_archive,

repositories/xacro.BUILD.bazel

Lines changed: 0 additions & 45 deletions
This file was deleted.

ros2/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ exports_files([
2828
"test.bzl",
2929
"test.py.tpl",
3030
"topic.bzl",
31-
"xacro.bzl",
3231
])
3332

3433
string_flag(

ros2/test/xacro/BUILD.bazel

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
load("@rules_python//python:defs.bzl", "py_test")
2-
load("//ros2:xacro.bzl", "xacro")
2+
load("@ros2_xacro//bazel:defs.bzl", "xacro_file")
33

4-
xacro(
4+
xacro_file(
55
name = "test_urdf",
6-
srcs = ["test.xacro"],
6+
src = "test.urdf.xacro",
77
)
88

9-
xacro(
9+
xacro_file(
10+
name = "sample1",
11+
src = "sample1.urdf.xacro",
12+
)
13+
14+
xacro_file(
1015
name = "test_include",
11-
srcs = [
12-
"sample1.xacro",
13-
],
14-
main = "sample2.xacro",
16+
src = "sample2.urdf.xacro",
17+
deps = ["sample1"],
1518
)
1619

17-
xacro(
20+
xacro_file(
1821
name = "test_with_params",
19-
srcs = [
22+
data = [
2023
"params.yaml",
2124
],
22-
main = "test_with_params.xacro",
25+
src = "test_with_params.urdf.xacro",
2326
)
2427

2528
py_test(
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)