# -*- python -*-
# This file contains rules for Bazel; see drake/doc/bazel.rst.

load(
    "//tools:drake.bzl",
    "drake_cc_binary",
    "drake_cc_googletest",
    "drake_cc_library",
)
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:test_tags.bzl", "gurobi_test_tags")

drake_cc_library(
    name = "quasistatic_system",
    srcs = [
        "quasistatic_system.cc",
    ],
    hdrs = [
        "quasistatic_system.h",
    ],
    deps = [
        "//math:geometric_transform",
        "//multibody:kinematics_cache",
        "//multibody:rigid_body_tree",
        "//solvers:mathematical_program",
        "//systems/controllers:control_util",
        "//systems/framework:leaf_system",
    ],
)

drake_cc_library(
    name = "remote_tree_viewer_wrapper",
    srcs = [
        "remote_tree_viewer_wrapper.cc",
    ],
    hdrs = [
        "remote_tree_viewer_wrapper.h",
    ],
    visibility = ["//visibility:public"],
    deps = [
        "//lcm",
        "//lcmtypes:viewer2_comms",
        "//multibody:rigid_body_tree",
        "@json",
    ],
)

drake_cc_googletest(
    name = "rod2d_time_stepping",
    data = [":models"],
    tags = gurobi_test_tags(),
    deps = [
        ":quasistatic_system",
        "//attic/multibody/joints",
        "//attic/multibody/parsers",
        "//attic/multibody/rigid_body_plant:drake_visualizer",
        "//common",
        "//common:find_resource",
        "//lcm",
        "//manipulation/util:world_sim_tree_builder",
        "//multibody:rigid_body_tree",
        "//systems/analysis:simulator",
        "//systems/framework:diagram",
        "//systems/primitives:constant_vector_source",
        "//systems/primitives:matrix_gain",
        "//systems/primitives:signal_logger",
    ],
)

drake_cc_binary(
    name = "remote_tree_viewer_wrapper_demo",
    srcs = ["test/remote_tree_viewer_wrapper_demo.cc"],
    data = [
        "//examples/atlas:models",
    ],
    deps = [
        ":remote_tree_viewer_wrapper",
        "//attic/multibody/parsers",
        "//common:find_resource",
    ],
)

drake_cc_binary(
    name = "quasistatic_iiwa_pick_and_place_demo",
    testonly = 1,
    srcs = ["quasistatic_iiwa_pick_and_place_demo.cc"],
    data = [
        ":double_dumbbell_for_pick_up.sdf",
        ":dumbbell_for_pick_up.sdf",
        ":models",
        "//examples/kuka_iiwa_arm:models",
        "//manipulation/models/iiwa_description:models",
    ],
    deps = [
        ":quasistatic_system",
        "//common:find_resource",
        "//common/test_utilities:eigen_matrix_compare",
        "//common/trajectories:piecewise_polynomial",
        "//examples/kuka_iiwa_arm:iiwa_common",
        "//lcm",
        "//manipulation/util:sim_diagram_builder",
        "//manipulation/util:world_sim_tree_builder",
        "//math:geometric_transform",
        "//multibody:inverse_kinematics",
        "//systems/analysis",
        "//systems/controllers:pid_controller",
        "//systems/primitives:demultiplexer",
        "//systems/primitives:matrix_gain",
        "//systems/primitives:multiplexer",
        "//systems/primitives:signal_logger",
        "//systems/primitives:trajectory_source",
        "@lcmtypes_bot2_core",
        "@lcmtypes_robotlocomotion",
    ],
)

install_data()

add_lint_tests()
