Skip to content

Commit

Permalink
Update lcm-related bazel library names
Browse files Browse the repository at this point in the history
Remove //util:lcm_util forwarding header, long since deprecated.

Rename //lcm:lcm to //lcm:real to clarify that it is only a concrete
implementation of the interface, instead of everything in the package.
Do not rename in-tree uses to match; they can use the package-level
library without adding overly many spurious dependencies.

Rename //systems/lcm:lcm to //systems/lcm:lcm_pubsub to clarify that it
is only the publisher and subscriber systems, instead of everything in
the package.  Rename all in-tree uses to match.

Add drake_cc_package_library for //lcm and //systems/lcm.
  • Loading branch information
jwnimmer-tri committed May 1, 2018
1 parent af78e3e commit 622d593
Show file tree
Hide file tree
Showing 20 changed files with 67 additions and 60 deletions.
2 changes: 1 addition & 1 deletion automotive/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/contact_model/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
4 changes: 2 additions & 2 deletions examples/geometry_world/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/humanoid_controller/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Expand Down
2 changes: 1 addition & 1 deletion examples/kinova_jaco_arm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/kuka_iiwa_arm/dev/pick_and_place/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/multibody/acrobot/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/bouncing_ball/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/inclined_plane/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/pendulum/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/rod2d/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/schunk_wsg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Expand Down
4 changes: 2 additions & 2 deletions examples/valkyrie/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down Expand Up @@ -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",
Expand Down
28 changes: 20 additions & 8 deletions lcm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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 = [
Expand All @@ -27,7 +43,7 @@ drake_cc_library(
)

drake_cc_library(
name = "lcm",
name = "real",
srcs = [
"drake_lcm.cc",
"lcm_receive_thread.cc",
Expand Down Expand Up @@ -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",
],
)

Expand Down Expand Up @@ -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()
4 changes: 2 additions & 2 deletions multibody/rigid_body_plant/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand All @@ -143,7 +143,7 @@ drake_cc_library(
deps = [
"//lcmtypes:viewer",
"//multibody:rigid_body_tree",
"//systems/lcm",
"//systems/lcm:lcm_pubsub_system",
],
)

Expand Down
37 changes: 25 additions & 12 deletions systems/lcm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down Expand Up @@ -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",
Expand All @@ -60,7 +77,7 @@ drake_cc_library(
"lcm_log_playback_system.h",
],
deps = [
":lcm",
":lcm_pubsub_system",
"//lcm:lcm_log",
"//systems/framework",
],
Expand All @@ -75,7 +92,7 @@ drake_cc_library(
"lcm_driven_loop.h",
],
deps = [
":lcm",
":lcm_pubsub_system",
"//lcm",
"//systems/analysis",
],
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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()
2 changes: 1 addition & 1 deletion systems/sensors/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
3 changes: 2 additions & 1 deletion tools/install/libdrake/build_components.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
]
14 changes: 0 additions & 14 deletions util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 0 additions & 5 deletions util/lcmUtil.h

This file was deleted.

0 comments on commit 622d593

Please sign in to comment.