# -*- python -*-

load(
    "//tools:drake.bzl",
    "drake_cc_binary",
    "drake_cc_googletest",
    "drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

package(
    default_visibility = [
        "//examples/kuka_iiwa_arm/dev:__subpackages__",
    ],
)

drake_cc_library(
    name = "pick_and_place_simulation_helpers",
    srcs = [
        "pick_and_place_simulation_helpers.cc",
    ],
    hdrs = [
        "pick_and_place_simulation_helpers.h",
    ],
    visibility = ["//visibility:public"],
    deps = [
        "//attic/multibody/rigid_body_plant",
        "//examples/kuka_iiwa_arm/iiwa_world:iiwa_wsg_diagram_factory",
        "//examples/kuka_iiwa_arm/pick_and_place:pick_and_place_configuration",  # noqa
        "//manipulation/schunk_wsg:schunk_wsg_controller",
        "//manipulation/util:frame_pose_tracker",
        "//manipulation/util:world_sim_tree_builder",
        "//systems/framework:diagram_builder",
        "//systems/sensors:optitrack_sender",
        "@optitrack_driver//lcmtypes:optitrack_lcmtypes",
    ],
)

drake_cc_library(
    name = "lcm_plant",
    srcs = [
        "lcm_plant.cc",
    ],
    hdrs = [
        "lcm_plant.h",
    ],
    data = [
        "//examples/kuka_iiwa_arm:models",
        "//manipulation/models/iiwa_description:models",
        "//manipulation/models/wsg_50_description:models",
    ],
    deps = [
        ":pick_and_place_simulation_helpers",
        "//attic/multibody/rigid_body_plant",
        "//examples/kuka_iiwa_arm:iiwa_lcm",
        "//examples/kuka_iiwa_arm/pick_and_place:pick_and_place_configuration",  # noqa
        "//systems/framework:diagram_builder",
    ],
)

drake_cc_library(
    name = "lcm_planner",
    srcs = [
        "lcm_planner.cc",
        "state_machine_system.cc",
    ],
    hdrs = [
        "lcm_planner.h",
        "state_machine_system.h",
    ],
    data = [
        "//examples/kuka_iiwa_arm:models",
        "//manipulation/models/iiwa_description:models",
    ],
    deps = [
        "//common:find_resource",
        "//common:text_logging_gflags",
        "//examples/kuka_iiwa_arm:iiwa_common",
        "//examples/kuka_iiwa_arm:iiwa_lcm",
        "//examples/kuka_iiwa_arm/pick_and_place",
        "//lcm",
        "//lcmtypes:iiwa",
        "//lcmtypes:schunk",
        "//manipulation/perception:optitrack_pose_extractor",
        "//systems/framework:leaf_system",
        "//systems/lcm:lcm_pubsub_system",
        "//systems/primitives:pass_through",
        "@gflags",
        "@lcmtypes_bot2_core",
        "@lcmtypes_robotlocomotion",
    ],
)

drake_cc_binary(
    name = "pick_and_place_demo",
    srcs = [
        "pick_and_place_demo.cc",
    ],
    deps = [
        "//common:find_resource",
        "//examples/kuka_iiwa_arm:iiwa_common",
        "//examples/kuka_iiwa_arm:iiwa_lcm",
        "//examples/kuka_iiwa_arm/pick_and_place",
        "//manipulation/util:bot_core_lcm_encode_decode",
    ],
)

drake_cc_binary(
    name = "lcm_pick_and_place_planner",
    srcs = ["lcm_pick_and_place_planner.cc"],
    data = [
        "//examples/kuka_iiwa_arm:models",
        "//examples/kuka_iiwa_arm/pick_and_place:configuration",
        "//manipulation/models/iiwa_description:models",
    ],
    deps = [
        "//common:find_resource",
        "//common:text_logging_gflags",
        "//common/proto:protobuf",
        "//examples/kuka_iiwa_arm:iiwa_common",
        "//examples/kuka_iiwa_arm:iiwa_lcm",
        "//examples/kuka_iiwa_arm/dev/pick_and_place:lcm_planner",
        "//examples/kuka_iiwa_arm/pick_and_place:pick_and_place_configuration_parsing",  # noqa
        "//lcm",
        "//lcmtypes:iiwa",
        "//lcmtypes:schunk",
        "//manipulation/perception:optitrack_pose_extractor",
        "//systems/framework:leaf_system",
        "//systems/lcm:lcm_driven_loop",
        "//systems/lcm:lcm_pubsub_system",
        "@gflags",
        "@lcmtypes_bot2_core",
        "@lcmtypes_robotlocomotion",
    ],
)

drake_cc_binary(
    name = "lcm_pick_and_place_simulator",
    srcs = ["lcm_pick_and_place_simulator.cc"],
    data = [
        "//examples/kuka_iiwa_arm:models",
        "//examples/kuka_iiwa_arm/pick_and_place:configuration",
        "//manipulation/models/iiwa_description:models",
        "//manipulation/models/wsg_50_description:models",
    ],
    deps = [
        "//attic/multibody/rigid_body_plant:contact_results_to_lcm",
        "//attic/multibody/rigid_body_plant:create_load_robot_message",
        "//common:find_resource",
        "//common:text_logging_gflags",
        "//examples/kuka_iiwa_arm:iiwa_common",
        "//examples/kuka_iiwa_arm:iiwa_lcm",
        "//examples/kuka_iiwa_arm/dev/pick_and_place:lcm_plant",
        "//examples/kuka_iiwa_arm/iiwa_world:iiwa_wsg_diagram_factory",
        "//examples/kuka_iiwa_arm/pick_and_place:pick_and_place_configuration_parsing",  # noqa
        "//lcm",
        "//lcmtypes:iiwa",
        "//lcmtypes:viewer",
        "//manipulation/planner:robot_plan_interpolator",
        "//manipulation/schunk_wsg:schunk_wsg_controller",
        "//manipulation/util:world_sim_tree_builder",
        "//systems/analysis:simulator",
        "@gflags",
        "@lcmtypes_bot2_core",
        "@optitrack_driver//lcmtypes:optitrack_lcmtypes",
    ],
)

add_lint_tests()
