diff --git a/automotive/BUILD.bazel b/automotive/BUILD.bazel index 9f60713aa02b..85c502a28996 100644 --- a/automotive/BUILD.bazel +++ b/automotive/BUILD.bazel @@ -448,7 +448,7 @@ drake_cc_library( "//multibody/parsers", "//multibody/rigid_body_plant:drake_visualizer", "//systems/analysis", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/lcm:lcmt_drake_signal_translator", "//systems/primitives:constant_value_source", "//systems/primitives:multiplexer", diff --git a/examples/contact_model/BUILD.bazel b/examples/contact_model/BUILD.bazel index 3a65fc161021..6ec23c04bd30 100644 --- a/examples/contact_model/BUILD.bazel +++ b/examples/contact_model/BUILD.bazel @@ -77,7 +77,7 @@ drake_cc_binary( "//multibody/rigid_body_plant:drake_visualizer", "//multibody/rigid_body_plant:rigid_body_plant_bridge", "//systems/analysis", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/rendering:pose_bundle_to_draw_message", "@gflags", ], diff --git a/examples/geometry_world/BUILD.bazel b/examples/geometry_world/BUILD.bazel index 8088cf3e47ce..d82b13495073 100644 --- a/examples/geometry_world/BUILD.bazel +++ b/examples/geometry_world/BUILD.bazel @@ -38,7 +38,7 @@ drake_cc_binary( "//geometry:scene_graph", "//systems/analysis:simulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:constant_vector_source", "//systems/primitives:signal_logger", "//systems/rendering:pose_bundle_to_draw_message", @@ -68,7 +68,7 @@ drake_cc_binary( "//geometry:scene_graph", "//systems/analysis:simulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:constant_vector_source", "//systems/primitives:signal_logger", "//systems/rendering:pose_bundle_to_draw_message", diff --git a/examples/humanoid_controller/BUILD.bazel b/examples/humanoid_controller/BUILD.bazel index 2568d9dba48d..f1cdffa2a16b 100644 --- a/examples/humanoid_controller/BUILD.bazel +++ b/examples/humanoid_controller/BUILD.bazel @@ -83,7 +83,7 @@ drake_cc_library( "//multibody/parsers", "//systems/controllers/qp_inverse_dynamics:qp_inverse_dynamics_system", # noqa "//systems/framework", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "@lcmtypes_bot2_core", ], ) diff --git a/examples/kinova_jaco_arm/BUILD.bazel b/examples/kinova_jaco_arm/BUILD.bazel index 3d98c5fa82a6..3a0bb65f543c 100644 --- a/examples/kinova_jaco_arm/BUILD.bazel +++ b/examples/kinova_jaco_arm/BUILD.bazel @@ -49,8 +49,8 @@ drake_cc_binary( "//lcm", "//manipulation/planner:robot_plan_interpolator", "//systems/controllers:pid_controller", - "//systems/lcm", "//systems/lcm:lcm_driven_loop", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:adder", "//systems/primitives:demultiplexer", "//systems/primitives:multiplexer", diff --git a/examples/kuka_iiwa_arm/dev/pick_and_place/BUILD.bazel b/examples/kuka_iiwa_arm/dev/pick_and_place/BUILD.bazel index 373a7f8f4201..bbe415ac2dd9 100644 --- a/examples/kuka_iiwa_arm/dev/pick_and_place/BUILD.bazel +++ b/examples/kuka_iiwa_arm/dev/pick_and_place/BUILD.bazel @@ -84,7 +84,7 @@ drake_cc_library( "//lcmtypes:schunk", "//manipulation/perception:optitrack_pose_extractor", "//systems/framework:leaf_system", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:pass_through", "@gflags", "@lcmtypes_bot2_core", @@ -127,8 +127,8 @@ drake_cc_binary( "//lcmtypes:schunk", "//manipulation/perception:optitrack_pose_extractor", "//systems/framework:leaf_system", - "//systems/lcm", "//systems/lcm:lcm_driven_loop", + "//systems/lcm:lcm_pubsub_system", "@gflags", "@lcmtypes_bot2_core", "@lcmtypes_robotlocomotion", diff --git a/examples/multibody/acrobot/BUILD.bazel b/examples/multibody/acrobot/BUILD.bazel index b1a2d760d385..1401f215ae94 100644 --- a/examples/multibody/acrobot/BUILD.bazel +++ b/examples/multibody/acrobot/BUILD.bazel @@ -26,7 +26,7 @@ drake_cc_binary( "//systems/analysis:semi_explicit_euler_integrator", "//systems/analysis:simulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:constant_vector_source", "//systems/rendering:pose_bundle_to_draw_message", "@gflags", @@ -48,7 +48,7 @@ drake_cc_binary( "//systems/analysis:simulator", "//systems/controllers:linear_quadratic_regulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:affine_system", "//systems/rendering:pose_bundle_to_draw_message", "@gflags", diff --git a/examples/multibody/bouncing_ball/BUILD.bazel b/examples/multibody/bouncing_ball/BUILD.bazel index ade5df266817..b1e688c3a825 100644 --- a/examples/multibody/bouncing_ball/BUILD.bazel +++ b/examples/multibody/bouncing_ball/BUILD.bazel @@ -44,7 +44,7 @@ drake_cc_binary( "//systems/analysis:semi_explicit_euler_integrator", "//systems/analysis:simulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/rendering:pose_bundle_to_draw_message", "@gflags", ], diff --git a/examples/multibody/inclined_plane/BUILD.bazel b/examples/multibody/inclined_plane/BUILD.bazel index b35638e0bd40..752204e632e7 100644 --- a/examples/multibody/inclined_plane/BUILD.bazel +++ b/examples/multibody/inclined_plane/BUILD.bazel @@ -23,7 +23,7 @@ drake_cc_binary( "//multibody/benchmarks/inclined_plane:make_inclined_plane_plant", "//systems/analysis:simulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/rendering:pose_bundle_to_draw_message", "@gflags", ], diff --git a/examples/multibody/pendulum/BUILD.bazel b/examples/multibody/pendulum/BUILD.bazel index 5b27b379e92a..31698c8d0353 100644 --- a/examples/multibody/pendulum/BUILD.bazel +++ b/examples/multibody/pendulum/BUILD.bazel @@ -22,7 +22,7 @@ drake_cc_binary( "//systems/analysis:semi_explicit_euler_integrator", "//systems/analysis:simulator", "//systems/framework:diagram", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:constant_vector_source", "//systems/rendering:pose_bundle_to_draw_message", "@gflags", diff --git a/examples/rod2d/BUILD.bazel b/examples/rod2d/BUILD.bazel index c49ac68be6b4..cb0b6a3d42d9 100644 --- a/examples/rod2d/BUILD.bazel +++ b/examples/rod2d/BUILD.bazel @@ -32,7 +32,7 @@ drake_cc_binary( "//lcmtypes:viewer", "//systems/analysis", "//systems/framework", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/rendering:drake_visualizer_client", "//systems/rendering:pose_aggregator", "//systems/rendering:pose_bundle_to_draw_message", diff --git a/examples/schunk_wsg/BUILD.bazel b/examples/schunk_wsg/BUILD.bazel index 5980382dbdc9..ccf81c253897 100644 --- a/examples/schunk_wsg/BUILD.bazel +++ b/examples/schunk_wsg/BUILD.bazel @@ -40,7 +40,7 @@ drake_cc_binary( "//multibody/rigid_body_plant:drake_visualizer", "//systems/analysis:simulator", "//systems/framework", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "@gflags", ], ) diff --git a/examples/valkyrie/BUILD.bazel b/examples/valkyrie/BUILD.bazel index fdaaeae983f4..a0495393115c 100644 --- a/examples/valkyrie/BUILD.bazel +++ b/examples/valkyrie/BUILD.bazel @@ -73,7 +73,7 @@ drake_cc_binary( "//multibody/parsers", "//systems/framework:diagram", "//systems/framework:leaf_system", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//util", "@lcmtypes_bot2_core", ], @@ -110,7 +110,7 @@ drake_cc_library( "//multibody/rigid_body_plant:drake_visualizer", "//systems/analysis", "//systems/framework", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/lcm:lcmt_drake_signal_translator", "//systems/primitives:constant_vector_source", "//systems/primitives:pass_through", diff --git a/lcm/BUILD.bazel b/lcm/BUILD.bazel index 0b0755b79fe7..ecdac9a09e91 100644 --- a/lcm/BUILD.bazel +++ b/lcm/BUILD.bazel @@ -1,11 +1,27 @@ # -*- python -*- -load("//tools:drake.bzl", "drake_cc_googletest", "drake_cc_library") +load( + "@drake//tools/skylark:drake_cc.bzl", + "drake_cc_googletest", + "drake_cc_library", + "drake_cc_package_library", +) load("//tools/skylark:drake_py.bzl", "drake_py_test") load("//tools/lint:lint.bzl", "add_lint_tests") package(default_visibility = ["//visibility:public"]) +drake_cc_package_library( + name = "lcm", + deps = [ + ":interface", + ":lcm_log", + ":mock", + ":real", + ":translator_base", + ], +) + drake_cc_library( name = "interface", hdrs = [ @@ -27,7 +43,7 @@ drake_cc_library( ) drake_cc_library( - name = "lcm", + name = "real", srcs = [ "drake_lcm.cc", "lcm_receive_thread.cc", @@ -96,8 +112,8 @@ drake_cc_googletest( # Flaky because LCM self-test can fail (PR #7311) flaky = 1, deps = [ - ":lcm", ":lcmt_drake_signal_utils", + ":real", ], ) @@ -131,8 +147,4 @@ drake_py_test( deps = ["@lcm//:lcm-python"], ) -add_lint_tests( - # We need to more seriously refactor and deprecate some names here before - # we can start following package_library conventions. - enable_library_lint = False, -) +add_lint_tests() diff --git a/multibody/rigid_body_plant/BUILD.bazel b/multibody/rigid_body_plant/BUILD.bazel index 41dd3529d2b2..6de2da1cf482 100644 --- a/multibody/rigid_body_plant/BUILD.bazel +++ b/multibody/rigid_body_plant/BUILD.bazel @@ -130,7 +130,7 @@ drake_cc_library( "//common/trajectories:piecewise_polynomial", "//lcmtypes:viewer", "//multibody:rigid_body_tree", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/primitives:signal_log", "//systems/rendering:drake_visualizer_client", ], @@ -143,7 +143,7 @@ drake_cc_library( deps = [ "//lcmtypes:viewer", "//multibody:rigid_body_tree", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", ], ) diff --git a/systems/lcm/BUILD.bazel b/systems/lcm/BUILD.bazel index fe7afdb31a62..01dca84f4272 100644 --- a/systems/lcm/BUILD.bazel +++ b/systems/lcm/BUILD.bazel @@ -1,10 +1,27 @@ # -*- python -*- -load("//tools:drake.bzl", "drake_cc_googletest", "drake_cc_library") +load( + "@drake//tools/skylark:drake_cc.bzl", + "drake_cc_googletest", + "drake_cc_library", + "drake_cc_package_library", +) load("//tools/lint:lint.bzl", "add_lint_tests") package(default_visibility = ["//visibility:public"]) +drake_cc_package_library( + name = "lcm", + deps = [ + ":lcm_driven_loop", + ":lcm_log_playback_system", + ":lcm_pubsub_system", + ":lcmt_drake_signal_translator", + ":translator", + ":translator_system", + ], +) + drake_cc_library( name = "translator", srcs = [ @@ -33,7 +50,7 @@ drake_cc_library( ) drake_cc_library( - name = "lcm", + name = "lcm_pubsub_system", srcs = [ "lcm_publisher_system.cc", "lcm_subscriber_system.cc", @@ -60,7 +77,7 @@ drake_cc_library( "lcm_log_playback_system.h", ], deps = [ - ":lcm", + ":lcm_pubsub_system", "//lcm:lcm_log", "//systems/framework", ], @@ -75,7 +92,7 @@ drake_cc_library( "lcm_driven_loop.h", ], deps = [ - ":lcm", + ":lcm_pubsub_system", "//lcm", "//systems/analysis", ], @@ -115,7 +132,7 @@ drake_cc_googletest( drake_cc_googletest( name = "lcm_publisher_system_test", deps = [ - ":lcm", + ":lcm_pubsub_system", ":lcmt_drake_signal_translator", "//lcm:lcmt_drake_signal_utils", "//lcm:mock", @@ -135,7 +152,7 @@ drake_cc_googletest( drake_cc_googletest( name = "lcm_subscriber_system_test", deps = [ - ":lcm", + ":lcm_pubsub_system", ":lcmt_drake_signal_translator", "//lcm:lcmt_drake_signal_utils", "//lcm:mock", @@ -156,7 +173,7 @@ drake_cc_googletest( drake_cc_googletest( name = "serializer_test", deps = [ - ":lcm", + ":lcm_pubsub_system", ":lcmt_drake_signal_translator", "//lcm:lcmt_drake_signal_utils", "//lcm:mock", @@ -171,8 +188,4 @@ drake_cc_googletest( ], ) -add_lint_tests( - # We need to more seriously refactor and deprecate some names here before - # we can start following package_library conventions. - enable_library_lint = False, -) +add_lint_tests() diff --git a/systems/sensors/BUILD.bazel b/systems/sensors/BUILD.bazel index 31349e4fbeb9..05f99b977d43 100644 --- a/systems/sensors/BUILD.bazel +++ b/systems/sensors/BUILD.bazel @@ -256,7 +256,7 @@ drake_cc_binary( "//multibody/rigid_body_plant", "//multibody/rigid_body_plant:drake_visualizer", "//systems/analysis:simulator", - "//systems/lcm", + "//systems/lcm:lcm_pubsub_system", "//systems/rendering:pose_stamped_t_pose_vector_translator", "@gflags", ], diff --git a/tools/install/libdrake/build_components.bzl b/tools/install/libdrake/build_components.bzl index 1d6631fbde15..2ce55a0f4724 100644 --- a/tools/install/libdrake/build_components.bzl +++ b/tools/install/libdrake/build_components.bzl @@ -115,6 +115,7 @@ LIBDRAKE_COMPONENTS = [ "//lcm:lcm", "//lcm:lcm_log", "//lcm:mock", + "//lcm:real", "//lcm:translator_base", "//manipulation/perception:optitrack_pose_extractor", "//manipulation/perception:perception", @@ -332,6 +333,7 @@ LIBDRAKE_COMPONENTS = [ "//systems/lcm:lcm", "//systems/lcm:lcm_driven_loop", "//systems/lcm:lcm_log_playback_system", + "//systems/lcm:lcm_pubsub_system", "//systems/lcm:lcmt_drake_signal_translator", "//systems/lcm:translator", "//systems/lcm:translator_system", @@ -394,6 +396,5 @@ LIBDRAKE_COMPONENTS = [ "//systems/trajectory_optimization:multiple_shooting", "//systems/trajectory_optimization:position_constraint_force_evaluator", "//systems/trajectory_optimization:trajectory_optimization", - "//util:lcm_util", "//util:util", ] diff --git a/util/BUILD.bazel b/util/BUILD.bazel index c5e5f246d028..fed9d1f87057 100644 --- a/util/BUILD.bazel +++ b/util/BUILD.bazel @@ -34,20 +34,6 @@ drake_cc_library( ], ) -# TODO(jwnimmer-tri) Remove this forwarding header sometime after 2018-05-01. -drake_cc_library( - name = "lcm_util", - hdrs = ["lcmUtil.h"], - tags = [ - # Don't add this library into the ":util" package library, since its a - # deprecated forwarding convenience and should not be used in batch. - "exclude_from_package", - ], - deps = [ - "//manipulation/util:bot_core_lcm_encode_decode", - ], -) - # === test/ === drake_cc_googletest( diff --git a/util/lcmUtil.h b/util/lcmUtil.h deleted file mode 100644 index 5ba29858b691..000000000000 --- a/util/lcmUtil.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#warning This header path is deprecated; please use the new one shown below. - -#include "drake/manipulation/util/bot_core_lcm_encode_decode.h"