# -*- python -*-

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

package(
    default_visibility = [":__subpackages__"],
)

drake_cc_library(
    name = "manipulator_move_joint_plan_eval_system",
    srcs = ["manipulator_move_joint_plan_eval_system.cc"],
    hdrs = ["manipulator_move_joint_plan_eval_system.h"],
    deps = [
        "//lcmtypes:plan_eval_debug_info",
        "//systems/controllers/plan_eval:plan_eval_base_system",
    ],
)

drake_cc_library(
    name = "manipulator_joint_space_controller",
    srcs = ["manipulator_joint_space_controller.cc"],
    hdrs = ["manipulator_joint_space_controller.h"],
    deps = [
        ":manipulator_move_joint_plan_eval_system",
        "//attic/multibody/parsers",
        "//systems/controllers:state_feedback_controller_interface",
        "//systems/controllers/qp_inverse_dynamics:qp_inverse_dynamics_system",  # noqa
        "//systems/controllers/qp_inverse_dynamics:qp_output_translator_system",  # noqa
        "//systems/controllers/qp_inverse_dynamics:robot_kinematic_state_translator_system",  # noqa
        "//systems/framework",
    ],
)

# === test/ ===

drake_cc_googletest(
    name = "manipulator_joint_space_controller_test",
    srcs = ["test/manipulator_joint_space_controller_test.cc"],
    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
    ],
    tags = gurobi_test_tags(),
    deps = [
        ":manipulator_joint_space_controller",
        "//attic/multibody/parsers",
        "//common:find_resource",
        "//common/test_utilities:eigen_matrix_compare",
        "//systems/analysis:simulator",
        "//systems/controllers:inverse_dynamics_controller",
        "//systems/framework",
        "//systems/primitives:constant_vector_source",
    ],
)

add_lint_tests()
