blob: db01298b012e2304d049c885e75341fa62d1a249 [file] [log] [blame]
Sabina Davis8d20ca82018-02-19 13:17:45 -08001package(default_visibility = ["//visibility:public"])
Neil Balchd5206fe2018-01-24 20:25:12 -08002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Neil Balchd5206fe2018-01-24 20:25:12 -08004
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 name = "superstructure_goal_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -08007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "superstructure_goal.fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -08009 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 gen_reflections = 1,
11 includes = [
12 "//frc971/control_loops:control_loops_fbs_includes",
Sabina Davis8d20ca82018-02-19 13:17:45 -080013 ],
Neil Balchd5206fe2018-01-24 20:25:12 -080014)
15
Alex Perrycb7da4b2019-08-28 19:35:56 -070016flatbuffer_cc_library(
17 name = "superstructure_position_fbs",
18 srcs = [
19 "superstructure_position.fbs",
20 ],
21 gen_reflections = 1,
22 includes = [
23 "//frc971/control_loops:control_loops_fbs_includes",
24 ],
25)
26
27flatbuffer_cc_library(
28 name = "superstructure_status_fbs",
29 srcs = [
30 "superstructure_status.fbs",
31 ],
32 gen_reflections = 1,
33 includes = [
34 "//frc971/control_loops:control_loops_fbs_includes",
35 ],
36)
37
38flatbuffer_cc_library(
39 name = "superstructure_output_fbs",
40 srcs = [
41 "superstructure_output.fbs",
42 ],
43 gen_reflections = 1,
44)
45
Sabina Davis8d20ca82018-02-19 13:17:45 -080046cc_library(
47 name = "superstructure_lib",
48 srcs = [
49 "superstructure.cc",
50 ],
51 hdrs = [
52 "superstructure.h",
53 ],
54 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070055 ":superstructure_goal_fbs",
56 ":superstructure_output_fbs",
57 ":superstructure_position_fbs",
58 ":superstructure_status_fbs",
John Park33858a32018-09-28 23:05:48 -070059 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 "//aos/events:event_loop",
61 "//frc971/control_loops:control_loops_fbs",
62 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080063 "//y2018:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -070064 "//y2018:status_light_fbs",
Austin Schuhcb091712018-02-21 20:01:55 -080065 "//y2018/control_loops/superstructure/arm",
Sabina Davis8d20ca82018-02-19 13:17:45 -080066 "//y2018/control_loops/superstructure/intake",
Alex Perrycb7da4b2019-08-28 19:35:56 -070067 "//y2018/vision:vision_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080068 ],
69)
70
71cc_test(
72 name = "superstructure_lib_test",
Austin Schuhe40ea512019-02-09 21:54:25 -080073 timeout = "long",
Sabina Davis8d20ca82018-02-19 13:17:45 -080074 srcs = [
75 "superstructure_lib_test.cc",
76 ],
Austin Schuh14d7d3d2020-09-10 18:14:36 -070077 data = ["//y2018:config"],
Austin Schuh9fe68f72019-08-10 19:32:03 -070078 shard_count = 5,
Sabina Davis8d20ca82018-02-19 13:17:45 -080079 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070080 ":superstructure_goal_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080081 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 ":superstructure_output_fbs",
83 ":superstructure_position_fbs",
84 ":superstructure_status_fbs",
John Park33858a32018-09-28 23:05:48 -070085 "//aos:math",
John Park33858a32018-09-28 23:05:48 -070086 "//aos/controls:control_loop_test",
Sabina Davis8d20ca82018-02-19 13:17:45 -080087 "//aos/testing:googletest",
Austin Schuhe40ea512019-02-09 21:54:25 -080088 "//aos/time",
Sabina Davis8d20ca82018-02-19 13:17:45 -080089 "//frc971/control_loops:position_sensor_sim",
90 "//frc971/control_loops:team_number_test_environment",
91 "//y2018/control_loops/superstructure/intake:intake_plants",
92 ],
93)
94
95cc_binary(
96 name = "superstructure",
97 srcs = [
98 "superstructure_main.cc",
99 ],
100 deps = [
101 ":superstructure_lib",
John Park398c74a2018-10-20 21:17:39 -0700102 "//aos:init",
Sabina Davis8d20ca82018-02-19 13:17:45 -0800103 ],
104)
Neil Balch6040a352018-03-04 16:02:56 -0800105
106cc_library(
107 name = "debouncer",
Neil Balch6040a352018-03-04 16:02:56 -0800108 srcs = [
109 "debouncer.cc",
110 ],
Austin Schuhe40ea512019-02-09 21:54:25 -0800111 hdrs = [
112 "debouncer.h",
113 ],
Neil Balch6040a352018-03-04 16:02:56 -0800114)
115
116cc_test(
117 name = "debouncer_test",
118 srcs = [
119 "debouncer_test.cc",
120 ],
121 deps = [
122 ":debouncer",
123 "//aos/testing:googletest",
124 ],
125)