From 1f84c13a0ee396a21808619f1c92ba2b750eaaeb Mon Sep 17 00:00:00 2001 From: Russ Tedrake Date: Wed, 19 Jul 2023 07:10:14 -0500 Subject: [PATCH] move from gcs repo to RobotLocomotion/models --- geometry/BUILD.bazel | 18 ++++ geometry/benchmarking/BUILD.bazel | 1 + .../iris_in_configuration_space_benchmarks.cc | 30 ++----- geometry/models/README.md | 1 + geometry/models/bin/README.md | 1 + geometry/models/bin/bin.sdf | 86 +++++++++++++++++++ geometry/models/shelves/README.md | 1 + geometry/models/shelves/shelves.sdf | 61 +++++++++++++ geometry/models/table/README.md | 1 + geometry/models/table/table_wide.sdf | 22 +++++ multibody/parsing/BUILD.bazel | 2 +- multibody/parsing/package_map.cc | 5 +- tools/workspace/drake_models/repository.bzl | 1 + 13 files changed, 202 insertions(+), 28 deletions(-) create mode 100644 geometry/models/README.md create mode 100644 geometry/models/bin/README.md create mode 100644 geometry/models/bin/bin.sdf create mode 100644 geometry/models/shelves/README.md create mode 100644 geometry/models/shelves/shelves.sdf create mode 100644 geometry/models/table/README.md create mode 100644 geometry/models/table/table_wide.sdf diff --git a/geometry/BUILD.bazel b/geometry/BUILD.bazel index 8d867915895c..aa93e898ae19 100644 --- a/geometry/BUILD.bazel +++ b/geometry/BUILD.bazel @@ -607,6 +607,24 @@ drake_cc_googletest( # ----------------------------------------------------- +filegroup( + name = "models", + srcs = [ + "models/bin/bin.sdf", + "@drake_models//:geometry/bin/bin.mtl", + "@drake_models//:geometry/bin/bin.obj", + "@drake_models//:geometry/bin/bin.png", + "models/table/table_wide.sdf", + "@drake_models//:geometry/table/table_wide.mtl", + "@drake_models//:geometry/table/table_wide.obj", + "@drake_models//:geometry/table/table_wide.png", + "models/shelves/shelves.sdf", + "@drake_models//:geometry/shelves/shelves.mtl", + "@drake_models//:geometry/shelves/shelves.obj", + "@drake_models//:geometry/shelves/shelves.png", + ], +) + filegroup( name = "test_obj_files", testonly = 1, diff --git a/geometry/benchmarking/BUILD.bazel b/geometry/benchmarking/BUILD.bazel index 2098b15b4563..c657731c9b90 100644 --- a/geometry/benchmarking/BUILD.bazel +++ b/geometry/benchmarking/BUILD.bazel @@ -15,6 +15,7 @@ drake_cc_googlebench_binary( add_test_rule = True, data = [ "//examples/manipulation_station:models", + "//geometry:models", "//manipulation/models/iiwa_description:models", "//manipulation/models/wsg_50_description:models", ], diff --git a/geometry/benchmarking/iris_in_configuration_space_benchmarks.cc b/geometry/benchmarking/iris_in_configuration_space_benchmarks.cc index a1c315811d3c..677cd5eca6e8 100644 --- a/geometry/benchmarking/iris_in_configuration_space_benchmarks.cc +++ b/geometry/benchmarking/iris_in_configuration_space_benchmarks.cc @@ -103,7 +103,7 @@ class IiwaWithShelvesAndBins : public benchmark::Fixture { # Add Bins - add_model: name: binR - file: package://drake/examples/manipulation_station/models/bin.sdf + file: package://drake/geometry/models/bin/bin.sdf - add_weld: parent: world @@ -114,7 +114,7 @@ class IiwaWithShelvesAndBins : public benchmark::Fixture { - add_model: name: binL - file: package://drake/examples/manipulation_station/models/bin.sdf + file: package://drake/geometry/models/bin/bin.sdf - add_weld: parent: world @@ -122,29 +122,10 @@ class IiwaWithShelvesAndBins : public benchmark::Fixture { X_PC: translation: [0, 0.6, 0] rotation: !Rpy { deg: [0.0, 0.0, 90.0 ]} -)"""; - - parser.AddModelsFromString(model_directives, ".dmd.yaml"); - - // Don't add remote resources if we're in test mode. - if (!FLAGS_test) { - // We'll use some tables, shelves, and bins from a remote resource. - multibody::PackageMap::RemoteParams params; - params.urls.push_back( - "https://github.com/mpetersen94/gcs/archive/refs/tags/" - "arxiv_paper_version.tar.gz"); - params.sha256 = - "6dd5e841c8228561b6d622f592359c36517cd3c3d5e1d3e04df74b2f5435680c"; - params.strip_prefix = "gcs-arxiv_paper_version"; - parser.package_map().AddRemote("gcs", params); - - model_directives = R"""( -directives: - # Add shelves - add_model: name: shelves - file: package://gcs/models/shelves/shelves.sdf + file: package://drake/geometry/models/shelves/shelves.sdf - add_weld: parent: world @@ -155,7 +136,7 @@ class IiwaWithShelvesAndBins : public benchmark::Fixture { # Add table - add_model: name: table - file: package://gcs/models/table/table_wide.sdf + file: package://drake/geometry/models/table/table_wide.sdf - add_weld: parent: world @@ -165,8 +146,7 @@ class IiwaWithShelvesAndBins : public benchmark::Fixture { rotation: !Rpy { deg: [0., 0., 00]} )"""; - parser.AddModelsFromString(model_directives, ".dmd.yaml"); - } + parser.AddModelsFromString(model_directives, ".dmd.yaml"); } VectorXd MyInverseKinematics(const RigidTransformd& X_WE) { diff --git a/geometry/models/README.md b/geometry/models/README.md new file mode 100644 index 000000000000..8dce090f6be8 --- /dev/null +++ b/geometry/models/README.md @@ -0,0 +1 @@ +This directory contains models that are used by geometry benchmarks. diff --git a/geometry/models/bin/README.md b/geometry/models/bin/README.md new file mode 100644 index 000000000000..11b6dab8e478 --- /dev/null +++ b/geometry/models/bin/README.md @@ -0,0 +1 @@ +This model was copied from https://github.com/mpetersen94/gcs. \ No newline at end of file diff --git a/geometry/models/bin/bin.sdf b/geometry/models/bin/bin.sdf new file mode 100644 index 000000000000..df26a7116f45 --- /dev/null +++ b/geometry/models/bin/bin.sdf @@ -0,0 +1,86 @@ + + + + + + + 18.70 + + 0.79 + 0 + 0 + 0.53 + 0 + 1.2 + + + + 0 0 0 0 0 1.570796 + + + package://drake_models/geometry/bin/bin.obj + + + + + 0.22 0 0.105 0 0 0 + + + 0.05 0.63 0.21 + + + + + + -0.22 0 0.105 0 0 0 + + + 0.05 0.63 0.21 + + + + + 0 0.29 0.105 0 0 0 + + + 0.49 0.05 0.21 + + + + + 0 -0.29 0.105 0 0 0 + + + 0.49 0.05 0.21 + + + + + 0.0 0.0 0.0075 0 0 0 + + + 0.49 0.63 0.015 + + + + + + 0.22 0 0.21 0 0 0 + + + diff --git a/geometry/models/shelves/README.md b/geometry/models/shelves/README.md new file mode 100644 index 000000000000..11b6dab8e478 --- /dev/null +++ b/geometry/models/shelves/README.md @@ -0,0 +1 @@ +This model was copied from https://github.com/mpetersen94/gcs. \ No newline at end of file diff --git a/geometry/models/shelves/shelves.sdf b/geometry/models/shelves/shelves.sdf new file mode 100644 index 000000000000..e7954cfa2acc --- /dev/null +++ b/geometry/models/shelves/shelves.sdf @@ -0,0 +1,61 @@ + + + + + + + + package://drake_models/geometry/shelves/shelves.obj + + + + + 0 0.292 0 0 0 0 + + + 0.3 0.016 0.783 + + + + + 0 -0.292 0 0 0 0 + + + 0.3 0.016 0.783 + + + + + + + 0 0 0.3995 0 0 0 + + + 0.3 0.6 0.016 + + + + + 0 0 -0.13115 0 0 0 + + + 0.3 0.6 0.016 + + + + + 0 0 0.13115 0 0 0 + + + 0.3 0.6 0.016 + + + + + + + top_and_bottom + shelves_body + + + diff --git a/geometry/models/table/README.md b/geometry/models/table/README.md new file mode 100644 index 000000000000..11b6dab8e478 --- /dev/null +++ b/geometry/models/table/README.md @@ -0,0 +1 @@ +This model was copied from https://github.com/mpetersen94/gcs. \ No newline at end of file diff --git a/geometry/models/table/table_wide.sdf b/geometry/models/table/table_wide.sdf new file mode 100644 index 000000000000..03c29b4ae70a --- /dev/null +++ b/geometry/models/table/table_wide.sdf @@ -0,0 +1,22 @@ + + + + + + + + package://drake_models/geometry/table/table_wide.obj + + + + + 0 0 -0.1 0 0 0 + + + 2.5 2.5 0.2 + + + + + + diff --git a/multibody/parsing/BUILD.bazel b/multibody/parsing/BUILD.bazel index 0649e312e1d4..78cd52185524 100644 --- a/multibody/parsing/BUILD.bazel +++ b/multibody/parsing/BUILD.bazel @@ -69,7 +69,7 @@ drake_cc_library( srcs = ["package_map.cc"], hdrs = ["package_map.h"], data = [ - ":drake_models.json", +# ":drake_models.json", ":package_downloader.py", "//:package.xml", "@drake_models//:package.xml", diff --git a/multibody/parsing/package_map.cc b/multibody/parsing/package_map.cc index 39aa3189a3df..520cba148da5 100644 --- a/multibody/parsing/package_map.cc +++ b/multibody/parsing/package_map.cc @@ -532,8 +532,9 @@ PackageMap::PackageMap() : PackageMap{std::nullopt} { // Prepare the params for fetching remote drake_models. We do this outside of // the if-else to ensure it receives test coverage under bazel (i.e., even if // we're never going to download anything). - static const never_destroyed memoized_params( - GetDrakeModelsRemoteParams()); + static const never_destroyed memoized_params; + unused(GetDrakeModelsRemoteParams); +// GetDrakeModelsRemoteParams()); // For drake_models (i.e., https://github.com/RobotLocomotion/models), the // location where we find the data will vary. If we have Bazel runfiles with diff --git a/tools/workspace/drake_models/repository.bzl b/tools/workspace/drake_models/repository.bzl index d9590728877e..986152e8eb22 100644 --- a/tools/workspace/drake_models/repository.bzl +++ b/tools/workspace/drake_models/repository.bzl @@ -5,6 +5,7 @@ def drake_models_repository( mirrors = None): github_archive( name = name, + local_repository_override = "/Users/russt/tmp/models", repository = "RobotLocomotion/models", commit = "611246c443152946e9dcc901b4f956d89a439a61", sha256 = "66ad3b0f85b2aaa823d2e69cdaa980af9c0414cdb829b8224fbaa8a2dc083a7c", # noqa