Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tease apart models_filegroup vs install_data #18923

Merged
Merged
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
3 changes: 0 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ filegroup(
"//bindings/pydrake/multibody:models",
"//examples/acrobot:models",
"//examples/atlas:models",
"//examples/compass_gait:models",
"//examples/hardware_sim:demo_data",
"//examples/hydroelastic/ball_plate:floor_files",
"//examples/hydroelastic/ball_plate:plate_files",
Expand All @@ -58,10 +57,8 @@ filegroup(
"//examples/planar_gripper:models",
"//examples/pr2:models",
"//examples/quadrotor:models",
"//examples/rimless_wheel:models",
"//examples/scene_graph:models",
"//examples/simple_gripper:simple_gripper_models",
"//examples/zmp:models",
"//manipulation/models/allegro_hand_description:models",
"//manipulation/models/franka_description:models",
"//manipulation/models/iiwa_description:models",
Expand Down
9 changes: 3 additions & 6 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ drake_cc_binary(
],
)

# The :prod_models in these packages are installed as part of the Drake release
# The :models in these packages are installed as part of the Drake release
# process, and loaded into drake_visualizer's model database by default.
INSTALLED_MODEL_PACKAGES = [
"//examples/acrobot",
"//examples/atlas",
"//examples/compass_gait",
"//examples/hydroelastic/spatula_slip_control",
"//examples/kuka_iiwa_arm/models",
"//examples/manipulation_station",
Expand All @@ -48,13 +47,11 @@ INSTALLED_MODEL_PACKAGES = [
"//examples/planar_gripper",
"//examples/pr2",
"//examples/quadrotor",
"//examples/rimless_wheel",
"//examples/zmp",
]

filegroup(
name = "prod_models",
data = [package + ":prod_models" for package in INSTALLED_MODEL_PACKAGES],
name = "models",
data = [package + ":models" for package in INSTALLED_MODEL_PACKAGES],
visibility = ["//visibility:public"],
)

Expand Down
14 changes: 12 additions & 2 deletions examples/acrobot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ load(
"drake_py_test",
"drake_py_unittest",
)
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load(
"@drake//tools/vector_gen:vector_gen.bzl",
Expand All @@ -22,6 +23,17 @@ load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:private"])

models_filegroup(
name = "models",
visibility = ["//visibility:public"],
)

install_data(
name = "install_data",
data = [":models"],
visibility = ["//visibility:public"],
)

drake_cc_vector_gen_library(
name = "acrobot_input",
srcs = ["acrobot_input_named_vector.yaml"],
Expand Down Expand Up @@ -424,6 +436,4 @@ drake_py_test(
],
)

install_data()

add_lint_tests()
12 changes: 10 additions & 2 deletions examples/atlas/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ load(
"drake_cc_binary",
)
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")

package(default_visibility = ["//visibility:public"])

models_filegroup(
name = "models",
)

install_data(
name = "install_data",
data = [":models"],
)

drake_cc_binary(
name = "atlas_run_dynamics",
srcs = [
Expand All @@ -33,6 +43,4 @@ drake_cc_binary(
],
)

install_data()

add_lint_tests()
3 changes: 0 additions & 3 deletions examples/compass_gait/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ load(
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
load(
"@drake//tools/vector_gen:vector_gen.bzl",
Expand Down Expand Up @@ -87,6 +86,4 @@ drake_cc_googletest(
],
)

install_data()

add_lint_tests()
8 changes: 4 additions & 4 deletions examples/hardware_sim/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ filegroup(
srcs = [
":example_iiwa_wsg.dmd.yaml",
":example_scenarios.yaml",
"//examples/manipulation_station:prod_models",
"//examples/pendulum:prod_models",
"//manipulation/models/iiwa_description:prod_models",
"//manipulation/models/wsg_50_description:prod_models",
"//examples/manipulation_station:models",
"//examples/pendulum:models",
"//manipulation/models/iiwa_description:models",
"//manipulation/models/wsg_50_description:models",
],
visibility = ["//:__pkg__"],
)
Expand Down
1 change: 0 additions & 1 deletion examples/hydroelastic/python_nonconvex_mesh/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

load("//tools/skylark:drake_py.bzl", "drake_py_binary")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/install:install_data.bzl", "install_data")
load("@drake//tools/workspace:forward_files.bzl", "forward_files")
load("//tools/workspace/models_internal:files.bzl", "veggies_mesh_files")
load("//tools/workspace/models_internal:files.bzl", "dishes_files")
Expand Down
13 changes: 11 additions & 2 deletions examples/hydroelastic/spatula_slip_control/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

load("@drake//tools/skylark:drake_cc.bzl", "drake_cc_binary")
load("@drake//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load("@drake//tools/workspace:forward_files.bzl", "forward_files")
load(
Expand All @@ -18,9 +19,17 @@ _WSG_50_HYDRO_BUBBLE_MESHES = forward_files(
visibility = ["//visibility:private"],
)

models_filegroup(
name = "models",
extra_srcs = _WSG_50_HYDRO_BUBBLE_MESHES,
glob_exclude = ["images/**/*"],
visibility = ["//visibility:public"],
)

install_data(
extra_exclude_patterns = ["images/**/*"],
extra_prod_models = _WSG_50_HYDRO_BUBBLE_MESHES,
name = "install_data",
data = [":models"],
visibility = ["//visibility:public"],
)

drake_cc_binary(
Expand Down
6 changes: 0 additions & 6 deletions examples/kuka_iiwa_arm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ alias(
visibility = ["//visibility:public"],
)

alias(
name = "prod_models",
actual = "//examples/kuka_iiwa_arm/models:prod_models",
visibility = ["//visibility:public"],
)

# === test/ ===

drake_cc_googletest(
Expand Down
10 changes: 9 additions & 1 deletion examples/kuka_iiwa_arm/models/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# -*- python -*-

load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])

install_data()
models_filegroup(
name = "models",
)

install_data(
name = "install_data",
data = [":models"],
)

add_lint_tests()
14 changes: 12 additions & 2 deletions examples/manipulation_station/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ load(
"drake_py_library",
)
load("@drake//tools/skylark:test_tags.bzl", "vtk_test_tags")
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:test_tags.bzl", "vtk_test_tags")

models_filegroup(
name = "models",
visibility = ["//visibility:public"],
)

install_data(
name = "install_data",
data = [":models"],
visibility = ["//visibility:public"],
)

drake_cc_library(
name = "manipulation_station",
srcs = [
Expand Down Expand Up @@ -239,6 +251,4 @@ drake_py_binary(
],
)

install_data()

add_lint_tests()
12 changes: 10 additions & 2 deletions examples/multibody/cart_pole/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ load(
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load(
"@drake//tools/vector_gen:vector_gen.bzl",
Expand All @@ -16,6 +17,15 @@ load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])

models_filegroup(
name = "models",
)

install_data(
name = "install_data",
data = [":models"],
)

drake_cc_vector_gen_library(
name = "cart_pole_params",
srcs = ["cart_pole_params_named_vector.yaml"],
Expand Down Expand Up @@ -53,6 +63,4 @@ drake_cc_googletest(
],
)

install_data()

add_lint_tests()
14 changes: 12 additions & 2 deletions examples/pendulum/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ load(
"drake_cc_googletest",
"drake_cc_library",
)
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
load(
Expand All @@ -15,6 +16,17 @@ load(

package(default_visibility = ["//visibility:private"])

models_filegroup(
name = "models",
visibility = ["//visibility:public"],
)

install_data(
name = "install_data",
data = [":models"],
visibility = ["//visibility:public"],
)

drake_cc_vector_gen_library(
name = "pendulum_vector_types",
srcs = [
Expand Down Expand Up @@ -183,6 +195,4 @@ drake_cc_googletest(
],
)

install_data()

add_lint_tests()
Loading