Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ bazel_dep(name = "sqlite3", version = "3.42.0.bcr.1")
bazel_dep(name = "tinyxml", version = "2.6.2")
bazel_dep(name = "tinyxml2", version = "10.0.0")
bazel_dep(name = "websocketpp", version = "0.8.2.bcr.3")
bazel_dep(name = "xacro", version = "2.0.12", repo_name = "ros2_xacro")
#local_path_override(
# module_name = "xacro",
# path = "../xacro",
#)
bazel_dep(name = "yaml-cpp", version = "0.8.0")
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
bazel_dep(name = "zstd", version = "1.5.6")
Expand Down Expand Up @@ -170,7 +175,6 @@ use_repo(
"ros2_unique_identifier_msgs",
"ros2_urdfdom",
"ros2_urdfdom_headers",
"ros2_xacro",
"ros2cli",
"rules_ros2_config_clang",
)
6 changes: 3 additions & 3 deletions examples/foxglove_bridge/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@com_github_mvukov_rules_ros2//ros2:cc_defs.bzl", "ros2_cpp_binary")
load("@com_github_mvukov_rules_ros2//ros2:launch.bzl", "ros2_launch")
load("@com_github_mvukov_rules_ros2//ros2:xacro.bzl", "xacro")
load("@ros2_xacro//bazel:defs.bzl", "xacro_file")
load(
"@com_github_mvukov_rules_ros2//third_party:expand_template.bzl",
"expand_template",
Expand All @@ -17,9 +17,9 @@ ros2_cpp_binary(
)

# Creates a URDF representation from the given xacro file.
xacro(
xacro_file(
name = "sam_bot",
srcs = ["sam_bot.xacro"],
src = "sam_bot.urdf.xacro",
)

expand_template(
Expand Down
17 changes: 8 additions & 9 deletions repositories/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ def ros2_workspace_repositories():
],
)

maybe(
http_archive,
name = "ros2_xacro",
sha256 = "6df0d44af8a6bf9f23f0536ce167a0cd7b4c01281100dfea7e17d504363b424d",
strip_prefix = "xacro-2.0.13",
urls = ["https://github.com/ros/xacro/archive/refs/tags/2.0.13.tar.gz"],
)

def ros2_repositories():
"""Import ROS 2 repositories."""

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

maybe(
http_archive,
name = "ros2_xacro",
build_file = "@com_github_mvukov_rules_ros2//repositories:xacro.BUILD.bazel",
sha256 = "a8802a5b48f7479bae1238e822ac4ebb47660221eb9bc40a608e899d60f3f7e4",
strip_prefix = "xacro-2.0.9",
urls = ["https://github.com/ros/xacro/archive/refs/tags/2.0.9.tar.gz"],
)

# Version copied from https://github.com/ros2/orocos_kdl_vendor/blob/0.2.5/orocos_kdl_vendor/CMakeLists.txt#L58.
maybe(
http_archive,
Expand Down
45 changes: 0 additions & 45 deletions repositories/xacro.BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion ros2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ exports_files([
"test.bzl",
"test.py.tpl",
"topic.bzl",
"xacro.bzl",
])

string_flag(
Expand Down
25 changes: 14 additions & 11 deletions ros2/test/xacro/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
load("@rules_python//python:defs.bzl", "py_test")
load("//ros2:xacro.bzl", "xacro")
load("@ros2_xacro//bazel:defs.bzl", "xacro_file")

xacro(
xacro_file(
name = "test_urdf",
srcs = ["test.xacro"],
src = "test.urdf.xacro",
)

xacro(
xacro_file(
name = "sample1",
src = "sample1.urdf.xacro",
)

xacro_file(
name = "test_include",
srcs = [
"sample1.xacro",
],
main = "sample2.xacro",
src = "sample2.urdf.xacro",
deps = ["sample1"],
)

xacro(
xacro_file(
name = "test_with_params",
srcs = [
data = [
"params.yaml",
],
main = "test_with_params.xacro",
src = "test_with_params.urdf.xacro",
)

py_test(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions ros2/test/xacro/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ def test_urdf(self):
<b bar="2 2.0"/>
</xml>
"""
self._check('ros2/test/xacro/test_urdf/model.urdf', expected_xml)
self._check('ros2/test/xacro/test_urdf.urdf', expected_xml)

def test_include(self):
expected_xml = """
<xml>
<a foo="1 1.0"/>
</xml>
"""
self._check('ros2/test/xacro/test_include/model.urdf', expected_xml)
self._check('ros2/test/xacro/test_include.urdf', expected_xml)

def test_with_params(self):
expected_xml = """
<xml>
<a foo="bar"/>
</xml>
"""
self._check('ros2/test/xacro/test_with_params/model.urdf', expected_xml)
self._check('ros2/test/xacro/test_with_params.urdf', expected_xml)


if __name__ == '__main__':
Expand Down
50 changes: 0 additions & 50 deletions ros2/xacro.bzl

This file was deleted.

Loading