blob: 52b4db037c26ea2b13af94d135cfc8ae5af38068 [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")
milind-u086d7262022-01-19 20:44:18 -08004
5package(default_visibility = ["//visibility:public"])
6
James Kuszmaulf01da392023-12-14 11:22:14 -08007static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -08008 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080012 deps = [
13 "//frc971/control_loops:control_loops_fbs",
14 "//frc971/control_loops:profiled_subsystem_fbs",
Nathan Leongdd728002024-02-03 15:26:53 -080015 "//frc971/control_loops/catapult:catapult_goal_fbs",
milind-u086d7262022-01-19 20:44:18 -080016 ],
17)
18
James Kuszmaulf01da392023-12-14 11:22:14 -080019static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -080020 name = "superstructure_output_fbs",
21 srcs = [
22 "superstructure_output.fbs",
23 ],
milind-u086d7262022-01-19 20:44:18 -080024)
25
James Kuszmaulf01da392023-12-14 11:22:14 -080026static_flatbuffer(
Milind Upadhyay482b0ba2022-02-26 21:51:59 -080027 name = "superstructure_can_position_fbs",
28 srcs = [
29 "superstructure_can_position.fbs",
30 ],
Milind Upadhyay482b0ba2022-02-26 21:51:59 -080031)
32
James Kuszmaulf01da392023-12-14 11:22:14 -080033static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -080034 name = "superstructure_status_fbs",
35 srcs = [
36 "superstructure_status.fbs",
37 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080038 deps = [
39 "//frc971/control_loops:control_loops_fbs",
40 "//frc971/control_loops:profiled_subsystem_fbs",
milind-u086d7262022-01-19 20:44:18 -080041 ],
42)
43
Austin Schuh76f227c2022-02-23 16:34:08 -080044flatbuffer_ts_library(
45 name = "superstructure_status_ts_fbs",
46 srcs = [
47 "superstructure_status.fbs",
48 ],
James Kuszmauldac091f2022-03-22 09:35:06 -070049 deps = [
50 "//frc971/control_loops:control_loops_ts_fbs",
51 "//frc971/control_loops:profiled_subsystem_ts_fbs",
Austin Schuh76f227c2022-02-23 16:34:08 -080052 ],
Austin Schuh76f227c2022-02-23 16:34:08 -080053)
54
James Kuszmaulf01da392023-12-14 11:22:14 -080055static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -080056 name = "superstructure_position_fbs",
57 srcs = [
58 "superstructure_position.fbs",
59 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080060 deps = [
61 "//frc971/control_loops:control_loops_fbs",
62 "//frc971/control_loops:profiled_subsystem_fbs",
milind-u086d7262022-01-19 20:44:18 -080063 ],
64)
65
66cc_library(
67 name = "superstructure_lib",
68 srcs = [
69 "superstructure.cc",
70 ],
71 hdrs = [
72 "superstructure.h",
73 ],
74 deps = [
Milind Upadhyay225156b2022-02-25 22:42:12 -080075 ":collision_avoidance_lib",
Ravago Jones5da06352022-03-04 20:26:24 -080076 ":superstructure_can_position_fbs",
milind-u086d7262022-01-19 20:44:18 -080077 ":superstructure_goal_fbs",
78 ":superstructure_output_fbs",
79 ":superstructure_position_fbs",
80 ":superstructure_status_fbs",
Ravago Jones3283ce02022-03-09 19:31:29 -080081 "//aos:flatbuffer_merge",
milind-u086d7262022-01-19 20:44:18 -080082 "//aos/events:event_loop",
83 "//frc971/control_loops:control_loop",
Nathan Leongdd728002024-02-03 15:26:53 -080084 "//frc971/control_loops/catapult",
Henry Speiser55aa3ba2022-02-21 23:21:12 -080085 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulec635d22023-08-12 18:39:24 -070086 "//frc971/zeroing:pot_and_absolute_encoder",
milind-u086d7262022-01-19 20:44:18 -080087 "//y2022:constants",
James Kuszmaul84083f42022-02-27 17:24:38 -080088 "//y2022/control_loops/superstructure/turret:aiming",
Ravago Jonesd51af7a2022-03-26 21:44:20 -070089 "//y2022/vision:ball_color_fbs",
milind-u086d7262022-01-19 20:44:18 -080090 ],
91)
92
93cc_binary(
94 name = "superstructure",
95 srcs = [
96 "superstructure_main.cc",
97 ],
98 deps = [
99 ":superstructure_lib",
100 "//aos:init",
101 "//aos/events:shm_event_loop",
102 ],
103)
104
105cc_test(
106 name = "superstructure_lib_test",
107 srcs = [
108 "superstructure_lib_test.cc",
109 ],
110 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800111 "//y2022:aos_config",
milind-u086d7262022-01-19 20:44:18 -0800112 ],
113 deps = [
114 ":superstructure_goal_fbs",
115 ":superstructure_lib",
116 ":superstructure_output_fbs",
117 ":superstructure_position_fbs",
118 ":superstructure_status_fbs",
119 "//aos:math",
120 "//aos/events/logging:log_writer",
121 "//aos/testing:googletest",
122 "//aos/time",
123 "//frc971/control_loops:capped_test_plant",
124 "//frc971/control_loops:control_loop_test",
125 "//frc971/control_loops:position_sensor_sim",
Niko Sohmerse69ee2d2022-09-28 19:52:27 -0700126 "//frc971/control_loops:subsystem_simulator",
milind-u086d7262022-01-19 20:44:18 -0800127 "//frc971/control_loops:team_number_test_environment",
128 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
129 ],
130)
131
Milind Upadhyay9d68b132022-04-01 10:58:18 -0700132cc_binary(
133 name = "superstructure_replay",
134 srcs = ["superstructure_replay.cc"],
135 deps = [
136 ":superstructure_lib",
137 "//aos:configuration",
138 "//aos:init",
139 "//aos/events:simulated_event_loop",
140 "//aos/events/logging:log_reader",
141 "//aos/network:team_number",
142 ],
143)
144
Milind Upadhyay225156b2022-02-25 22:42:12 -0800145cc_library(
146 name = "collision_avoidance_lib",
147 srcs = ["collision_avoidance.cc"],
148 hdrs = ["collision_avoidance.h"],
149 target_compatible_with = ["@platforms//os:linux"],
150 deps = [
151 ":superstructure_goal_fbs",
152 ":superstructure_status_fbs",
153 "//frc971/control_loops:control_loops_fbs",
154 "//frc971/control_loops:profiled_subsystem_fbs",
155 "@com_github_google_glog//:glog",
156 "@com_google_absl//absl/functional:bind_front",
157 ],
158)
159
160cc_test(
161 name = "collision_avoidance_test",
162 srcs = ["collision_avoidance_test.cc"],
163 target_compatible_with = ["@platforms//os:linux"],
164 deps = [
165 ":collision_avoidance_lib",
166 ":superstructure_goal_fbs",
167 ":superstructure_status_fbs",
168 "//aos:flatbuffers",
169 "//aos:math",
170 "//aos/testing:googletest",
171 ],
172)
173
Henry Speiser77747b72022-03-06 17:18:29 -0800174cc_library(
175 name = "led_indicator_lib",
176 srcs = ["led_indicator.cc"],
177 hdrs = ["led_indicator.h"],
178 data = [
179 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
180 "@ctre_phoenix_cci_athena//:shared_libraries",
181 ],
182 target_compatible_with = ["//tools/platforms/hardware:roborio"],
183 deps = [
184 ":superstructure_output_fbs",
185 ":superstructure_status_fbs",
186 "//aos/events:event_loop",
Henry Speiser888c1962022-03-16 20:54:56 -0700187 "//aos/network:message_bridge_client_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800188 "//aos/network:message_bridge_server_fbs",
189 "//frc971/control_loops:control_loop",
190 "//frc971/control_loops:control_loops_fbs",
191 "//frc971/control_loops:profiled_subsystem_fbs",
192 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800193 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Henry Speisere562e322022-04-01 16:09:32 -0700194 "//frc971/queues:gyro_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800195 "//third_party:phoenix",
196 "//third_party:wpilib",
197 ],
198)
199
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800200ts_project(
milind-u086d7262022-01-19 20:44:18 -0800201 name = "superstructure_plotter",
202 srcs = ["superstructure_plotter.ts"],
203 target_compatible_with = ["@platforms//os:linux"],
204 deps = [
205 "//aos/network/www:aos_plotter",
206 "//aos/network/www:colors",
207 "//aos/network/www:proxy",
208 ],
209)
Austin Schuh76f227c2022-02-23 16:34:08 -0800210
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800211ts_project(
Austin Schuh76f227c2022-02-23 16:34:08 -0800212 name = "catapult_plotter",
213 srcs = ["catapult_plotter.ts"],
214 target_compatible_with = ["@platforms//os:linux"],
215 deps = [
216 "//aos/network/www:aos_plotter",
217 "//aos/network/www:colors",
218 "//aos/network/www:proxy",
219 ],
220)
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800221
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800222ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800223 name = "intake_plotter",
224 srcs = ["intake_plotter.ts"],
225 target_compatible_with = ["@platforms//os:linux"],
226 deps = [
227 "//aos/network/www:aos_plotter",
228 "//aos/network/www:colors",
229 "//aos/network/www:proxy",
230 ],
231)
232
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800233ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800234 name = "turret_plotter",
235 srcs = ["turret_plotter.ts"],
236 target_compatible_with = ["@platforms//os:linux"],
237 deps = [
238 "//aos/network/www:aos_plotter",
239 "//aos/network/www:colors",
240 "//aos/network/www:proxy",
241 ],
242)
243
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800244ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800245 name = "climber_plotter",
246 srcs = ["climber_plotter.ts"],
247 target_compatible_with = ["@platforms//os:linux"],
248 deps = [
249 "//aos/network/www:aos_plotter",
250 "//aos/network/www:colors",
251 "//aos/network/www:proxy",
252 ],
253)