Skip to content

Commit

Permalink
Remove deprecated code 2025-01 (RobotLocomotion#22368)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnimmer-tri authored Jan 1, 2025
1 parent 7464c13 commit c0f66f6
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 246 deletions.
1 change: 0 additions & 1 deletion bindings/pydrake/systems/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ drake_pybind_library(
"//bindings/pydrake:documentation_pybind",
"//bindings/pydrake/common:cpp_template_pybind",
"//bindings/pydrake/common:default_scalars_pybind",
"//bindings/pydrake/common:deprecation_pybind",
"//bindings/pydrake/common:eigen_pybind",
"//bindings/pydrake/common:serialize_pybind",
"//bindings/pydrake/common:type_pack",
Expand Down
28 changes: 0 additions & 28 deletions bindings/pydrake/systems/sensors_py_rgbd.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "drake/bindings/pydrake/common/deprecation_pybind.h"
#include "drake/bindings/pydrake/documentation_pybind.h"
#include "drake/bindings/pydrake/systems/sensors_py.h"
#include "drake/systems/sensors/camera_info.h"
Expand Down Expand Up @@ -136,33 +135,6 @@ void DefineSensorsRgbd(py::module m) {
.def("SetParentFrameId", &RgbdSensor::SetParentFrameId,
py::arg("context"), py::arg("id"),
doc.RgbdSensor.SetParentFrameId.doc);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
rgbd_sensor
.def("parent_frame_id",
WrapDeprecated(doc.RgbdSensor.parent_frame_id.doc_deprecated,
&RgbdSensor::parent_frame_id),
doc.RgbdSensor.parent_frame_id.doc_deprecated)
.def("X_PB",
WrapDeprecated(doc.RgbdSensor.X_PB.doc_deprecated, &RgbdSensor::X_PB),
doc.RgbdSensor.X_PB.doc_deprecated)
.def("X_BC",
WrapDeprecated(doc.RgbdSensor.X_BC.doc_deprecated, &RgbdSensor::X_BC),
doc.RgbdSensor.X_BC.doc_deprecated)
.def("X_BD",
WrapDeprecated(doc.RgbdSensor.X_BD.doc_deprecated, &RgbdSensor::X_BD),
doc.RgbdSensor.X_BD.doc_deprecated)
.def("color_camera_info",
WrapDeprecated(doc.RgbdSensor.color_camera_info.doc_deprecated,
&RgbdSensor::color_camera_info),
py_rvp::reference_internal,
doc.RgbdSensor.color_camera_info.doc_deprecated)
.def("depth_camera_info",
WrapDeprecated(doc.RgbdSensor.depth_camera_info.doc_deprecated,
&RgbdSensor::depth_camera_info),
py_rvp::reference_internal,
doc.RgbdSensor.depth_camera_info.doc_deprecated);
#pragma GCC diagnostic pop
def_camera_ports(&rgbd_sensor, doc.RgbdSensor);

py::class_<RgbdSensorDiscrete, Diagram<double>> rgbd_camera_discrete(
Expand Down
13 changes: 0 additions & 13 deletions bindings/pydrake/systems/test/sensors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import numpy as np
from pydrake.common import FindResourceOrThrow
from pydrake.common.test_utilities import numpy_compare
from pydrake.common.test_utilities.deprecation import catch_drake_warnings
from pydrake.common.test_utilities.pickle_compare import assert_pickle
from pydrake.common.value import AbstractValue, Value
from pydrake.geometry import (
Expand Down Expand Up @@ -474,18 +473,6 @@ def check_info(camera_info):
self.assertEqual(sensor.default_parent_frame_id(), parent_id)
sensor.set_default_parent_frame_id(parent_id)

with catch_drake_warnings(expected_count=1):
check_info(sensor.color_camera_info())
with catch_drake_warnings(expected_count=1):
check_info(sensor.depth_camera_info())
with catch_drake_warnings(expected_count=1):
self.assertIsInstance(sensor.X_PB(), RigidTransform)
with catch_drake_warnings(expected_count=1):
self.assertIsInstance(sensor.X_BC(), RigidTransform)
with catch_drake_warnings(expected_count=1):
self.assertIsInstance(sensor.X_BD(), RigidTransform)
with catch_drake_warnings(expected_count=1):
self.assertEqual(sensor.parent_frame_id(), parent_id)
check_ports(sensor)
# Check parameter API.
context = sensor.CreateDefaultContext()
Expand Down
16 changes: 0 additions & 16 deletions geometry/proximity/obj_to_surface_mesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,6 @@ TriangleSurfaceMesh<double> ReadObjToTriangleSurfaceMesh(
return ReadObjToTriangleSurfaceMesh(MeshSource(filename), scale, on_warning);
}

TriangleSurfaceMesh<double> ReadObjToTriangleSurfaceMesh(
std::istream* input_stream, const double scale,
std::function<void(std::string_view)> on_warning,
std::string_view description) {
DRAKE_THROW_UNLESS(input_stream != nullptr);
DRAKE_THROW_UNLESS(input_stream->good());
std::stringstream content;
content << input_stream->rdbuf();

// We will either throw or return a mesh here (courtesy of ReadObj).
return ReadObjToTriangleSurfaceMesh(
InMemoryMesh{MemoryFile(std::move(content).str(), ".obj",
std::string(description))},
scale, on_warning);
}

TriangleSurfaceMesh<double> ReadObjToTriangleSurfaceMesh(
const MeshSource& mesh_source, double scale,
std::function<void(std::string_view)> on_warning) {
Expand Down
12 changes: 0 additions & 12 deletions geometry/proximity/obj_to_surface_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

#include <filesystem>
#include <functional>
#include <istream>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

#include "drake/common/diagnostic_policy.h"
#include "drake/common/drake_deprecated.h"
#include "drake/geometry/mesh_source.h"
#include "drake/geometry/proximity/triangle_surface_mesh.h"

Expand Down Expand Up @@ -49,16 +47,6 @@ TriangleSurfaceMesh<double> ReadObjToTriangleSurfaceMesh(
const std::filesystem::path& filename, double scale = 1.0,
std::function<void(std::string_view)> on_warning = {});

/** Overload of @ref ReadObjToTriangleSurfaceMesh(const std::string&, double)
with the Wavefront .obj file given in std::istream. */
DRAKE_DEPRECATED(
"2025-01-01",
"Please use ReadObjToTriangleSurfaceMesh(const MeshSource&) instead.")
TriangleSurfaceMesh<double> ReadObjToTriangleSurfaceMesh(
std::istream* input_stream, double scale = 1.0,
std::function<void(std::string_view)> on_warning = {},
std::string_view description = "from_stream");

/** Overload of @ref ReadObjToTriangleSurfaceMesh(const std::filesystem::path&,
double) with the Wavefront .obj in a Mesh shape specification. */
TriangleSurfaceMesh<double> ReadObjToTriangleSurfaceMesh(
Expand Down
14 changes: 0 additions & 14 deletions geometry/proximity/test/obj_to_surface_mesh_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,6 @@ GTEST_TEST(ObjToSurfaceMeshTest, FromPath) {
EXPECT_TRUE(surface.Equal(MeshForQuadCube()));
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
GTEST_TEST(ObjToSurfaceMeshTest, FromStream) {
const fs::path filename =
FindResourceOrThrow("drake/geometry/test/quad_cube.obj");
std::ifstream stream(filename);
DRAKE_DEMAND(stream.is_open());
const TriangleSurfaceMesh<double> surface =
ReadObjToTriangleSurfaceMesh(&stream);

EXPECT_TRUE(surface.Equal(MeshForQuadCube()));
}
#pragma GCC diagnostic pop

// Tests the MeshSource-based overload.
GTEST_TEST(ObjToSurfaceMeshTest, MeshSource) {
constexpr double kUnitScale = 1.0;
Expand Down
12 changes: 0 additions & 12 deletions manipulation/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ load(
"drake_cc_library",
"drake_cc_package_library",
)
load("//tools/skylark:drake_py.bzl", "drake_py_binary")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -117,17 +116,6 @@ drake_cc_library(
],
)

drake_py_binary(
name = "show_model",
srcs = ["show_model.py"],
deps = ["//bindings/pydrake"],
)

drake_py_binary(
name = "meshlab_to_sdf",
srcs = ["meshlab_to_sdf.py"],
)

drake_cc_binary(
name = "stl2obj",
srcs = ["stl2obj.cc"],
Expand Down
9 changes: 0 additions & 9 deletions manipulation/util/meshlab_to_sdf.py

This file was deleted.

10 changes: 0 additions & 10 deletions manipulation/util/show_model.py

This file was deleted.

2 changes: 0 additions & 2 deletions multibody/tree/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ drake_cc_library(
"fixed_offset_frame.cc",
"force_element.cc",
"frame.cc",
"frame_base.cc",
"joint.cc",
"joint_actuator.cc",
"linear_bushing_roll_pitch_yaw.cc",
Expand Down Expand Up @@ -136,7 +135,6 @@ drake_cc_library(
"fixed_offset_frame.h",
"force_element.h",
"frame.h",
"frame_base.h",
"joint.h",
"joint_actuator.h",
"linear_bushing_roll_pitch_yaw.h",
Expand Down
8 changes: 5 additions & 3 deletions multibody/tree/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "drake/common/autodiff.h"
#include "drake/common/nice_type_name.h"
#include "drake/multibody/tree/frame_base.h"
#include "drake/multibody/tree/frame_body_pose_cache.h"
#include "drake/multibody/tree/multibody_element.h"
#include "drake/multibody/tree/multibody_tree_indexes.h"
Expand Down Expand Up @@ -51,12 +50,15 @@ class RigidBody;
///
/// @tparam_default_scalar
template <typename T>
class Frame : public FrameBase<T> {
class Frame : public MultibodyElement<T> {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Frame);

~Frame() override;

/// Returns this element's unique index.
FrameIndex index() const { return this->template index_impl<FrameIndex>(); }

/// Returns a const reference to the body associated to this %Frame.
const RigidBody<T>& body() const { return body_; }

Expand Down Expand Up @@ -548,7 +550,7 @@ class Frame : public FrameBase<T> {
/// instance.
explicit Frame(const std::string& name, const RigidBody<T>& body,
std::optional<ModelInstanceIndex> model_instance = {})
: FrameBase<T>(model_instance.value_or(body.model_instance())),
: MultibodyElement<T>(model_instance.value_or(body.model_instance())),
name_(internal::DeprecateWhenEmptyName(name, "Frame")),
body_(body) {}

Expand Down
15 changes: 0 additions & 15 deletions multibody/tree/frame_base.cc

This file was deleted.

26 changes: 0 additions & 26 deletions multibody/tree/frame_base.h

This file was deleted.

32 changes: 0 additions & 32 deletions systems/sensors/rgbd_sensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,38 +218,6 @@ const OutputPort<double>& RgbdSensor::image_time_output_port() const {
return *image_time_output_port_;
}

const CameraInfo& RgbdSensor::color_camera_info() const {
return defaults_.color_camera.core().intrinsics();
}

const CameraInfo& RgbdSensor::depth_camera_info() const {
return defaults_.depth_camera.core().intrinsics();
}

const ColorRenderCamera& RgbdSensor::color_render_camera() const {
return default_color_render_camera();
}

const DepthRenderCamera& RgbdSensor::depth_render_camera() const {
return default_depth_render_camera();
}

const RigidTransformd& RgbdSensor::X_PB() const {
return default_X_PB();
}

const RigidTransformd& RgbdSensor::X_BC() const {
return defaults_.color_camera.core().sensor_pose_in_camera_body();
}

const RigidTransformd& RgbdSensor::X_BD() const {
return defaults_.depth_camera.core().sensor_pose_in_camera_body();
}

FrameId RgbdSensor::parent_frame_id() const {
return default_parent_frame_id();
}

namespace {
// If the size of `image` already matches `camera`, then does nothing.
// Otherwise, resizes the `image` to match `camera`.
Expand Down
35 changes: 0 additions & 35 deletions systems/sensors/rgbd_sensor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "drake/common/drake_copyable.h"
#include "drake/common/drake_deprecated.h"
#include "drake/geometry/geometry_ids.h"
#include "drake/geometry/query_object.h"
#include "drake/geometry/render/render_camera.h"
Expand Down Expand Up @@ -219,40 +218,6 @@ class RgbdSensor final : public LeafSystem<double> {
the current time). */
const OutputPort<double>& image_time_output_port() const;

DRAKE_DEPRECATED(
"2025-01-01",
"Use default_color_render_camera().core().intrinsics() instead.")
const CameraInfo& color_camera_info() const;

DRAKE_DEPRECATED(
"2025-01-01",
"Use default_depth_render_camera().core().intrinsics() instead.")
const CameraInfo& depth_camera_info() const;

DRAKE_DEPRECATED("2025-01-01", "Use default_color_render_camera() instead.")
const geometry::render::ColorRenderCamera& color_render_camera() const;

DRAKE_DEPRECATED("2025-01-01", "Use default_depth_render_camera() instead.")
const geometry::render::DepthRenderCamera& depth_render_camera() const;

DRAKE_DEPRECATED("2025-01-01", "Use default_X_PB() instead.")
const math::RigidTransformd& X_PB() const;

DRAKE_DEPRECATED(
"2025-01-01",
"Use default_color_render_camera().core().sensor_pose_in_camera_body() "
"instead.")
const math::RigidTransformd& X_BC() const;

DRAKE_DEPRECATED(
"2025-01-01",
"Use default_depth_render_camera().core().sensor_pose_in_camera_body() "
"instead.")
const math::RigidTransformd& X_BD() const;

DRAKE_DEPRECATED("2025-01-01", "Use default_parent_frame_id() instead.")
geometry::FrameId parent_frame_id() const;

private:
// The calculator methods for the four output ports.
void CalcColorImage(const Context<double>& context,
Expand Down
Loading

0 comments on commit c0f66f6

Please sign in to comment.