blob: 6c162e66d0e9986fcd2170a8dbcaa3a163387614 [file] [log] [blame]
Austin Schuh55a13dc2019-01-27 22:39:03 -08001package(default_visibility = ["//visibility:public"])
Brian Silverman8c374e02015-09-06 23:02:21 -04002
Austin Schuh55a13dc2019-01-27 22:39:03 -08003load("//aos/build:queues.bzl", "queue_library")
Brian Silverman8c374e02015-09-06 23:02:21 -04004
Brian Silverman8c374e02015-09-06 23:02:21 -04005queue_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -08006 name = "claw_queue",
7 srcs = [
8 "claw.q",
9 ],
10 deps = [
11 "//aos/controls:control_loop_queues",
12 "//frc971/control_loops:queues",
13 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040014)
15
Austin Schuhedc317c2015-11-08 14:07:42 -080016genrule(
Austin Schuh55a13dc2019-01-27 22:39:03 -080017 name = "genrule_claw",
18 outs = [
19 "claw_motor_plant.h",
20 "claw_motor_plant.cc",
21 ],
22 cmd = "$(location //y2014/control_loops/python:claw) $(OUTS)",
23 tools = [
24 "//y2014/control_loops/python:claw",
25 ],
26 visibility = ["//visibility:private"],
Austin Schuhedc317c2015-11-08 14:07:42 -080027)
28
Brian Silverman8c374e02015-09-06 23:02:21 -040029cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080030 name = "claw_lib",
31 srcs = [
32 "claw.cc",
33 "claw_motor_plant.cc",
34 ],
35 hdrs = [
36 "claw.h",
37 "claw_motor_plant.h",
38 ],
39 linkopts = [
40 "-lm",
41 ],
42 deps = [
43 ":claw_queue",
44 "//aos:math",
45 "//aos/controls:control_loop",
46 "//aos/controls:polytope",
47 "//aos/logging:matrix_logging",
48 "//aos/logging:queue_logging",
49 "//frc971/control_loops:coerce_goal",
50 "//frc971/control_loops:hall_effect_tracker",
51 "//frc971/control_loops:state_feedback_loop",
52 "//y2014:constants",
53 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040054)
55
Brian Silverman100534c2015-09-07 15:51:23 -040056cc_test(
Austin Schuh55a13dc2019-01-27 22:39:03 -080057 name = "claw_lib_test",
58 srcs = [
59 "claw_lib_test.cc",
60 ],
61 deps = [
62 ":claw_lib",
63 ":claw_queue",
64 "//aos/controls:control_loop_test",
65 "//aos/testing:googletest",
66 "//frc971/control_loops:state_feedback_loop",
67 "//frc971/control_loops:team_number_test_environment",
68 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040069)
70
71cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -080072 name = "claw",
73 srcs = [
74 "claw_main.cc",
75 ],
76 deps = [
77 ":claw_lib",
78 "//aos:init",
79 "//aos/events:shm-event-loop",
80 ],
Brian Silverman8c374e02015-09-06 23:02:21 -040081)