blob: c77f35df5a9f4b6afe16d4cd5baa8c2d54ac187c [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08002load("//tools/build_rules:js.bzl", "ts_project")
Austin Schuha1d006e2022-09-14 21:50:42 -07003load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Stephan Massaltd021f972020-01-05 20:41:23 -08004
Philipp Schradercc016b32021-12-30 08:59:58 -08005package(default_visibility = ["//visibility:public"])
6
James Kuszmaulf01da392023-12-14 11:22:14 -08007static_flatbuffer(
Stephan Massaltd021f972020-01-05 20:41:23 -08008 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080012 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080013 deps = [
14 "//frc971/control_loops:control_loops_fbs",
15 "//frc971/control_loops:profiled_subsystem_fbs",
16 ],
Stephan Massaltd021f972020-01-05 20:41:23 -080017)
18
James Kuszmaulf01da392023-12-14 11:22:14 -080019static_flatbuffer(
Stephan Massaltd021f972020-01-05 20:41:23 -080020 name = "superstructure_output_fbs",
21 srcs = [
22 "superstructure_output.fbs",
23 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080025)
26
James Kuszmaul5e6aa252021-08-28 22:19:29 -070027flatbuffer_ts_library(
28 name = "superstructure_status_ts_fbs",
29 srcs = [
30 "superstructure_status.fbs",
31 ],
James Kuszmaul5e6aa252021-08-28 22:19:29 -070032 target_compatible_with = ["@platforms//os:linux"],
James Kuszmauldac091f2022-03-22 09:35:06 -070033 deps = [
34 "//frc971/control_loops:control_loops_ts_fbs",
35 "//frc971/control_loops:profiled_subsystem_ts_fbs",
Maxwell Henderson34242992024-01-07 12:39:11 -080036 "//frc971/control_loops/flywheel:flywheel_controller_status_ts_fbs",
James Kuszmauldac091f2022-03-22 09:35:06 -070037 ],
James Kuszmaul5e6aa252021-08-28 22:19:29 -070038)
39
James Kuszmaulf01da392023-12-14 11:22:14 -080040static_flatbuffer(
Stephan Massaltd021f972020-01-05 20:41:23 -080041 name = "superstructure_status_fbs",
42 srcs = [
43 "superstructure_status.fbs",
44 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080045 target_compatible_with = ["@platforms//os:linux"],
Maxwell Henderson34242992024-01-07 12:39:11 -080046 deps = [
47 "//frc971/control_loops:control_loops_fbs",
48 "//frc971/control_loops:profiled_subsystem_fbs",
49 "//frc971/control_loops/flywheel:flywheel_controller_status_fbs",
50 ],
Stephan Massaltd021f972020-01-05 20:41:23 -080051)
52
James Kuszmaulf01da392023-12-14 11:22:14 -080053static_flatbuffer(
Stephan Massaltd021f972020-01-05 20:41:23 -080054 name = "superstructure_position_fbs",
55 srcs = [
56 "superstructure_position.fbs",
57 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080059 deps = [
60 "//frc971/control_loops:control_loops_fbs",
61 "//frc971/control_loops:profiled_subsystem_fbs",
62 ],
Stephan Massaltd021f972020-01-05 20:41:23 -080063)
64
65cc_library(
66 name = "superstructure_lib",
67 srcs = [
68 "superstructure.cc",
69 ],
70 hdrs = [
71 "superstructure.h",
72 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080073 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080074 deps = [
75 ":superstructure_goal_fbs",
76 ":superstructure_output_fbs",
77 ":superstructure_position_fbs",
78 ":superstructure_status_fbs",
milind-u0beb7dc2021-10-16 19:31:33 -070079 "//aos/containers:sized_array",
Stephan Massaltd021f972020-01-05 20:41:23 -080080 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070081 "//frc971/control_loops:control_loop",
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080082 "//frc971/control_loops:control_loops_fbs",
83 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulec635d22023-08-12 18:39:24 -070084 "//frc971/zeroing:absolute_and_absolute_encoder",
85 "//frc971/zeroing:absolute_encoder",
86 "//frc971/zeroing:pot_and_absolute_encoder",
Stephan Massaltd021f972020-01-05 20:41:23 -080087 "//y2020:constants",
Philipp Schrader37fdbb62021-12-18 00:30:37 -080088 "//y2020/control_loops/superstructure/hood:hood_encoder_zeroing_estimator",
Sabina Davis0f31d3f2020-02-20 20:41:00 -080089 "//y2020/control_loops/superstructure/shooter",
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080090 "//y2020/control_loops/superstructure/turret:aiming",
Stephan Massaltd021f972020-01-05 20:41:23 -080091 ],
92)
93
94cc_binary(
95 name = "superstructure",
96 srcs = [
97 "superstructure_main.cc",
98 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080099 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -0800100 deps = [
101 ":superstructure_lib",
102 "//aos:init",
103 "//aos/events:shm_event_loop",
104 ],
105)
Sabina Davis7704a652020-02-01 11:42:14 -0800106
107cc_test(
108 name = "superstructure_lib_test",
109 srcs = [
110 "superstructure_lib_test.cc",
111 ],
112 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800113 "//y2020:aos_config",
milind-u7baf7342021-08-25 18:31:26 -0700114 "@superstructure_replay",
Sabina Davis7704a652020-02-01 11:42:14 -0800115 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800116 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis7704a652020-02-01 11:42:14 -0800117 deps = [
118 ":superstructure_goal_fbs",
119 ":superstructure_lib",
120 ":superstructure_output_fbs",
121 ":superstructure_position_fbs",
122 ":superstructure_status_fbs",
123 "//aos:math",
milind-u7baf7342021-08-25 18:31:26 -0700124 "//aos/events/logging:log_reader",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800125 "//aos/events/logging:log_writer",
milind-u7baf7342021-08-25 18:31:26 -0700126 "//aos/network:team_number",
Sabina Davis7704a652020-02-01 11:42:14 -0800127 "//aos/testing:googletest",
128 "//aos/time",
129 "//frc971/control_loops:capped_test_plant",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700130 "//frc971/control_loops:control_loop_test",
Sabina Davis7704a652020-02-01 11:42:14 -0800131 "//frc971/control_loops:position_sensor_sim",
132 "//frc971/control_loops:team_number_test_environment",
133 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Maxwell Henderson34242992024-01-07 12:39:11 -0800134 "//frc971/control_loops/flywheel:flywheel_test_plant",
Sabina Davis7704a652020-02-01 11:42:14 -0800135 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davis0f2d38c2020-02-08 17:01:21 -0800136 "//y2020/control_loops/superstructure/intake:intake_plants",
Sabina Davis0f31d3f2020-02-20 20:41:00 -0800137 "//y2020/control_loops/superstructure/shooter:shooter_plants",
Sabina Davis7704a652020-02-01 11:42:14 -0800138 ],
139)
John Park0a245a02020-02-02 14:10:15 -0800140
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800141ts_project(
James Kuszmaul78101402021-09-11 12:42:21 -0700142 name = "turret_plotter",
143 srcs = ["turret_plotter.ts"],
144 target_compatible_with = ["@platforms//os:linux"],
145 deps = [
James Kuszmaulda52ce62021-09-25 21:51:42 -0700146 "//aos:configuration_ts_fbs",
James Kuszmaul78101402021-09-11 12:42:21 -0700147 "//aos/network/www:aos_plotter",
148 "//aos/network/www:colors",
James Kuszmaulda52ce62021-09-25 21:51:42 -0700149 "//aos/network/www:plotter",
James Kuszmaul78101402021-09-11 12:42:21 -0700150 "//aos/network/www:proxy",
James Kuszmaulda52ce62021-09-25 21:51:42 -0700151 "//aos/network/www:reflection_ts",
James Kuszmauldac091f2022-03-22 09:35:06 -0700152 "@com_github_google_flatbuffers//reflection:reflection_ts_fbs",
James Kuszmaulda52ce62021-09-25 21:51:42 -0700153 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
James Kuszmaul78101402021-09-11 12:42:21 -0700154 ],
155)
156
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800157ts_project(
Austin Schuh7d63eab2021-03-06 20:15:02 -0800158 name = "finisher_plotter",
159 srcs = ["finisher_plotter.ts"],
160 target_compatible_with = ["@platforms//os:linux"],
161 deps = [
162 "//aos/network/www:aos_plotter",
Ravago Jones819ba1f2021-03-10 10:48:10 -0800163 "//aos/network/www:colors",
Austin Schuh7d63eab2021-03-06 20:15:02 -0800164 "//aos/network/www:proxy",
165 ],
166)
167
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800168ts_project(
Austin Schuh7d63eab2021-03-06 20:15:02 -0800169 name = "accelerator_plotter",
170 srcs = ["accelerator_plotter.ts"],
171 target_compatible_with = ["@platforms//os:linux"],
172 deps = [
173 "//aos/network/www:aos_plotter",
Ravago Jones819ba1f2021-03-10 10:48:10 -0800174 "//aos/network/www:colors",
Austin Schuh7d63eab2021-03-06 20:15:02 -0800175 "//aos/network/www:proxy",
176 ],
177)
Austin Schuh2efe1682021-03-06 22:47:15 -0800178
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800179ts_project(
Austin Schuh2efe1682021-03-06 22:47:15 -0800180 name = "hood_plotter",
181 srcs = ["hood_plotter.ts"],
182 target_compatible_with = ["@platforms//os:linux"],
183 deps = [
184 "//aos/network/www:aos_plotter",
Ravago Jones819ba1f2021-03-10 10:48:10 -0800185 "//aos/network/www:colors",
Austin Schuh2efe1682021-03-06 22:47:15 -0800186 "//aos/network/www:proxy",
187 ],
188)
Austin Schuhf213a072021-10-17 23:42:50 -0700189
190cc_binary(
191 name = "superstructure_replay",
192 srcs = ["superstructure_replay.cc"],
193 deps = [
194 ":superstructure_lib",
195 "//aos:configuration",
196 "//aos:init",
197 "//aos/events:simulated_event_loop",
198 "//aos/events/logging:log_reader",
199 "//aos/network:team_number",
200 ],
201)