blob: d1f20a2c9f4f08c81a1a4c3b08f136de6dd52284 [file] [log] [blame]
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08001load("//tools/build_rules:js.bzl", "ts_project")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
3load("@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
Stephan Massaltd021f972020-01-05 20:41:23 -08007flatbuffer_cc_library(
8 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
12 gen_reflections = 1,
13 includes = [
14 "//frc971/control_loops:control_loops_fbs_includes",
15 "//frc971/control_loops:profiled_subsystem_fbs_includes",
16 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080017 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080018)
19
20flatbuffer_cc_library(
21 name = "superstructure_output_fbs",
22 srcs = [
23 "superstructure_output.fbs",
24 ],
25 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080026 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080027)
28
James Kuszmaul5e6aa252021-08-28 22:19:29 -070029flatbuffer_ts_library(
30 name = "superstructure_status_ts_fbs",
31 srcs = [
32 "superstructure_status.fbs",
33 ],
James Kuszmaul5e6aa252021-08-28 22:19:29 -070034 target_compatible_with = ["@platforms//os:linux"],
James Kuszmauldac091f2022-03-22 09:35:06 -070035 deps = [
36 "//frc971/control_loops:control_loops_ts_fbs",
37 "//frc971/control_loops:profiled_subsystem_ts_fbs",
38 ],
James Kuszmaul5e6aa252021-08-28 22:19:29 -070039)
40
Stephan Massaltd021f972020-01-05 20:41:23 -080041flatbuffer_cc_library(
42 name = "superstructure_status_fbs",
43 srcs = [
44 "superstructure_status.fbs",
45 ],
46 gen_reflections = 1,
47 includes = [
48 "//frc971/control_loops:control_loops_fbs_includes",
49 "//frc971/control_loops:profiled_subsystem_fbs_includes",
50 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080051 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080052)
53
54flatbuffer_cc_library(
55 name = "superstructure_position_fbs",
56 srcs = [
57 "superstructure_position.fbs",
58 ],
59 gen_reflections = 1,
60 includes = [
61 "//frc971/control_loops:control_loops_fbs_includes",
62 "//frc971/control_loops:profiled_subsystem_fbs_includes",
63 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080064 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080065)
66
67cc_library(
68 name = "superstructure_lib",
69 srcs = [
70 "superstructure.cc",
71 ],
72 hdrs = [
73 "superstructure.h",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080076 deps = [
77 ":superstructure_goal_fbs",
78 ":superstructure_output_fbs",
79 ":superstructure_position_fbs",
80 ":superstructure_status_fbs",
milind-u0beb7dc2021-10-16 19:31:33 -070081 "//aos/containers:sized_array",
Stephan Massaltd021f972020-01-05 20:41:23 -080082 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070083 "//frc971/control_loops:control_loop",
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080084 "//frc971/control_loops:control_loops_fbs",
85 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Stephan Massaltd021f972020-01-05 20:41:23 -080086 "//y2020:constants",
Philipp Schrader37fdbb62021-12-18 00:30:37 -080087 "//y2020/control_loops/superstructure/hood:hood_encoder_zeroing_estimator",
Sabina Davis0f31d3f2020-02-20 20:41:00 -080088 "//y2020/control_loops/superstructure/shooter",
James Kuszmaulb1b2d8e2020-02-21 21:11:46 -080089 "//y2020/control_loops/superstructure/turret:aiming",
Stephan Massaltd021f972020-01-05 20:41:23 -080090 ],
91)
92
93cc_binary(
94 name = "superstructure",
95 srcs = [
96 "superstructure_main.cc",
97 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080098 target_compatible_with = ["@platforms//os:linux"],
Stephan Massaltd021f972020-01-05 20:41:23 -080099 deps = [
100 ":superstructure_lib",
101 "//aos:init",
102 "//aos/events:shm_event_loop",
103 ],
104)
Sabina Davis7704a652020-02-01 11:42:14 -0800105
106cc_test(
107 name = "superstructure_lib_test",
108 srcs = [
109 "superstructure_lib_test.cc",
110 ],
111 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800112 "//y2020:aos_config",
milind-u7baf7342021-08-25 18:31:26 -0700113 "@superstructure_replay",
Sabina Davis7704a652020-02-01 11:42:14 -0800114 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800115 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis7704a652020-02-01 11:42:14 -0800116 deps = [
117 ":superstructure_goal_fbs",
118 ":superstructure_lib",
119 ":superstructure_output_fbs",
120 ":superstructure_position_fbs",
121 ":superstructure_status_fbs",
122 "//aos:math",
milind-u7baf7342021-08-25 18:31:26 -0700123 "//aos/events/logging:log_reader",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800124 "//aos/events/logging:log_writer",
milind-u7baf7342021-08-25 18:31:26 -0700125 "//aos/network:team_number",
Sabina Davis7704a652020-02-01 11:42:14 -0800126 "//aos/testing:googletest",
127 "//aos/time",
128 "//frc971/control_loops:capped_test_plant",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700129 "//frc971/control_loops:control_loop_test",
Sabina Davis7704a652020-02-01 11:42:14 -0800130 "//frc971/control_loops:position_sensor_sim",
131 "//frc971/control_loops:team_number_test_environment",
132 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
133 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davis0f2d38c2020-02-08 17:01:21 -0800134 "//y2020/control_loops/superstructure/intake:intake_plants",
Sabina Davis0f31d3f2020-02-20 20:41:00 -0800135 "//y2020/control_loops/superstructure/shooter:shooter_plants",
Sabina Davis7704a652020-02-01 11:42:14 -0800136 ],
137)
John Park0a245a02020-02-02 14:10:15 -0800138
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800139ts_project(
James Kuszmaul78101402021-09-11 12:42:21 -0700140 name = "turret_plotter",
141 srcs = ["turret_plotter.ts"],
142 target_compatible_with = ["@platforms//os:linux"],
143 deps = [
James Kuszmaulda52ce62021-09-25 21:51:42 -0700144 "//aos:configuration_ts_fbs",
James Kuszmaul78101402021-09-11 12:42:21 -0700145 "//aos/network/www:aos_plotter",
146 "//aos/network/www:colors",
James Kuszmaulda52ce62021-09-25 21:51:42 -0700147 "//aos/network/www:plotter",
James Kuszmaul78101402021-09-11 12:42:21 -0700148 "//aos/network/www:proxy",
James Kuszmaulda52ce62021-09-25 21:51:42 -0700149 "//aos/network/www:reflection_ts",
James Kuszmauldac091f2022-03-22 09:35:06 -0700150 "@com_github_google_flatbuffers//reflection:reflection_ts_fbs",
James Kuszmaulda52ce62021-09-25 21:51:42 -0700151 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
James Kuszmaul78101402021-09-11 12:42:21 -0700152 ],
153)
154
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800155ts_project(
Austin Schuh7d63eab2021-03-06 20:15:02 -0800156 name = "finisher_plotter",
157 srcs = ["finisher_plotter.ts"],
158 target_compatible_with = ["@platforms//os:linux"],
159 deps = [
160 "//aos/network/www:aos_plotter",
Ravago Jones819ba1f2021-03-10 10:48:10 -0800161 "//aos/network/www:colors",
Austin Schuh7d63eab2021-03-06 20:15:02 -0800162 "//aos/network/www:proxy",
163 ],
164)
165
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800166ts_project(
Austin Schuh7d63eab2021-03-06 20:15:02 -0800167 name = "accelerator_plotter",
168 srcs = ["accelerator_plotter.ts"],
169 target_compatible_with = ["@platforms//os:linux"],
170 deps = [
171 "//aos/network/www:aos_plotter",
Ravago Jones819ba1f2021-03-10 10:48:10 -0800172 "//aos/network/www:colors",
Austin Schuh7d63eab2021-03-06 20:15:02 -0800173 "//aos/network/www:proxy",
174 ],
175)
Austin Schuh2efe1682021-03-06 22:47:15 -0800176
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800177ts_project(
Austin Schuh2efe1682021-03-06 22:47:15 -0800178 name = "hood_plotter",
179 srcs = ["hood_plotter.ts"],
180 target_compatible_with = ["@platforms//os:linux"],
181 deps = [
182 "//aos/network/www:aos_plotter",
Ravago Jones819ba1f2021-03-10 10:48:10 -0800183 "//aos/network/www:colors",
Austin Schuh2efe1682021-03-06 22:47:15 -0800184 "//aos/network/www:proxy",
185 ],
186)
Austin Schuhf213a072021-10-17 23:42:50 -0700187
188cc_binary(
189 name = "superstructure_replay",
190 srcs = ["superstructure_replay.cc"],
191 deps = [
192 ":superstructure_lib",
193 "//aos:configuration",
194 "//aos:init",
195 "//aos/events:simulated_event_loop",
196 "//aos/events/logging:log_reader",
197 "//aos/network:team_number",
198 ],
199)