-
Notifications
You must be signed in to change notification settings - Fork 23
/
BUILD.bazel
85 lines (80 loc) · 2.56 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# SPDX-License-Identifier: BSD-3-Clause
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load(":defs.bzl", "xacro_file")
_XACROS = {
"realsense2_description/urdf/d415.urdf": {
"src": "realsense2_description/urdf/customized/test_d415_camera.urdf.xacro",
"data": [
"realsense2_description/urdf/customized/_d415.urdf.xacro",
"realsense2_description/urdf/customized/_materials.urdf.xacro",
"realsense2_description/urdf/customized/_usb_plug.urdf.xacro",
],
},
"tri_homecart/homecart_bimanual.urdf": {
"src": "tri_homecart/homecart_bimanual.urdf.xacro",
"data": [],
},
"tri_homecart/homecart_cutting_board.sdf": {
"src": "tri_homecart/homecart_cutting_board.sdf.xacro",
"data": [],
},
"ur_description/urdf/ur3e_cylinders_collision.urdf": {
"src": "ur_description/urdf/ur3e_cylinders_collision.urdf.xacro",
"data": [
"ur_description/urdf/ur.transmission.xacro",
"ur_description/urdf/ur3e.urdf.xacro",
],
},
"ur_description/urdf/ur3e_spheres_collision.urdf": {
"src": "ur_description/urdf/ur3e_spheres_collision.urdf.xacro",
"data": [
"ur_description/urdf/ur.transmission.xacro",
"ur_description/urdf/ur3e.urdf.xacro",
],
},
}
# Generate the xacro output into a temp dir.
[
xacro_file(
name = "gen/" + name,
src = attrs["src"],
data = attrs["data"],
)
for name, attrs in _XACROS.items()
]
# Cross-check that the committed files are up to date.
[
diff_test(
name = name + ".diff_test",
failure_message = "To fix, run this command:\n cp {} {}".format(
".bazel/bin/gen/" + name,
name,
),
file1 = ":gen/" + name,
file2 = name,
)
for name in _XACROS
]
# Patch the realsense files to suit this repository.
[
genrule(
name = "_gen_{}".format(filename),
srcs = [
"realsense2_description/urdf/customize.sed",
"realsense2_description/urdf/{}".format(filename),
],
outs = [
"realsense2_description/urdf/customized/{}".format(filename),
],
cmd = "sed --file={} {} > $@".format(
"$(execpath realsense2_description/urdf/customize.sed)",
"$(execpath realsense2_description/urdf/{})".format(filename),
),
)
for filename in [
"test_d415_camera.urdf.xacro",
"_d415.urdf.xacro",
"_materials.urdf.xacro",
"_usb_plug.urdf.xacro",
]
]