From 0ade13c87faa17a630a434b7290d8d766e7965cd Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Mon, 25 Mar 2024 14:39:49 -0700 Subject: [PATCH] [models] Move ycb models into drake_models package [workspace] Upgrade drake_models to latest commit --- BUILD.bazel | 1 - bindings/pydrake/examples/_examples_extra.py | 22 ++-- bindings/pydrake/systems/BUILD.bazel | 2 +- .../systems/jupyter_widgets_examples.ipynb | 2 +- bindings/pydrake/test/parse_models_test.py | 3 + .../pydrake/visualization/test/meldis_test.py | 2 +- examples/manipulation_station/BUILD.bazel | 2 +- .../manipulation_station.cc | 8 +- .../mock_station_simulation.cc | 2 +- .../manipulation_station/proof_of_life.cc | 2 +- .../test/manipulation_station_test.cc | 4 +- geometry/BUILD.bazel | 2 +- geometry/render_gltf_client/BUILD.bazel | 2 +- .../render_gltf_client/test/example_scene.sdf | 2 +- manipulation/models/BUILD.bazel | 1 - manipulation/models/ycb/BUILD.bazel | 62 --------- manipulation/models/ycb/README.md | 8 -- .../models/ycb/sdf/003_cracker_box.sdf | 121 ----------------- manipulation/models/ycb/sdf/004_sugar_box.sdf | 121 ----------------- .../models/ycb/sdf/005_tomato_soup_can.sdf | 123 ----------------- .../models/ycb/sdf/006_mustard_bottle.sdf | 124 ------------------ .../models/ycb/sdf/009_gelatin_box.sdf | 121 ----------------- .../models/ycb/sdf/010_potted_meat_can.sdf | 121 ----------------- manipulation/models/ycb/test/parse_test.cc | 112 ---------------- planning/BUILD.bazel | 2 +- .../scene_graph_collision_checker_test.cc | 4 +- tools/workspace/drake_models/repository.bzl | 4 +- .../authoring_multibody_simulation.ipynb | 2 +- 28 files changed, 38 insertions(+), 944 deletions(-) delete mode 100644 manipulation/models/ycb/BUILD.bazel delete mode 100644 manipulation/models/ycb/README.md delete mode 100644 manipulation/models/ycb/sdf/003_cracker_box.sdf delete mode 100644 manipulation/models/ycb/sdf/004_sugar_box.sdf delete mode 100644 manipulation/models/ycb/sdf/005_tomato_soup_can.sdf delete mode 100644 manipulation/models/ycb/sdf/006_mustard_bottle.sdf delete mode 100644 manipulation/models/ycb/sdf/009_gelatin_box.sdf delete mode 100644 manipulation/models/ycb/sdf/010_potted_meat_can.sdf delete mode 100644 manipulation/models/ycb/test/parse_test.cc diff --git a/BUILD.bazel b/BUILD.bazel index 3043caaa775f..a99cda25a371 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -62,7 +62,6 @@ filegroup( "//manipulation/models/realsense2_description:models", "//manipulation/models/ur3e:models", "//manipulation/models/wsg_50_description:models", - "//manipulation/models/ycb:models", "//multibody/benchmarks/acrobot:models", "@drake_models", ], diff --git a/bindings/pydrake/examples/_examples_extra.py b/bindings/pydrake/examples/_examples_extra.py index 7a3ed5435330..254dea997ddc 100644 --- a/bindings/pydrake/examples/_examples_extra.py +++ b/bindings/pydrake/examples/_examples_extra.py @@ -19,28 +19,28 @@ def CreateManipulationClassYcbObjectList(): # The cracker box pose X_WCracker = _xyz_rpy_deg([0.35, 0.14, 0.09], [0, -90, 230]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/003_cracker_box.sdf", X_WCracker)) + ("drake_models/ycb/003_cracker_box.sdf", X_WCracker)) # The sugar box pose. X_WSugar = _xyz_rpy_deg([0.28, -0.17, 0.03], [0, 90, 180]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/004_sugar_box.sdf", X_WSugar)) + ("drake_models/ycb/004_sugar_box.sdf", X_WSugar)) # The tomato soup can pose. X_WSoup = _xyz_rpy_deg([0.40, -0.07, 0.03], [-90, 0, 180]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/005_tomato_soup_can.sdf", X_WSoup)) + ("drake_models/ycb/005_tomato_soup_can.sdf", X_WSoup)) # The mustard bottle pose. X_WMustard = _xyz_rpy_deg([0.44, -0.16, 0.09], [-90, 0, 190]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/006_mustard_bottle.sdf", + ("drake_models/ycb/006_mustard_bottle.sdf", X_WMustard)) # The potted meat can pose. X_WMeat = _xyz_rpy_deg([0.35, -0.32, 0.03], [-90, 0, 145]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/010_potted_meat_can.sdf", X_WMeat)) + ("drake_models/ycb/010_potted_meat_can.sdf", X_WMeat)) return ycb_object_pairs @@ -54,32 +54,32 @@ def CreateClutterClearingYcbObjectList(): # The cracker box pose. X_WCracker = _xyz_rpy_deg([-0.3, -0.55, 0.2], [-90, 0, 170]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/003_cracker_box.sdf", X_WCracker)) + ("drake_models/ycb/003_cracker_box.sdf", X_WCracker)) # The sugar box pose. X_WSugar = _xyz_rpy_deg([-0.3, -0.7, 0.17], [90, 90, 0]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/004_sugar_box.sdf", X_WSugar)) + ("drake_models/ycb/004_sugar_box.sdf", X_WSugar)) # The tomato soup can pose. X_WSoup = _xyz_rpy_deg([-0.03, -0.57, 0.15], [-90, 0, 180]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/005_tomato_soup_can.sdf", X_WSoup)) + ("drake_models/ycb/005_tomato_soup_can.sdf", X_WSoup)) # The mustard bottle pose. X_WMustard = _xyz_rpy_deg([0.05, -0.66, 0.19], [-90, 0, 190]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/006_mustard_bottle.sdf", + ("drake_models/ycb/006_mustard_bottle.sdf", X_WMustard)) # The gelatin box pose. X_WGelatin = _xyz_rpy_deg([-0.15, -0.62, 0.22], [-90, 0, 210]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/009_gelatin_box.sdf", X_WGelatin)) + ("drake_models/ycb/009_gelatin_box.sdf", X_WGelatin)) # The potted meat can pose. X_WMeat = _xyz_rpy_deg([-0.15, -0.62, 0.14], [-90, 0, 145]) ycb_object_pairs.append( - ("drake/manipulation/models/ycb/sdf/010_potted_meat_can.sdf", X_WMeat)) + ("drake_models/ycb/010_potted_meat_can.sdf", X_WMeat)) return ycb_object_pairs diff --git a/bindings/pydrake/systems/BUILD.bazel b/bindings/pydrake/systems/BUILD.bazel index cfb38c5c9aa2..3ebf763ff02e 100644 --- a/bindings/pydrake/systems/BUILD.bazel +++ b/bindings/pydrake/systems/BUILD.bazel @@ -353,7 +353,7 @@ drake_jupyter_py_binary( name = "jupyter_widgets_examples", add_test_rule = 1, data = [ - "//manipulation/models/ycb:models", + "@drake_models", ], deps = [ ":analysis_py", diff --git a/bindings/pydrake/systems/jupyter_widgets_examples.ipynb b/bindings/pydrake/systems/jupyter_widgets_examples.ipynb index 7034e1807e67..87ad614f7ffe 100644 --- a/bindings/pydrake/systems/jupyter_widgets_examples.ipynb +++ b/bindings/pydrake/systems/jupyter_widgets_examples.ipynb @@ -65,7 +65,7 @@ "plant = MultibodyPlant(time_step=0.0)\n", "plant.RegisterAsSourceForSceneGraph(scene_graph)\n", "Parser(plant, scene_graph).AddModelsFromUrl(\n", - " url=\"package://drake/manipulation/models/ycb/sdf/006_mustard_bottle.sdf\")\n", + " url=\"package://drake_models/ycb/006_mustard_bottle.sdf\")\n", "plant.Finalize()\n", "\n", "frame_id = plant.GetBodyFrameIdOrThrow(BodyIndex(1)) \n", diff --git a/bindings/pydrake/test/parse_models_test.py b/bindings/pydrake/test/parse_models_test.py index 771c1df48213..743c259516b4 100644 --- a/bindings/pydrake/test/parse_models_test.py +++ b/bindings/pydrake/test/parse_models_test.py @@ -43,6 +43,9 @@ def test_available_runfiles(self): if model_relpath.startswith("external/sdformat/sdf"): # These are schema files; do not load. model_files.remove(model_file) + if model_relpath.startswith("external/drake_models/"): + # These are checked elsewhere by drake_models-specific tests. + model_files.remove(model_file) # We expect there to be dozens of files that should be available for # parsing. Do a quick check to make sure we're in the right order of # magnitude in order to prevent false test success based on changes diff --git a/bindings/pydrake/visualization/test/meldis_test.py b/bindings/pydrake/visualization/test/meldis_test.py index 0c3fe3124f12..d05ed48a05db 100644 --- a/bindings/pydrake/visualization/test/meldis_test.py +++ b/bindings/pydrake/visualization/test/meldis_test.py @@ -198,7 +198,7 @@ def test_viewer_applet_textured_meshes(self): """Checks _ViewerApplet support for textured meshes. """ self._check_viewer_applet_on_model( - "drake/manipulation/models/ycb/sdf/004_sugar_box.sdf") + "drake_models/ycb/004_sugar_box.sdf") def test_viewer_applet_reload_optimization(self): """Checks that loading the identical scene twice is efficient. diff --git a/examples/manipulation_station/BUILD.bazel b/examples/manipulation_station/BUILD.bazel index 5eb43df07ec3..b22d7c10db69 100644 --- a/examples/manipulation_station/BUILD.bazel +++ b/examples/manipulation_station/BUILD.bazel @@ -57,7 +57,7 @@ drake_cc_library( "//manipulation/models/iiwa_description:models", "//manipulation/models/realsense2_description:models", "//manipulation/models/wsg_50_description:models", - "//manipulation/models/ycb:models", + "@drake_models", ], visibility = ["//visibility:public"], deps = [ diff --git a/examples/manipulation_station/manipulation_station.cc b/examples/manipulation_station/manipulation_station.cc index a0b9e4049d3b..288386365bdf 100644 --- a/examples/manipulation_station/manipulation_station.cc +++ b/examples/manipulation_station/manipulation_station.cc @@ -316,7 +316,13 @@ template void ManipulationStation::AddManipulandFromFile( const std::string& model_file, const RigidTransform& X_WObject) { multibody::Parser parser(plant_); - const auto models = parser.AddModels(FindResourceOrThrow(model_file)); + std::vector models; + if (model_file.starts_with("drake/") || + model_file.starts_with("drake_models/")) { + models = parser.AddModelsFromUrl("package://" + model_file); + } else { + models = parser.AddModels(FindResourceOrThrow(model_file)); + } DRAKE_THROW_UNLESS(models.size() == 1); const auto model_index = models[0]; const auto indices = plant_->GetBodyIndices(model_index); diff --git a/examples/manipulation_station/mock_station_simulation.cc b/examples/manipulation_station/mock_station_simulation.cc index 74b5898d157e..fabbe7f1b959 100644 --- a/examples/manipulation_station/mock_station_simulation.cc +++ b/examples/manipulation_station/mock_station_simulation.cc @@ -71,7 +71,7 @@ int do_main(int argc, char* argv[]) { } else if (FLAGS_setup == "clutter_clearing") { station->SetupClutterClearingStation(); station->AddManipulandFromFile( - "drake/manipulation/models/ycb/sdf/003_cracker_box.sdf", + "drake_models/ycb/003_cracker_box.sdf", math::RigidTransform(math::RollPitchYaw(-1.57, 0, 3), Eigen::Vector3d(-0.3, -0.55, 0.36))); } else { diff --git a/examples/manipulation_station/proof_of_life.cc b/examples/manipulation_station/proof_of_life.cc index 295f2724ed78..ff2fa3c34af9 100644 --- a/examples/manipulation_station/proof_of_life.cc +++ b/examples/manipulation_station/proof_of_life.cc @@ -45,7 +45,7 @@ int do_main(int argc, char* argv[]) { if (FLAGS_setup == "clutter_clearing") { station->SetupClutterClearingStation(std::nullopt); station->AddManipulandFromFile( - "drake/manipulation/models/ycb/sdf/003_cracker_box.sdf", + "drake_models/ycb/003_cracker_box.sdf", RigidTransform(RollPitchYaw(-1.57, 0, 3), Eigen::Vector3d(-0.3, -0.55, 0.36))); } else if (FLAGS_setup == "manipulation_class") { diff --git a/examples/manipulation_station/test/manipulation_station_test.cc b/examples/manipulation_station/test/manipulation_station_test.cc index 938194a24dcf..d6309b00a832 100644 --- a/examples/manipulation_station/test/manipulation_station_test.cc +++ b/examples/manipulation_station/test/manipulation_station_test.cc @@ -466,7 +466,7 @@ GTEST_TEST(ManipulationStationTest, AddManipulandFromFile) { station.get_multibody_plant().num_model_instances(); station.AddManipulandFromFile( - "drake/manipulation/models/ycb/sdf/003_cracker_box.sdf", + "drake_models/ycb/003_cracker_box.sdf", math::RigidTransform::Identity()); // Check that the cracker box was added. @@ -474,7 +474,7 @@ GTEST_TEST(ManipulationStationTest, AddManipulandFromFile) { num_base_instances + 1); station.AddManipulandFromFile( - "drake/manipulation/models/ycb/sdf/004_sugar_box.sdf", + "drake_models/ycb/004_sugar_box.sdf", math::RigidTransform::Identity()); // Check that the sugar box was added. diff --git a/geometry/BUILD.bazel b/geometry/BUILD.bazel index 667a377dcd2a..438da43168c5 100644 --- a/geometry/BUILD.bazel +++ b/geometry/BUILD.bazel @@ -544,8 +544,8 @@ drake_cc_binary( "//examples/kuka_iiwa_arm:models", "//geometry/render:test_models", "//manipulation/models/iiwa_description:models", - "//manipulation/models/ycb:models", "//multibody/meshcat:models", + "@drake_models", ], visibility = ["//visibility:private"], deps = [ diff --git a/geometry/render_gltf_client/BUILD.bazel b/geometry/render_gltf_client/BUILD.bazel index ee893f7d5bbf..81be22c890c3 100644 --- a/geometry/render_gltf_client/BUILD.bazel +++ b/geometry/render_gltf_client/BUILD.bazel @@ -298,7 +298,7 @@ drake_cc_binary( srcs = ["test/client_demo.cc"], data = [ ":gltf_client_test_models", - "//manipulation/models/ycb:models", + "@drake_models", ], deps = [ ":factory", diff --git a/geometry/render_gltf_client/test/example_scene.sdf b/geometry/render_gltf_client/test/example_scene.sdf index 6e2b24d6d2ff..2384604bafd2 100644 --- a/geometry/render_gltf_client/test/example_scene.sdf +++ b/geometry/render_gltf_client/test/example_scene.sdf @@ -154,7 +154,7 @@ - package://drake/manipulation/models/ycb/sdf/006_mustard_bottle.sdf + package://drake_models/ycb/006_mustard_bottle.sdf mustard_bottle 0 0 0 0 0 0 diff --git a/manipulation/models/BUILD.bazel b/manipulation/models/BUILD.bazel index 2a63d888423a..97442e573ba6 100644 --- a/manipulation/models/BUILD.bazel +++ b/manipulation/models/BUILD.bazel @@ -11,7 +11,6 @@ install( "//manipulation/models/realsense2_description:install_data", "//manipulation/models/ur3e:install_data", "//manipulation/models/wsg_50_description:install_data", - "//manipulation/models/ycb:install_data", ], ) diff --git a/manipulation/models/ycb/BUILD.bazel b/manipulation/models/ycb/BUILD.bazel deleted file mode 100644 index bd0db732e0e8..000000000000 --- a/manipulation/models/ycb/BUILD.bazel +++ /dev/null @@ -1,62 +0,0 @@ -load( - "//tools/skylark:drake_cc.bzl", - "drake_cc_googletest", -) -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"]) - -models_filegroup( - name = "glob_models", - visibility = ["//visibility:private"], -) - -install_data( - name = "install_data", - data = [":glob_models"], -) - -filegroup( - name = "models", - srcs = [ - ":glob_models", - "@drake_models//:ycb/meshes/003_cracker_box_textured.mtl", - "@drake_models//:ycb/meshes/003_cracker_box_textured.obj", - "@drake_models//:ycb/meshes/003_cracker_box_textured.png", - "@drake_models//:ycb/meshes/004_sugar_box_textured.mtl", - "@drake_models//:ycb/meshes/004_sugar_box_textured.obj", - "@drake_models//:ycb/meshes/004_sugar_box_textured.png", - "@drake_models//:ycb/meshes/005_tomato_soup_can_textured.mtl", - "@drake_models//:ycb/meshes/005_tomato_soup_can_textured.obj", - "@drake_models//:ycb/meshes/005_tomato_soup_can_textured.png", - "@drake_models//:ycb/meshes/006_mustard_bottle_textured.mtl", - "@drake_models//:ycb/meshes/006_mustard_bottle_textured.obj", - "@drake_models//:ycb/meshes/006_mustard_bottle_textured.png", - "@drake_models//:ycb/meshes/009_gelatin_box_textured.mtl", - "@drake_models//:ycb/meshes/009_gelatin_box_textured.obj", - "@drake_models//:ycb/meshes/009_gelatin_box_textured.png", - "@drake_models//:ycb/meshes/010_potted_meat_can_textured.mtl", - "@drake_models//:ycb/meshes/010_potted_meat_can_textured.obj", - "@drake_models//:ycb/meshes/010_potted_meat_can_textured.png", - ], -) - -# === test/ === - -drake_cc_googletest( - name = "parse_test", - data = [":models"], - deps = [ - "//common:find_resource", - "//common:scope_exit", - "//geometry:meshcat_visualizer", - "//geometry/test_utilities:meshcat_environment", - "//multibody/parsing", - "//multibody/plant", - "//systems/analysis:simulator", - ], -) - -add_lint_tests() diff --git a/manipulation/models/ycb/README.md b/manipulation/models/ycb/README.md deleted file mode 100644 index 66b0d4dbc403..000000000000 --- a/manipulation/models/ycb/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# YCB Models - -This incorporates a subset of the YCB Models, using mesh files from -`RobotLocomotion/models`. - -For more information, please see the -[`ycb README`](https://github.com/RobotLocomotion/models/tree/master/ycb) -in the `models` repository. diff --git a/manipulation/models/ycb/sdf/003_cracker_box.sdf b/manipulation/models/ycb/sdf/003_cracker_box.sdf deleted file mode 100644 index 435b4b202684..000000000000 --- a/manipulation/models/ycb/sdf/003_cracker_box.sdf +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - 0.411 - - 0.001736 - 0 - 0 - 0.001098 - 0 - 0.002481 - - - - -0.014 0.103 0.013 1.57 -1.57 0 - - - package://drake_models/ycb/meshes/003_cracker_box_textured.obj - - - - - - - - 0.158000 0.207400 0.065800 - - - - - 0.079500 0.104200 0.033400 0 0 0 - - - 1e-7 - - - - - 0.079500 -0.104200 0.033400 0 0 0 - - - 1e-7 - - - - - -0.079500 0.104200 0.033400 0 0 0 - - - 1e-7 - - - - - -0.079500 -0.104200 0.033400 0 0 0 - - - 1e-7 - - - - - 0.079500 0.104200 -0.033400 0 0 0 - - - 1e-7 - - - - - 0.079500 -0.104200 -0.033400 0 0 0 - - - 1e-7 - - - - - -0.079500 0.104200 -0.033400 0 0 0 - - - 1e-7 - - - - - -0.079500 -0.104200 -0.033400 0 0 0 - - - 1e-7 - - - - - - diff --git a/manipulation/models/ycb/sdf/004_sugar_box.sdf b/manipulation/models/ycb/sdf/004_sugar_box.sdf deleted file mode 100644 index ddfd6cae4b50..000000000000 --- a/manipulation/models/ycb/sdf/004_sugar_box.sdf +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - 0.514000 - - 0.001418 - 0 - 0 - 0.000455 - 0 - 0.001699 - - - - -0.018 0.088 0.0039 -0.77 -1.52 2.36 - - - package://drake_models/ycb/meshes/004_sugar_box_textured.obj - - - - - - - - 0.086700 0.170300 0.039100 - - - - - 0.043850 0.085650 0.020050 0 0 0 - - - 1e-7 - - - - - 0.043850 -0.085650 0.020050 0 0 0 - - - 1e-7 - - - - - -0.043850 0.085650 0.020050 0 0 0 - - - 1e-7 - - - - - -0.043850 -0.085650 0.020050 0 0 0 - - - 1e-7 - - - - - 0.043850 0.085650 -0.020050 0 0 0 - - - 1e-7 - - - - - 0.043850 -0.085650 -0.020050 0 0 0 - - - 1e-7 - - - - - -0.043850 0.085650 -0.020050 0 0 0 - - - 1e-7 - - - - - -0.043850 -0.085650 -0.020050 0 0 0 - - - 1e-7 - - - - - - diff --git a/manipulation/models/ycb/sdf/005_tomato_soup_can.sdf b/manipulation/models/ycb/sdf/005_tomato_soup_can.sdf deleted file mode 100644 index fecb09696f8a..000000000000 --- a/manipulation/models/ycb/sdf/005_tomato_soup_can.sdf +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - 0.349000 - - 0.000402 - 0 - 0 - 0.000200 - 0 - 0.000402 - - - - -0.0018 0.051 -0.084 1.57 0.13 0.0 - - - package://drake_models/ycb/meshes/005_tomato_soup_can_textured.obj - - - - - - 0 0 0 -1.57 0 0 - - - 0.031850 - 0.099900 - - - - - 0.016425 0.050450 0.016425 0 0 0 - - - 1e-7 - - - - - 0.016425 -0.050450 0.016425 0 0 0 - - - 1e-7 - - - - - -0.016425 0.050450 0.016425 0 0 0 - - - 1e-7 - - - - - -0.016425 -0.050450 0.016425 0 0 0 - - - 1e-7 - - - - - 0.016425 0.050450 -0.016425 0 0 0 - - - 1e-7 - - - - - 0.016425 -0.050450 -0.016425 0 0 0 - - - 1e-7 - - - - - -0.016425 0.050450 -0.016425 0 0 0 - - - 1e-7 - - - - - -0.016425 -0.050450 -0.016425 0 0 0 - - - 1e-7 - - - - - - diff --git a/manipulation/models/ycb/sdf/006_mustard_bottle.sdf b/manipulation/models/ycb/sdf/006_mustard_bottle.sdf deleted file mode 100644 index 9f16d3314cc7..000000000000 --- a/manipulation/models/ycb/sdf/006_mustard_bottle.sdf +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - 0.603000 - - 0.002009 - 0 - 0 - 0.000633 - 0 - 0.002302 - - - - 0.0049 0.092 0.027 1.57 -0.40 0.0 - - - package://drake_models/ycb/meshes/006_mustard_bottle_textured.obj - - - - - - 0 0.015 0 0 0 0 - - - 0.090000 0.160300 0.052200 - - - - - 0.045500 0.093150 0.026600 0 0 0 - - - 1e-7 - - - - - 0.045500 -0.063150 0.026600 0 0 0 - - - 1e-7 - - - - - -0.045500 0.093150 0.026600 0 0 0 - - - 1e-7 - - - - - -0.045500 -0.063150 0.026600 0 0 0 - - - 1e-7 - - - - - 0.045500 0.093150 -0.026600 0 0 0 - - - 1e-7 - - - - - 0.045500 -0.063150 -0.026600 0 0 0 - - - 1e-7 - - - - - -0.045500 0.093150 -0.026600 0 0 0 - - - 1e-7 - - - - - -0.045500 -0.063150 -0.026600 0 0 0 - - - 1e-7 - - - - - - diff --git a/manipulation/models/ycb/sdf/009_gelatin_box.sdf b/manipulation/models/ycb/sdf/009_gelatin_box.sdf deleted file mode 100644 index 519a275cb04c..000000000000 --- a/manipulation/models/ycb/sdf/009_gelatin_box.sdf +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - 0.097000 - - 0.000050 - 0 - 0 - 0.000072 - 0 - 0.000108 - - - - -0.0029 0.024 -0.015 -0.0085 -0.002 1.34 - - - package://drake_models/ycb/meshes/009_gelatin_box_textured.obj - - - - - - - - 0.083200 0.067100 0.024000 - - - - - 0.042100 0.034050 0.012500 0 0 0 - - - 1e-7 - - - - - 0.042100 -0.034050 0.012500 0 0 0 - - - 1e-7 - - - - - -0.042100 0.034050 0.012500 0 0 0 - - - 1e-7 - - - - - -0.042100 -0.034050 0.012500 0 0 0 - - - 1e-7 - - - - - 0.042100 0.034050 -0.012500 0 0 0 - - - 1e-7 - - - - - 0.042100 -0.034050 -0.012500 0 0 0 - - - 1e-7 - - - - - -0.042100 0.034050 -0.012500 0 0 0 - - - 1e-7 - - - - - -0.042100 -0.034050 -0.012500 0 0 0 - - - 1e-7 - - - - - - diff --git a/manipulation/models/ycb/sdf/010_potted_meat_can.sdf b/manipulation/models/ycb/sdf/010_potted_meat_can.sdf deleted file mode 100644 index d0c67bd56de6..000000000000 --- a/manipulation/models/ycb/sdf/010_potted_meat_can.sdf +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - 0.370000 - - 0.000317 - 0 - 0 - 0.000421 - 0 - 0.000533 - - - - 0.034 0.039 0.025 1.57 0.052 0.0 - - - package://drake_models/ycb/meshes/010_potted_meat_can_textured.obj - - - - - - - - 0.095600 0.077500 0.051600 - - - - - 0.048300 0.039250 0.026300 0 0 0 - - - 1e-7 - - - - - 0.048300 -0.039250 0.026300 0 0 0 - - - 1e-7 - - - - - -0.048300 0.039250 0.026300 0 0 0 - - - 1e-7 - - - - - -0.048300 -0.039250 0.026300 0 0 0 - - - 1e-7 - - - - - 0.048300 0.039250 -0.026300 0 0 0 - - - 1e-7 - - - - - 0.048300 -0.039250 -0.026300 0 0 0 - - - 1e-7 - - - - - -0.048300 0.039250 -0.026300 0 0 0 - - - 1e-7 - - - - - -0.048300 -0.039250 -0.026300 0 0 0 - - - 1e-7 - - - - - - diff --git a/manipulation/models/ycb/test/parse_test.cc b/manipulation/models/ycb/test/parse_test.cc deleted file mode 100644 index 7b9669e92b14..000000000000 --- a/manipulation/models/ycb/test/parse_test.cc +++ /dev/null @@ -1,112 +0,0 @@ -/** -@file -Parses and visualizes YCB objects. - -An example of showing all objects: - - bazel run //manipulation/models/ycb:parse_test -- --pause - -Showing the first object: - - bazel run //manipulation/models/ycb:parse_test -- \ - --pause --gtest_filter='*0' -*/ - -#include -#include -#include - -#include -#include -#include - -#include "drake/common/find_resource.h" -#include "drake/common/scope_exit.h" -#include "drake/geometry/meshcat_visualizer.h" -#include "drake/geometry/scene_graph.h" -#include "drake/geometry/test_utilities/meshcat_environment.h" -#include "drake/multibody/parsing/parser.h" -#include "drake/multibody/plant/multibody_plant.h" -#include "drake/systems/analysis/simulator.h" -#include "drake/systems/framework/diagram_builder.h" - -DEFINE_bool(pause, false, "Show each object until the user clicks."); - -namespace drake { -namespace manipulation { -namespace { - -using geometry::GetTestEnvironmentMeshcat; -using geometry::Meshcat; -using geometry::MeshcatVisualizerd; -using geometry::SceneGraph; -using multibody::AddMultibodyPlantSceneGraph; -using multibody::ModelInstanceIndex; -using multibody::MultibodyPlant; -using multibody::Parser; -using systems::DiagramBuilder; -using systems::Simulator; - -class ParseTest : public testing::TestWithParam {}; - -void WaitForNextButtonClick() { - std::shared_ptr meshcat = GetTestEnvironmentMeshcat(); - constexpr char kButtonName[] = "Show Next Model"; - meshcat->AddButton(kButtonName); - ScopeExit guard([&meshcat, kButtonName]() { - meshcat->DeleteButton(kButtonName); - }); - drake::log()->info( - "Pausing until '{}' is clicked in the Meshcat control panel...", - kButtonName); - while (meshcat->GetButtonClicks(kButtonName) == 0) { - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - } -} - -TEST_P(ParseTest, Quantities) { - const std::string object_name = GetParam(); - const std::string filename = FindResourceOrThrow( - fmt::format("drake/manipulation/models/ycb/sdf/{}.sdf", object_name)); - - DiagramBuilder builder; - auto [plant, scene_graph] = AddMultibodyPlantSceneGraph(&builder, 0.0); - Parser(&plant).AddModels(filename); - const auto& visualizer = MeshcatVisualizerd::AddToBuilder( - &builder, scene_graph, GetTestEnvironmentMeshcat()); - plant.Finalize(); - auto diagram = builder.Build(); - ScopeExit guard([&visualizer]() { - visualizer.Delete(); - }); - - // MultibodyPlant always creates at least two model instances, one for the - // world and one for a default model instance for unspecified modeling - // elements. Finally, there is a model instance for each YCB sdf file. - EXPECT_EQ(plant.num_model_instances(), 3); - - // Each object has two bodies, the world body and the object body. - EXPECT_EQ(plant.num_bodies(), 2); - - // Display the object; optionally wait for user input. - drake::log()->info("Visualize: {}", object_name); - auto context = diagram->CreateDefaultContext(); - diagram->ForcedPublish(*context); - if (FLAGS_pause) { - WaitForNextButtonClick(); - } -} - -// clang-format off -INSTANTIATE_TEST_SUITE_P(Both, ParseTest, testing::Values( - "003_cracker_box", - "004_sugar_box", - "005_tomato_soup_can", - "006_mustard_bottle", - "009_gelatin_box", - "010_potted_meat_can")); -// clang-format on - -} // namespace -} // namespace manipulation -} // namespace drake diff --git a/planning/BUILD.bazel b/planning/BUILD.bazel index 675bfb278327..380fc8242bd5 100644 --- a/planning/BUILD.bazel +++ b/planning/BUILD.bazel @@ -314,7 +314,7 @@ drake_cc_googletest( name = "scene_graph_collision_checker_test", timeout = "moderate", data = [ - "//manipulation/models/ycb:models", + "@drake_models", ], # Running with multiple threads is an essential part of our test coverage. num_threads = 2, diff --git a/planning/test/scene_graph_collision_checker_test.cc b/planning/test/scene_graph_collision_checker_test.cc index 770fdce3c5a0..733267cd0663 100644 --- a/planning/test/scene_graph_collision_checker_test.cc +++ b/planning/test/scene_graph_collision_checker_test.cc @@ -373,7 +373,7 @@ GTEST_TEST(SceneGraphCollisionCheckerTest, ClearanceFloatingBase) { child: ground::ground_plane_box - add_model: name: chassis - file: package://drake/manipulation/models/ycb/sdf/010_potted_meat_can.sdf + file: package://drake_models/ycb/010_potted_meat_can.sdf - add_model: name: arm file: package://drake/manipulation/models/iiwa_description/urdf/iiwa14_spheres_dense_collision.urdf @@ -443,7 +443,7 @@ GTEST_TEST(SceneGraphCollisionCheckerTest, CollisionFilterUpdate) { child: ground::ground_plane_box - add_model: name: chassis - file: package://drake/manipulation/models/ycb/sdf/010_potted_meat_can.sdf + file: package://drake_models/ycb/010_potted_meat_can.sdf - add_model: name: arm file: package://drake/manipulation/models/iiwa_description/urdf/iiwa14_spheres_dense_collision.urdf diff --git a/tools/workspace/drake_models/repository.bzl b/tools/workspace/drake_models/repository.bzl index 54ee2667f9bc..bb3500829b90 100644 --- a/tools/workspace/drake_models/repository.bzl +++ b/tools/workspace/drake_models/repository.bzl @@ -6,8 +6,8 @@ def drake_models_repository( github_archive( name = name, repository = "RobotLocomotion/models", - commit = "199f3e5a8c868ed459f05e73e5eee65da843ffdd", - sha256 = "c09e320a42d7ce6db2e1f622898726c5853db5ee0faf23715f9d3c2274a53ac7", # noqa + commit = "c18b846754cee4745ca389d33b60849bbf58314a", + sha256 = "27b2c24f0ecb63ed9fbd0eebe65699ed6f979d7ed572f59c810d274c1dbd5d8f", # noqa build_file = ":package.BUILD.bazel", mirrors = mirrors, ) diff --git a/tutorials/authoring_multibody_simulation.ipynb b/tutorials/authoring_multibody_simulation.ipynb index 49959acbb5dc..8661db21d624 100644 --- a/tutorials/authoring_multibody_simulation.ipynb +++ b/tutorials/authoring_multibody_simulation.ipynb @@ -390,7 +390,7 @@ " parser.AddModels(table_top_sdf_file)\n", " # Load a cracker box from Drake. \n", " parser.AddModels(\n", - " url=\"package://drake/manipulation/models/ycb/sdf/003_cracker_box.sdf\")\n", + " url=\"package://drake_models/ycb/003_cracker_box.sdf\")\n", " # Load an OBJ file from Drake, with no SDFormat wrapper file. In this case,\n", " # the mass and inertia are inferred based on the volume of the mesh as if\n", " # it were filled with water, and the mesh is used for both collision and\n",