diff --git a/multibody/parsing/BUILD.bazel b/multibody/parsing/BUILD.bazel index 469eb3fd81ca..a596c82b1350 100644 --- a/multibody/parsing/BUILD.bazel +++ b/multibody/parsing/BUILD.bazel @@ -17,10 +17,6 @@ load( "//tools/workspace/dm_control_internal:files.bzl", "dm_control_mujoco_files", ) -load( - "//tools/workspace/mujoco_menagerie_internal:files.bzl", - "mujoco_menagerie_files", -) filegroup( name = "test_models", @@ -48,18 +44,6 @@ _DM_CONTROL_MUJOCO_FILES = forward_files( visibility = ["//visibility:private"], ) -_MUJOCO_MENAGERIE_FILES = forward_files( - srcs = [ - "@mujoco_menagerie_internal//:" + - x - for x in mujoco_menagerie_files() - ], - dest_prefix = "mujoco_menagerie/", - strip_prefix = "@mujoco_menagerie_internal//:", - tags = ["manual"], - visibility = ["//visibility:private"], -) - drake_cc_package_library( name = "parsing", visibility = ["//visibility:public"], @@ -668,10 +652,13 @@ drake_cc_googletest( ":test_models", "//geometry:test_obj_files", "//geometry:test_stl_files", - ] + _DM_CONTROL_MUJOCO_FILES + _MUJOCO_MENAGERIE_FILES, + "@mujoco_menagerie_internal//:google_robot", + "@mujoco_menagerie_internal//:kuka_iiwa_14", + ] + _DM_CONTROL_MUJOCO_FILES, deps = [ ":detail_mujoco_parser", "//common:find_resource", + "//common:find_runfiles", "//common/test_utilities:diagnostic_policy_test_base", "//common/test_utilities:eigen_matrix_compare", "//common/test_utilities:expect_throws_message", diff --git a/multibody/parsing/test/detail_mujoco_parser_test.cc b/multibody/parsing/test/detail_mujoco_parser_test.cc index ee3c9846d00c..3991694456ac 100644 --- a/multibody/parsing/test/detail_mujoco_parser_test.cc +++ b/multibody/parsing/test/detail_mujoco_parser_test.cc @@ -6,6 +6,7 @@ #include #include "drake/common/find_resource.h" +#include "drake/common/find_runfiles.h" #include "drake/common/test_utilities/diagnostic_policy_test_base.h" #include "drake/common/test_utilities/eigen_matrix_compare.h" #include "drake/common/test_utilities/expect_throws_message.h" @@ -149,9 +150,10 @@ TEST_P(MujocoMenagerieTest, MujocoMenagerie) { // Confirm successful parsing of the MuJoCo models in the DeepMind control // suite. std::string model{GetParam()}; - const std::string filename = FindResourceOrThrow( - fmt::format("drake/multibody/parsing/mujoco_menagerie/{}.xml", model)); - AddModelFromFile(filename, model); + const RlocationOrError rlocation = FindRunfile( + fmt::format("mujoco_menagerie_internal/{}.xml", model)); + ASSERT_EQ(rlocation.error, ""); + AddModelFromFile(rlocation.abspath, model); EXPECT_TRUE(plant_.HasModelInstanceNamed(model)); diff --git a/tools/workspace/mujoco_menagerie_internal/files.bzl b/tools/workspace/mujoco_menagerie_internal/files.bzl deleted file mode 100644 index 480700bec189..000000000000 --- a/tools/workspace/mujoco_menagerie_internal/files.bzl +++ /dev/null @@ -1,74 +0,0 @@ -# Keep the macros sorted alphabetically by macro name. -# Keep the lists of files sorted alphabetically by filename. - -def mujoco_menagerie_files(): - return [ - "google_robot/robot.xml", - "google_robot/LICENSE", - "google_robot/assets/finger_base_texture.png", - "google_robot/assets/finger_tip_texture.png", - "google_robot/assets/link_base_0_00.stl", - "google_robot/assets/link_base_0_01.stl", - "google_robot/assets/link_base_1_00.stl", - "google_robot/assets/link_base_1_01.stl", - "google_robot/assets/link_base_1_02.stl", - "google_robot/assets/link_base_1_03.stl", - "google_robot/assets/link_base_1_04.stl", - "google_robot/assets/link_base_1_05.stl", - "google_robot/assets/link_base_1_06.stl", - "google_robot/assets/link_base_1_07.stl", - "google_robot/assets/link_base_1_08.stl", - "google_robot/assets/link_base_1_09.stl", - "google_robot/assets/link_base_1_10.stl", - "google_robot/assets/link_base_1_11.stl", - "google_robot/assets/link_base_1_12.stl", - "google_robot/assets/link_base_1_13.stl", - "google_robot/assets/link_base_1_14.stl", - "google_robot/assets/link_base_1_15.stl", - "google_robot/assets/link_base_1_16.stl", - "google_robot/assets/link_base_1_17.stl", - "google_robot/assets/link_base_1_18.stl", - "google_robot/assets/link_base_1_19.stl", - "google_robot/assets/link_base_v.obj", - "google_robot/assets/link_bicep.stl", - "google_robot/assets/link_bicep_v.obj", - "google_robot/assets/link_elbow.stl", - "google_robot/assets/link_elbow_v.obj", - "google_robot/assets/link_finger_base.stl", - "google_robot/assets/link_finger_base_v.obj", - "google_robot/assets/link_finger_tip.stl", - "google_robot/assets/link_finger_tip_v.obj", - "google_robot/assets/link_forearm.stl", - "google_robot/assets/link_forearm_v.obj", - "google_robot/assets/link_gripper.stl", - "google_robot/assets/link_gripper_v.obj", - "google_robot/assets/link_head_pan.stl", - "google_robot/assets/link_head_pan_v.obj", - "google_robot/assets/link_head_tilt.stl", - "google_robot/assets/link_head_tilt_v.obj", - "google_robot/assets/link_shoulder.stl", - "google_robot/assets/link_shoulder_v.obj", - "google_robot/assets/link_torso_00.stl", - "google_robot/assets/link_torso_01.stl", - "google_robot/assets/link_torso_v.obj", - "google_robot/assets/link_wheel_v.obj", - "google_robot/assets/link_wrist.stl", - "google_robot/assets/link_wrist_v.obj", - "google_robot/assets/robot_texture.png", - ] + [ - "kuka_iiwa_14/iiwa14.xml", - "kuka_iiwa_14/LICENSE", - "kuka_iiwa_14/assets/band.obj", - "kuka_iiwa_14/assets/kuka.obj", - "kuka_iiwa_14/assets/link_0.obj", - "kuka_iiwa_14/assets/link_1.obj", - "kuka_iiwa_14/assets/link_2_grey.obj", - "kuka_iiwa_14/assets/link_2_orange.obj", - "kuka_iiwa_14/assets/link_3.obj", - "kuka_iiwa_14/assets/link_4_grey.obj", - "kuka_iiwa_14/assets/link_4_orange.obj", - "kuka_iiwa_14/assets/link_5.obj", - "kuka_iiwa_14/assets/link_6_grey.obj", - "kuka_iiwa_14/assets/link_6_orange.obj", - "kuka_iiwa_14/assets/link_7.obj", - ] diff --git a/tools/workspace/mujoco_menagerie_internal/package.BUILD.bazel b/tools/workspace/mujoco_menagerie_internal/package.BUILD.bazel index 7a85a7aa440d..7b84de9832a2 100644 --- a/tools/workspace/mujoco_menagerie_internal/package.BUILD.bazel +++ b/tools/workspace/mujoco_menagerie_internal/package.BUILD.bazel @@ -2,11 +2,13 @@ package(default_visibility = ["//visibility:public"]) -# We maintain a different export_files for each subdirectory of the repository, +# We maintain a different filegroup for each subdirectory of the repository, # and only once we have vetted the license (in the main LICENSE file). +# +# DO NOT ADD new subdirectories here unless and until you vet their LICENSE. -# google_robot -exports_files( +filegroup( + name = "google_robot", srcs = [ "google_robot/robot.xml", "google_robot/LICENSE", @@ -17,8 +19,8 @@ exports_files( ]), ) -# kuka_iiwa_14 -exports_files( +filegroup( + name = "kuka_iiwa_14", srcs = [ "kuka_iiwa_14/iiwa14.xml", "kuka_iiwa_14/LICENSE",