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

[models] Move ycb models into drake_models package #21190

Merged
merged 1 commit into from
Mar 25, 2024
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
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
22 changes: 11 additions & 11 deletions bindings/pydrake/examples/_examples_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion bindings/pydrake/systems/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/systems/jupyter_widgets_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions bindings/pydrake/test/parse_models_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/visualization/test/meldis_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/manipulation_station/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
8 changes: 7 additions & 1 deletion examples/manipulation_station/manipulation_station.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ template <typename T>
void ManipulationStation<T>::AddManipulandFromFile(
const std::string& model_file, const RigidTransform<double>& X_WObject) {
multibody::Parser parser(plant_);
const auto models = parser.AddModels(FindResourceOrThrow(model_file));
std::vector<multibody::ModelInstanceIndex> 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);
Expand Down
2 changes: 1 addition & 1 deletion examples/manipulation_station/mock_station_simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>(math::RollPitchYaw<double>(-1.57, 0, 3),
Eigen::Vector3d(-0.3, -0.55, 0.36)));
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/manipulation_station/proof_of_life.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>(RollPitchYaw<double>(-1.57, 0, 3),
Eigen::Vector3d(-0.3, -0.55, 0.36)));
} else if (FLAGS_setup == "manipulation_class") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,15 @@ 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<double>::Identity());

// Check that the cracker box was added.
EXPECT_EQ(station.get_multibody_plant().num_model_instances(),
num_base_instances + 1);

station.AddManipulandFromFile(
"drake/manipulation/models/ycb/sdf/004_sugar_box.sdf",
"drake_models/ycb/004_sugar_box.sdf",
math::RigidTransform<double>::Identity());

// Check that the sugar box was added.
Expand Down
2 changes: 1 addition & 1 deletion geometry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion geometry/render_gltf_client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion geometry/render_gltf_client/test/example_scene.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@

<!-- Add a YCB mustard bottle. -->
<include>
<uri>package://drake/manipulation/models/ycb/sdf/006_mustard_bottle.sdf</uri>
<uri>package://drake_models/ycb/006_mustard_bottle.sdf</uri>
<name>mustard_bottle</name>
<pose>0 0 0 0 0 0</pose>
</include>
Expand Down
1 change: 0 additions & 1 deletion manipulation/models/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)

Expand Down
62 changes: 0 additions & 62 deletions manipulation/models/ycb/BUILD.bazel

This file was deleted.

8 changes: 0 additions & 8 deletions manipulation/models/ycb/README.md

This file was deleted.

Loading