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] Delete robot descriptions that now live in drake_models #21243

Merged
merged 1 commit into from
Apr 3, 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
5 changes: 0 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ filegroup(
"//examples/quadrotor:models",
"//examples/scene_graph:models",
"//examples/simple_gripper:simple_gripper_models",
"//manipulation/models/franka_description:models",
"//manipulation/models/iiwa_description:models",
"//manipulation/models/jaco_description:models",
"//manipulation/models/ur3e:models",
"//manipulation/models/wsg_50_description:models",
"//multibody/benchmarks/acrobot:models",
"@drake_models",
],
Expand Down
14 changes: 8 additions & 6 deletions bindings/pydrake/examples/test/manipulation_station_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np

from pydrake.common import FindResourceOrThrow
from pydrake.examples import (
CreateClutterClearingYcbObjectList,
CreateManipulationClassYcbObjectList,
Expand All @@ -20,7 +19,10 @@
from pydrake.math import RigidTransform, RollPitchYaw
from pydrake.multibody.plant import MultibodyPlant
from pydrake.multibody.tree import ModelInstanceIndex
from pydrake.multibody.parsing import Parser
from pydrake.multibody.parsing import (
PackageMap,
Parser,
)
from pydrake.systems.sensors import CameraInfo


Expand Down Expand Up @@ -66,17 +68,17 @@ def test_manipulation_station_add_iiwa_and_wsg_explicitly(self):
plant = station.get_mutable_multibody_plant()

# Add models for iiwa and wsg
iiwa_model_file = FindResourceOrThrow(
"drake/manipulation/models/iiwa_description/iiwa7/"
iiwa_model_file = PackageMap().ResolveUrl(
"package://drake_models/iiwa_description/sdf/"
"iiwa7_no_collision.sdf")
(iiwa,) = parser.AddModels(iiwa_model_file)
X_WI = RigidTransform.Identity()
plant.WeldFrames(plant.world_frame(),
plant.GetFrameByName("iiwa_link_0", iiwa),
X_WI)

wsg_model_file = FindResourceOrThrow(
"drake/manipulation/models/wsg_50_description/sdf/"
wsg_model_file = PackageMap().ResolveUrl(
"package://drake_models/wsg_50_description/sdf/"
"schunk_wsg_50.sdf")
(wsg,) = parser.AddModels(wsg_model_file)
X_7G = RigidTransform.Identity()
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/manipulation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ drake_pybind_library(
drake_py_unittest(
name = "kuka_iiwa_test",
data = [
"//manipulation/models/iiwa_description:models",
"//manipulation/util:test_directives",
"@drake_models//:iiwa_description",
],
deps = [
":manipulation",
Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/manipulation/test/kuka_iiwa_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def make_builder_plant_controller_plant(self):
plant.Finalize()
controller_plant = MultibodyPlant(1.)
parser = Parser(controller_plant)
parser.AddModels(FindResourceOrThrow(
"drake/manipulation/models/iiwa_description/iiwa7/"
"iiwa7_no_collision.sdf"))
parser.AddModels(url=(
"package://drake_models/iiwa_description/sdf/"
+ "iiwa7_no_collision.sdf"))
controller_plant.WeldFrames(
controller_plant.world_frame(),
controller_plant.GetFrameByName("iiwa_link_0"), RigidTransform())
Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/multibody/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ drake_jupyter_py_binary(
name = "examples/jupyter_widgets_examples",
add_test_rule = 1,
data = [
"//manipulation/models/iiwa_description:models",
"@drake_models//:iiwa_description",
],
deps = [
":jupyter_widgets_py",
Expand Down Expand Up @@ -427,11 +427,11 @@ drake_py_unittest(
data = [
":models",
"//examples/acrobot:models",
"//manipulation/models/iiwa_description:models",
"//manipulation/models/wsg_50_description:models",
"//multibody:models",
"//multibody/benchmarks/acrobot:models",
"//multibody/benchmarks/free_body:models",
"@drake_models//:iiwa_description",
"@drake_models//:wsg_50_description",
],
deps = [
":benchmarks_py",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"plant = MultibodyPlant(time_step=0.0)\n",
"plant.RegisterAsSourceForSceneGraph(scene_graph)\n",
"Parser(plant, scene_graph).AddModelsFromUrl(\n",
" url=\"package://drake/manipulation/models/iiwa_description/iiwa7/iiwa7_no_collision.sdf\")\n",
" url=\"package://drake_models/iiwa_description/sdf/iiwa7_no_collision.sdf\")\n",
"plant.Finalize()\n",
"\n",
"# Add sliders to set positions of the joints.\n",
Expand Down Expand Up @@ -101,7 +101,7 @@
"builder = DiagramBuilder()\n",
"plant, scene_graph = AddMultibodyPlantSceneGraph(builder, time_step=0.0)\n",
"Parser(plant).AddModelsFromUrl(\n",
" url=\"package://drake/manipulation/models/iiwa_description/iiwa7/iiwa7_no_collision.sdf\")\n",
" url=\"package://drake_models/iiwa_description/sdf/iiwa7_no_collision.sdf\")\n",
"plant.Finalize()\n",
"\n",
"viz = DrakeVisualizer.AddToBuilder(builder, scene_graph)\n",
Expand Down
8 changes: 4 additions & 4 deletions bindings/pydrake/multibody/test/optimization_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ def test_gridpoints(self):

def test_all_constraints(self):
plant = MultibodyPlant(0)
file_path = FindResourceOrThrow(
"drake/manipulation/models/iiwa_description/iiwa7/"
"iiwa7_no_collision.sdf")
iiwa_id, = Parser(plant).AddModels(file_path)
url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa7_no_collision.sdf")
iiwa_id, = Parser(plant).AddModels(url=url)
plant.WeldFrames(plant.world_frame(),
plant.GetFrameByName("iiwa_link_0", iiwa_id))
plant.Finalize()
Expand Down
60 changes: 30 additions & 30 deletions bindings/pydrake/multibody/test/plant_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,18 +1398,18 @@ def test_port_access(self, T):
# Create a MultibodyPlant with a kuka arm and a schunk gripper.
# the arm is welded to the world, the gripper is welded to the
# arm's end effector.
wsg50_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
wsg50_sdf_url = (
"package://drake_models/"
"wsg_50_description/sdf/schunk_wsg_50.sdf")
iiwa_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
iiwa_sdf_url = (
"package://drake_models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")

# N.B. `Parser` only supports `MultibodyPlant_[float]`.
plant_f = MultibodyPlant_[float](time_step=2e-3)
parser = Parser(plant_f)
iiwa_model, = parser.AddModels(file_name=iiwa_sdf_path)
gripper_model, = parser.AddModels(file_name=wsg50_sdf_path)
iiwa_model, = parser.AddModels(url=iiwa_sdf_url)
gripper_model, = parser.AddModels(url=wsg50_sdf_url)
plant_f.Finalize()
plant = to_type(plant_f, T)
models = [iiwa_model, gripper_model]
Expand Down Expand Up @@ -1558,19 +1558,19 @@ def test_model_instance_state_access(self, T):
RigidTransform = RigidTransform_[T]
RollPitchYaw = RollPitchYaw_[T]

wsg50_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"wsg_50_description/sdf/schunk_wsg_50.sdf")
iiwa_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")
wsg50_sdf_url = (
"package://drake_models/wsg_50_description/sdf/"
+ "schunk_wsg_50.sdf")
iiwa_sdf_url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")

# N.B. `Parser` only supports `MultibodyPlant_[float]`.
plant_f = MultibodyPlant_[float](0.0)
parser = Parser(plant_f)

iiwa_model, = parser.AddModels(file_name=iiwa_sdf_path)
gripper_model, = parser.AddModels(file_name=wsg50_sdf_path)
iiwa_model, = parser.AddModels(url=iiwa_sdf_url)
gripper_model, = parser.AddModels(url=wsg50_sdf_url)

# Weld the base of arm and gripper to reduce the number of states.
X_EeGripper = RigidTransform_[float](
Expand Down Expand Up @@ -1704,20 +1704,20 @@ def test_model_instance_state_access_by_array(self, T):
# Create a MultibodyPlant with a kuka arm and a schunk gripper.
# the arm is welded to the world, the gripper is welded to the
# arm's end effector.
wsg50_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
wsg50_sdf_url = (
"package://drake_models/"
"wsg_50_description/sdf/schunk_wsg_50.sdf")
iiwa_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
iiwa_sdf_url = (
"package://drake_models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")

time_step = 0.0002
# N.B. `Parser` only supports `MultibodyPlant_[float]`.
plant_f = MultibodyPlant_[float](time_step)
parser = Parser(plant_f)

iiwa_model, = parser.AddModels(file_name=iiwa_sdf_path)
gripper_model, = parser.AddModels(file_name=wsg50_sdf_path)
iiwa_model, = parser.AddModels(url=iiwa_sdf_url)
gripper_model, = parser.AddModels(url=wsg50_sdf_url)

# Weld the base of arm and gripper to reduce the number of states.
X_EeGripper = RigidTransform_[float](
Expand Down Expand Up @@ -1813,12 +1813,12 @@ def test_map_qdot_to_v_and_back(self, T):
RollPitchYaw = RollPitchYaw_[T]
# N.B. `Parser` only supports `MultibodyPlant_[float]`.
plant_f = MultibodyPlant_[float](0.0)
iiwa_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")
iiwa_sdf_url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")
# Use floating base to effectively add a quaternion in the generalized
# quaternion.
iiwa_model, = Parser(plant_f).AddModels(iiwa_sdf_path)
iiwa_model, = Parser(plant_f).AddModels(url=iiwa_sdf_url)
plant_f.Finalize()
plant = to_type(plant_f, T)
context = plant.CreateDefaultContext()
Expand Down Expand Up @@ -2325,13 +2325,13 @@ def loop_body(make_joint, time_step):
loop_body(make_joint, 0.001)

def test_actuation_matrix(self):
iiwa_sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")
iiwa_sdf_url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")

plant = MultibodyPlant_[float](0.0)
parser = Parser(plant)
iiwa_model, = parser.AddModels(file_name=iiwa_sdf_path)
iiwa_model, = parser.AddModels(url=iiwa_sdf_url)
plant.WeldFrames(
frame_on_parent_F=plant.world_frame(),
frame_on_child_M=plant.GetFrameByName("iiwa_link_0", iiwa_model))
Expand Down Expand Up @@ -2481,7 +2481,7 @@ def test_coupler_constraint_api(self):
plant.set_discrete_contact_approximation(
DiscreteContactApproximation.kSap)
Parser(plant).AddModelsFromUrl(
"package://drake/manipulation/models/"
"package://drake_models/"
"wsg_50_description/sdf/schunk_wsg_50.sdf")

# Add coupler constraint.
Expand Down Expand Up @@ -2558,7 +2558,7 @@ def test_constraint_active_status_api(self):
body_A=body_A, X_AP=X_AP, body_B=body_B, X_BQ=X_BQ)

Parser(plant).AddModelsFromUrl(
"package://drake/manipulation/models/"
"package://drake_models/"
"wsg_50_description/sdf/schunk_wsg_50.sdf")

# Add coupler constraint.
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/planning/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ drake_py_unittest(
drake_py_unittest(
name = "robot_diagram_test",
data = [
"//manipulation/models/iiwa_description:models",
"@drake_models//:iiwa_description",
],
deps = [
":planning",
Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/planning/test/robot_diagram_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def test_robot_diagram_builder(self, T):
Class = mut.RobotDiagramBuilder_[T]
dut = Class(time_step=0.0)
if T == float:
dut.parser().AddModels(FindResourceOrThrow(
"drake/manipulation/models/iiwa_description/urdf/"
"iiwa14_spheres_dense_collision.urdf"))
dut.parser().AddModels(url=(
"package://drake_models/iiwa_description/urdf/"
+ "iiwa14_spheres_dense_collision.urdf"))
else:
# TODO(jwnimmer-tri) Use dut.plant() to manually add some
# models, bodies, and geometries here.
Expand Down
4 changes: 2 additions & 2 deletions bindings/pydrake/systems/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ drake_py_unittest(
drake_py_unittest(
name = "controllers_test",
data = [
"//manipulation/models/iiwa_description:models",
"@drake_models//:iiwa_description",
],
deps = [
":controllers_py",
Expand Down Expand Up @@ -473,7 +473,7 @@ drake_py_unittest(
name = "planar_scenegraph_visualizer_test",
data = [
"//examples/multibody/cart_pole:models",
"//manipulation/models/iiwa_description:models",
"@drake_models//:iiwa_description",
],
deps = [
":analysis_py",
Expand Down
24 changes: 12 additions & 12 deletions bindings/pydrake/systems/test/controllers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ def cost_to_go_function(state, parameters):
self.assertAlmostEqual(J[0], 1., delta=1e-6)

def test_joint_stiffness_controller(self):
sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")
url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")

plant = MultibodyPlant(time_step=0.01)
Parser(plant).AddModels(sdf_path)
Parser(plant).AddModels(url=url)
plant.WeldFrames(plant.world_frame(),
plant.GetFrameByName("iiwa_link_0"))
plant.Finalize()
Expand All @@ -130,12 +130,12 @@ def test_joint_stiffness_controller(self):
self.assertIsInstance(controller.get_multibody_plant(), MultibodyPlant)

def test_inverse_dynamics(self):
sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")
url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")

plant = MultibodyPlant(time_step=0.01)
Parser(plant).AddModels(sdf_path)
Parser(plant).AddModels(url=url)
plant.WeldFrames(plant.world_frame(),
plant.GetFrameByName("iiwa_link_0"))
plant.Finalize()
Expand All @@ -159,12 +159,12 @@ def test_inverse_dynamics(self):
self.assertTrue(controller.is_pure_gravity_compensation())

def test_inverse_dynamics_controller(self):
sdf_path = FindResourceOrThrow(
"drake/manipulation/models/"
"iiwa_description/sdf/iiwa14_no_collision.sdf")
url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")

plant = MultibodyPlant(time_step=0.01)
Parser(plant).AddModels(sdf_path)
Parser(plant).AddModels(url=url)
plant.WeldFrames(plant.world_frame(),
plant.GetFrameByName("iiwa_link_0"))
plant.mutable_gravity_field().set_gravity_vector([0.0, 0.0, 0.0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def test_cart_pole(self):

def test_kuka(self):
"""Kuka IIWA with mesh geometry."""
file_name = FindResourceOrThrow(
"drake/manipulation/models/iiwa_description/sdf/"
"iiwa14_no_collision.sdf")
url = (
"package://drake_models/iiwa_description/sdf/"
+ "iiwa14_no_collision.sdf")
builder = DiagramBuilder()
kuka, scene_graph = AddMultibodyPlantSceneGraph(builder, 0.0)
Parser(plant=kuka).AddModels(file_name)
Parser(plant=kuka).AddModels(url=url)
kuka.Finalize()

# Make sure that the frames to visualize exist.
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 @@ -191,7 +191,7 @@ def test_viewer_applet_plain_meshes(self):
"""Checks _ViewerApplet support for untextured meshes.
"""
self._check_viewer_applet_on_model(
"drake/manipulation/models/iiwa_description/urdf/"
"drake_models/iiwa_description/urdf/"
"iiwa14_no_collision.urdf")

def test_viewer_applet_textured_meshes(self):
Expand Down
Loading