From 74c72f604777e7f0f4b2bbbe0fc7c0c2182ad3e0 Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Tue, 4 Feb 2020 13:44:02 -0500 Subject: [PATCH] attic: Deprecate manipulation/util (#12679) This includes robot_state_msg_translator, sim_diagram_builder, and world_sim_tree_builder. --- attic/manipulation/util/BUILD.bazel | 5 +++++ attic/manipulation/util/README.md | 3 ++- .../util/robot_state_msg_translator.h | 5 ++++- attic/manipulation/util/sim_diagram_builder.h | 5 ++++- .../util/world_sim_tree_builder.h | 19 ++++++++++++++++--- examples/allegro_hand/BUILD.bazel | 1 - .../allegro_hand/test/allegro_lcm_test.cc | 1 - examples/kuka_iiwa_arm/kuka_simulation.cc | 7 +++++++ examples/kuka_iiwa_arm/test/iiwa_lcm_test.cc | 7 +++++++ 9 files changed, 45 insertions(+), 8 deletions(-) diff --git a/attic/manipulation/util/BUILD.bazel b/attic/manipulation/util/BUILD.bazel index 73a03fd2845b..bec7fac90907 100644 --- a/attic/manipulation/util/BUILD.bazel +++ b/attic/manipulation/util/BUILD.bazel @@ -24,6 +24,7 @@ drake_cc_library( name = "world_sim_tree_builder", srcs = ["world_sim_tree_builder.cc"], hdrs = ["world_sim_tree_builder.h"], + copts = ["-Wno-deprecated-declarations"], deps = [ "//attic/multibody:rigid_body_tree", "//attic/multibody:rigid_body_tree_construction", @@ -38,6 +39,7 @@ drake_cc_library( name = "robot_state_msg_translator", srcs = ["robot_state_msg_translator.cc"], hdrs = ["robot_state_msg_translator.h"], + copts = ["-Wno-deprecated-declarations"], deps = [ "//attic/multibody:rigid_body_tree", "//attic/util", @@ -50,6 +52,7 @@ drake_cc_library( name = "sim_diagram_builder", srcs = ["sim_diagram_builder.cc"], hdrs = ["sim_diagram_builder.h"], + copts = ["-Wno-deprecated-declarations"], deps = [ "//attic/multibody/rigid_body_plant", "//attic/multibody/rigid_body_plant:drake_visualizer", @@ -64,6 +67,7 @@ drake_cc_googletest( name = "robot_state_msg_translator_test", # TODO(siyuan): we should eventually move the models for test outside of # /examples. + copts = ["-Wno-deprecated-declarations"], data = [ "//manipulation/models/iiwa_description:models", "//manipulation/models/wsg_50_description:models", @@ -80,6 +84,7 @@ drake_cc_googletest( drake_cc_googletest( name = "sim_diagram_builder_test", + copts = ["-Wno-deprecated-declarations"], data = [ "//examples/kuka_iiwa_arm:models", "//manipulation/models/iiwa_description:models", diff --git a/attic/manipulation/util/README.md b/attic/manipulation/util/README.md index 6daed17cf12f..99881067f6a9 100644 --- a/attic/manipulation/util/README.md +++ b/attic/manipulation/util/README.md @@ -1 +1,2 @@ -All code in this drake/attic/manipulation/util folder will soon be deprecated. +All code in this drake/attic/manipulation/util folder is deprecated and will be +removed from Drake on 2020-05-01. diff --git a/attic/manipulation/util/robot_state_msg_translator.h b/attic/manipulation/util/robot_state_msg_translator.h index f21f35c795d4..55b213f4a8c6 100644 --- a/attic/manipulation/util/robot_state_msg_translator.h +++ b/attic/manipulation/util/robot_state_msg_translator.h @@ -6,6 +6,7 @@ #include "bot_core/robot_state_t.hpp" +#include "drake/common/drake_deprecated.h" #include "drake/multibody/rigid_body_tree.h" namespace drake { @@ -39,7 +40,9 @@ namespace manipulation { * comprehensive information, and the individual subscribers can pay attention * to whatever subset of interest using reduced models. */ -class RobotStateLcmMessageTranslator { +class DRAKE_DEPRECATED("2020-05-01", + "The attic/manipulation/util package is being removed.") +RobotStateLcmMessageTranslator { public: DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(RobotStateLcmMessageTranslator) diff --git a/attic/manipulation/util/sim_diagram_builder.h b/attic/manipulation/util/sim_diagram_builder.h index a768f20bf275..51b34c2c8f41 100644 --- a/attic/manipulation/util/sim_diagram_builder.h +++ b/attic/manipulation/util/sim_diagram_builder.h @@ -5,6 +5,7 @@ #include #include "drake/common/drake_copyable.h" +#include "drake/common/drake_deprecated.h" #include "drake/multibody/rigid_body_plant/drake_visualizer.h" #include "drake/multibody/rigid_body_plant/rigid_body_plant.h" #include "drake/systems/controllers/state_feedback_controller_interface.h" @@ -23,7 +24,9 @@ namespace util { * Access to a mutable DiagramBuilder is provided by get_mutable_builder(). */ template -class SimDiagramBuilder { +class DRAKE_DEPRECATED("2020-05-01", + "The attic/manipulation/util package is being removed.") +SimDiagramBuilder { public: DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(SimDiagramBuilder) diff --git a/attic/manipulation/util/world_sim_tree_builder.h b/attic/manipulation/util/world_sim_tree_builder.h index 7656aa2eb971..f18288ceed96 100644 --- a/attic/manipulation/util/world_sim_tree_builder.h +++ b/attic/manipulation/util/world_sim_tree_builder.h @@ -5,6 +5,7 @@ #include #include +#include "drake/common/drake_deprecated.h" #include "drake/multibody/rigid_body_plant/compliant_contact_model.h" #include "drake/multibody/rigid_body_tree.h" @@ -13,7 +14,9 @@ namespace manipulation { namespace util { template -struct ModelInstanceInfo { +struct DRAKE_DEPRECATED("2020-05-01", + "The attic/manipulation/util package is being removed.") +ModelInstanceInfo { std::string absolute_model_path; int instance_id; std::shared_ptr> world_offset; @@ -30,7 +33,9 @@ struct ModelInstanceInfo { /// - double /// template -class WorldSimTreeBuilder { +class DRAKE_DEPRECATED("2020-05-01", + "The attic/manipulation/util package is being removed.") +WorldSimTreeBuilder { public: /// Constructs a WorldSimTreeBuilder object and specifies whether a call to /// any of the add model instance functions should compile the tree. @@ -122,9 +127,11 @@ class WorldSimTreeBuilder { /// Adds a flat terrain to the simulation. void AddGround(); - // We are neither copyable nor moveable. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" WorldSimTreeBuilder(const WorldSimTreeBuilder& other) = delete; WorldSimTreeBuilder& operator=(const WorldSimTreeBuilder& other) = delete; +#pragma GCC diagnostic pop /// Adds a model to the internal model database. Models are /// described by @p model_name coupled with URDF/SDF paths in @p @@ -179,9 +186,12 @@ class WorldSimTreeBuilder { return rigid_body_tree_.get(); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" ModelInstanceInfo get_model_info_for_instance(int id) { return instance_id_to_model_info_.at(id); } +#pragma GCC diagnostic pop /// The compliant contact model parameters to use with the default material /// parameters; these values should be passed to the plant. @@ -204,7 +214,10 @@ class WorldSimTreeBuilder { // loaded into the simulation. std::map model_map_; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" std::map> instance_id_to_model_info_; +#pragma GCC diagnostic pop // The default parameters for evaluating contact: the parameters for the // model as well as the contact materials of the collision elements. diff --git a/examples/allegro_hand/BUILD.bazel b/examples/allegro_hand/BUILD.bazel index de67d2be0115..e7cf7f225b84 100644 --- a/examples/allegro_hand/BUILD.bazel +++ b/examples/allegro_hand/BUILD.bazel @@ -61,7 +61,6 @@ drake_cc_googletest( deps = [ ":allegro_common", ":allegro_lcm", - "//attic/manipulation/util:world_sim_tree_builder", "//common/test_utilities:eigen_matrix_compare", "//systems/framework", ], diff --git a/examples/allegro_hand/test/allegro_lcm_test.cc b/examples/allegro_hand/test/allegro_lcm_test.cc index 2a9bfcfc4a26..fa56b1b02489 100644 --- a/examples/allegro_hand/test/allegro_lcm_test.cc +++ b/examples/allegro_hand/test/allegro_lcm_test.cc @@ -7,7 +7,6 @@ #include "drake/examples/allegro_hand/allegro_common.h" #include "drake/lcmt_allegro_command.hpp" #include "drake/lcmt_allegro_status.hpp" -#include "drake/manipulation/util/world_sim_tree_builder.h" #include "drake/systems/framework/context.h" namespace drake { diff --git a/examples/kuka_iiwa_arm/kuka_simulation.cc b/examples/kuka_iiwa_arm/kuka_simulation.cc index 784b66ffbbcf..061a170d8396 100644 --- a/examples/kuka_iiwa_arm/kuka_simulation.cc +++ b/examples/kuka_iiwa_arm/kuka_simulation.cc @@ -62,7 +62,14 @@ using systems::controllers::rbt::InverseDynamicsController; using systems::controllers::StateFeedbackControllerInterface; int DoMain() { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + // N.B. If SimDiagramBuilder reaches its deprecation date of 2020-05-01 prior + // to kuka_simulation being rewritten, then instead of completely removing + // the SimDiagramBuilder, we should instead mark it private, remove it from + // the installation, but keep using it here. SimDiagramBuilder builder; +#pragma GCC diagnostic pop systems::DiagramBuilder* base_builder = builder.get_mutable_builder(); // Adds a plant. diff --git a/examples/kuka_iiwa_arm/test/iiwa_lcm_test.cc b/examples/kuka_iiwa_arm/test/iiwa_lcm_test.cc index 975aa609fda2..528c07166f22 100644 --- a/examples/kuka_iiwa_arm/test/iiwa_lcm_test.cc +++ b/examples/kuka_iiwa_arm/test/iiwa_lcm_test.cc @@ -16,8 +16,15 @@ GTEST_TEST(IiwaLcmTest, IiwaContactResultsToExternalTorque) { const std::string kIiwaUrdf = "drake/manipulation/models/iiwa_description/urdf/" "iiwa14_polytope_collision.urdf"; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + // N.B. If WorldSimTreeBuilder reaches its deprecation date of 2020-05-01 + // prior to this test being removed, then instead of completely removing the + // WorldSimTreeBuilder, we should instead mark it private, remove it from the + // installation, but keep using it here. auto tree_builder = std::make_unique>(); +#pragma GCC diagnostic pop tree_builder->StoreDrakeModel("iiwa", kIiwaUrdf); tree_builder->AddFixedModelInstance("iiwa", Vector3::Zero());