# -*- python -*-

load(
    "@drake//tools/skylark:drake_cc.bzl",
    "drake_cc_binary",
    "drake_cc_googletest",
    "drake_cc_library",
    "drake_cc_package_library",
)
load("//tools/skylark:test_tags.bzl", "gurobi_test_tags")
load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])

drake_cc_package_library(
    name = "plan_eval",
    deps = [
        ":generic_plan",
        ":manipulator_move_end_effector_plan",
        ":plan_eval_base_system",
    ],
)

drake_cc_library(
    name = "generic_plan",
    srcs = [
        "generic_plan.cc",
    ],
    hdrs = [
        "generic_plan.h",
    ],
    deps = [
        "//manipulation/util:trajectory_utils",
        "//multibody:rigid_body_tree_alias_groups",
        "//systems/controllers:setpoint",
        "//systems/controllers/qp_inverse_dynamics:control",
        "//systems/controllers/qp_inverse_dynamics:param_parser",
        "//systems/framework:value",
    ],
)

drake_cc_library(
    name = "manipulator_move_end_effector_plan",
    srcs = [
        "manipulator_move_end_effector_plan.cc",
    ],
    hdrs = [
        "manipulator_move_end_effector_plan.h",
    ],
    deps = [
        ":generic_plan",
        "//lcmtypes:manipulator_plan_move_end_effector",
        "//manipulation/util:bot_core_lcm_encode_decode",
    ],
)

drake_cc_library(
    name = "test_common",
    testonly = 1,
    hdrs = [
        "test/test_common.h",
    ],
    deps = [
        "//multibody:rigid_body_tree_alias_groups",
        "//systems/controllers/qp_inverse_dynamics:param_parser",
    ],
)

drake_cc_library(
    name = "plan_eval_base_system",
    srcs = ["plan_eval_base_system.cc"],
    hdrs = ["plan_eval_base_system.h"],
    deps = [
        "//multibody:rigid_body_tree_alias_groups",
        "//systems/controllers:setpoint",
        "//systems/controllers/qp_inverse_dynamics:param_parser",
        "//systems/framework:leaf_system",
    ],
)

# === test/ ===

drake_cc_googletest(
    name = "generic_plan_test",
    data = [
        "//manipulation/models/iiwa_description:models",
        "//systems/controllers/qp_inverse_dynamics:test/iiwa.alias_groups",  # noqa
        "//systems/controllers/qp_inverse_dynamics:test/iiwa.id_controller_config",  # noqa
    ],
    deps = [
        ":generic_plan",
        ":test_common",
        "//attic/multibody/parsers",
        "//common:find_resource",
        "//common/test_utilities:eigen_matrix_compare",
        "//multibody:rigid_body_tree",
    ],
)

drake_cc_googletest(
    name = "manipulator_plan_test",
    data = [
        "//manipulation/models/iiwa_description:models",
        "//systems/controllers/qp_inverse_dynamics:test/iiwa.alias_groups",  # noqa
        "//systems/controllers/qp_inverse_dynamics:test/iiwa.id_controller_config",  # noqa
    ],
    deps = [
        ":manipulator_move_end_effector_plan",
        ":test_common",
        "//attic/multibody/parsers",
        "//common:find_resource",
        "//common/test_utilities:eigen_matrix_compare",
        "//multibody:rigid_body_tree",
    ],
)

add_lint_tests()
