blob: c7bfdc0816a89b263820f113c1f049176dd8b5fc [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Neil Balchd5206fe2018-01-24 20:25:12 -08002
Philipp Schradercc016b32021-12-30 08:59:58 -08003package(default_visibility = ["//visibility:public"])
4
James Kuszmaulf01da392023-12-14 11:22:14 -08005static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -07006 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 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080010 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080011 deps = [
12 "//frc971/control_loops:control_loops_fbs",
13 ],
Neil Balchd5206fe2018-01-24 20:25:12 -080014)
15
James Kuszmaulf01da392023-12-14 11:22:14 -080016static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070017 name = "superstructure_position_fbs",
18 srcs = [
19 "superstructure_position.fbs",
20 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080021 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080022 deps = [
23 "//frc971/control_loops:control_loops_fbs",
24 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070025)
26
James Kuszmaulf01da392023-12-14 11:22:14 -080027static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070028 name = "superstructure_status_fbs",
29 srcs = [
30 "superstructure_status.fbs",
31 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080032 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080033 deps = [
34 "//frc971/control_loops:control_loops_fbs",
35 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070036)
37
James Kuszmaulf01da392023-12-14 11:22:14 -080038static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070039 name = "superstructure_output_fbs",
40 srcs = [
41 "superstructure_output.fbs",
42 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080043 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070044)
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 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080054 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis8d20ca82018-02-19 13:17:45 -080055 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070056 ":superstructure_goal_fbs",
57 ":superstructure_output_fbs",
58 ":superstructure_position_fbs",
59 ":superstructure_status_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070061 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070062 "//frc971/control_loops:control_loops_fbs",
63 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080064 "//y2018:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 "//y2018:status_light_fbs",
Austin Schuhcb091712018-02-21 20:01:55 -080066 "//y2018/control_loops/superstructure/arm",
Sabina Davis8d20ca82018-02-19 13:17:45 -080067 "//y2018/control_loops/superstructure/intake",
Alex Perrycb7da4b2019-08-28 19:35:56 -070068 "//y2018/vision:vision_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080069 ],
70)
71
72cc_test(
73 name = "superstructure_lib_test",
Austin Schuhe40ea512019-02-09 21:54:25 -080074 timeout = "long",
Sabina Davis8d20ca82018-02-19 13:17:45 -080075 srcs = [
76 "superstructure_lib_test.cc",
77 ],
Austin Schuhc5fa6d92022-02-25 14:36:28 -080078 data = ["//y2018:aos_config"],
Austin Schuh9fe68f72019-08-10 19:32:03 -070079 shard_count = 5,
Philipp Schraderdada1072020-11-24 11:34:46 -080080 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis8d20ca82018-02-19 13:17:45 -080081 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 ":superstructure_goal_fbs",
Sabina Davis8d20ca82018-02-19 13:17:45 -080083 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 ":superstructure_output_fbs",
85 ":superstructure_position_fbs",
86 ":superstructure_status_fbs",
John Park33858a32018-09-28 23:05:48 -070087 "//aos:math",
Sabina Davis8d20ca82018-02-19 13:17:45 -080088 "//aos/testing:googletest",
Austin Schuhe40ea512019-02-09 21:54:25 -080089 "//aos/time",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070090 "//frc971/control_loops:control_loop_test",
Sabina Davis8d20ca82018-02-19 13:17:45 -080091 "//frc971/control_loops:position_sensor_sim",
92 "//frc971/control_loops:team_number_test_environment",
Maxwell Henderson8f0e07f2023-02-08 21:10:58 -080093 "//y2018/control_loops/superstructure/arm:arm_constants",
Sabina Davis8d20ca82018-02-19 13:17:45 -080094 "//y2018/control_loops/superstructure/intake:intake_plants",
95 ],
96)
97
98cc_binary(
99 name = "superstructure",
100 srcs = [
101 "superstructure_main.cc",
102 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800103 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis8d20ca82018-02-19 13:17:45 -0800104 deps = [
105 ":superstructure_lib",
John Park398c74a2018-10-20 21:17:39 -0700106 "//aos:init",
Sabina Davis8d20ca82018-02-19 13:17:45 -0800107 ],
108)
Neil Balch6040a352018-03-04 16:02:56 -0800109
110cc_library(
111 name = "debouncer",
Neil Balch6040a352018-03-04 16:02:56 -0800112 srcs = [
113 "debouncer.cc",
114 ],
Austin Schuhe40ea512019-02-09 21:54:25 -0800115 hdrs = [
116 "debouncer.h",
117 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800118 target_compatible_with = ["@platforms//os:linux"],
Neil Balch6040a352018-03-04 16:02:56 -0800119)
120
121cc_test(
122 name = "debouncer_test",
123 srcs = [
124 "debouncer_test.cc",
125 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800126 target_compatible_with = ["@platforms//os:linux"],
Neil Balch6040a352018-03-04 16:02:56 -0800127 deps = [
128 ":debouncer",
129 "//aos/testing:googletest",
130 ],
131)