blob: 309ada41c7e2af3c4abcc8e0fc1954d0d0140267 [file] [log] [blame]
Austin Schuh9f164e92022-12-29 16:15:28 -08001load("//frc971:downloader.bzl", "robot_downloader")
2load("//aos:config.bzl", "aos_config")
3load("//tools/build_rules:template.bzl", "jinja2_template")
4
5robot_downloader(
Ravago Jones2060ee62023-02-03 18:12:24 -08006 binaries = [
7 "//aos/network:web_proxy_main",
8 "//aos/events/logging:log_cat",
Austin Schuhd138e372023-02-23 21:43:53 -08009 "//aos/events:aos_timing_report_streamer",
Ravago Jones2060ee62023-02-03 18:12:24 -080010 ],
11 data = [
12 ":aos_config",
Xander Yee1ad2f7b2023-02-21 14:46:56 -080013 "//aos/starter:roborio_irq_config.json",
Ravago Jones2060ee62023-02-03 18:12:24 -080014 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
15 "@ctre_phoenix_cci_athena//:shared_libraries",
16 "@ctre_phoenixpro_api_cpp_athena//:shared_libraries",
17 "@ctre_phoenixpro_tools_athena//:shared_libraries",
18 ],
19 dirs = [
20 "//y2023/www:www_files",
21 ],
22 start_binaries = [
23 "//aos/events/logging:logger_main",
24 "//aos/network:web_proxy_main",
Xander Yee1ad2f7b2023-02-21 14:46:56 -080025 "//aos/starter:irq_affinity",
Ravago Jones2060ee62023-02-03 18:12:24 -080026 ":joystick_reader",
27 ":wpilib_interface",
28 "//aos/network:message_bridge_client",
29 "//aos/network:message_bridge_server",
30 "//y2023/control_loops/drivetrain:drivetrain",
31 "//y2023/control_loops/drivetrain:trajectory_generator",
32 "//y2023/control_loops/superstructure:superstructure",
33 ],
34 target_compatible_with = ["@platforms//os:linux"],
35)
36
37robot_downloader(
Austin Schuh9f164e92022-12-29 16:15:28 -080038 name = "pi_download",
39 binaries = [
James Kuszmaul7e958812023-02-11 15:34:31 -080040 "//frc971/vision:intrinsics_calibration",
Xander Yee1ad2f7b2023-02-21 14:46:56 -080041 "//aos/starter:irq_affinity",
James Kuszmaul77d536c2023-02-11 17:30:59 -080042 "//aos/util:foxglove_websocket",
Austin Schuh9f164e92022-12-29 16:15:28 -080043 "//y2023/vision:viewer",
milind-ud4051fe2023-02-25 18:00:05 -080044 "//y2023/vision:localization_verifier",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080045 "//y2023/vision:aprilrobotics",
James Kuszmaule01ae1e2023-02-25 20:54:06 -080046 "//aos/events:aos_timing_report_streamer",
James Kuszmaul04a343c2023-02-20 16:38:22 -080047 "//y2023/localizer:localizer_main",
James Kuszmauld67f6d22023-02-05 17:37:25 -080048 "//y2023/constants:constants_sender",
James Kuszmaul77d536c2023-02-11 17:30:59 -080049 "//y2023/vision:foxglove_image_converter",
Maxwell Hendersonad312342023-01-10 12:07:47 -080050 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080051 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080052 "//y2023/rockpi:imu_main",
milind-u8e98cb92023-02-05 16:07:10 -080053 "//frc971/image_streamer:image_streamer",
Austin Schuh9f164e92022-12-29 16:15:28 -080054 ],
55 data = [
56 ":aos_config",
James Kuszmaul08a4d852023-02-22 16:57:54 -080057 "//frc971/rockpi:rockpi_config.json",
James Kuszmauld67f6d22023-02-05 17:37:25 -080058 "//y2023/constants:constants.json",
milind-u8e98cb92023-02-05 16:07:10 -080059 "//y2023/vision:image_streamer_start",
James Kuszmauld67f6d22023-02-05 17:37:25 -080060 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080061 ],
62 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080063 "//y2023/www:www_files",
milind-u8e98cb92023-02-05 16:07:10 -080064 "//frc971/image_streamer/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080065 ],
66 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080067 "//aos/network:message_bridge_client",
68 "//aos/network:message_bridge_server",
69 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080070 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080071 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080072 "//aos/events/logging:logger_main",
Filip Kujawa3004f202023-02-12 16:41:40 -080073 "//y2023/vision:game_pieces_detector",
Austin Schuh9f164e92022-12-29 16:15:28 -080074 ],
75 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
76 target_type = "pi",
77)
78
79aos_config(
80 name = "aos_config",
81 src = "y2023.json",
82 flatbuffers = [
83 "//aos/network:message_bridge_client_fbs",
84 "//aos/network:message_bridge_server_fbs",
85 "//aos/network:timestamp_fbs",
86 "//frc971/input:robot_state_fbs",
87 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080088 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080089 ],
90 target_compatible_with = ["@platforms//os:linux"],
91 visibility = ["//visibility:public"],
92 deps = [
93 ":config_imu",
94 ":config_logger",
95 ":config_pi1",
96 ":config_pi2",
97 ":config_pi3",
98 ":config_pi4",
99 ":config_roborio",
100 ],
101)
102
103[
104 aos_config(
105 name = "config_" + pi,
106 src = "y2023_" + pi + ".json",
107 flatbuffers = [
108 "//aos/network:message_bridge_client_fbs",
109 "//aos/network:message_bridge_server_fbs",
110 "//aos/network:timestamp_fbs",
111 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800112 "//y2023/constants:constants_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800113 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800114 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800115 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800116 "//frc971/vision:vision_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800117 "//y2023/localizer:visualization_fbs",
Filip Kujawa3004f202023-02-12 16:41:40 -0800118 "//y2023/vision:game_pieces_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800119 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800120 ],
121 target_compatible_with = ["@platforms//os:linux"],
122 visibility = ["//visibility:public"],
123 deps = [
124 "//aos/events:aos_config",
125 "//frc971/control_loops/drivetrain:aos_config",
126 "//frc971/input:aos_config",
127 ],
128 )
129 for pi in [
130 "pi1",
131 "pi2",
132 "pi3",
133 "pi4",
134 ]
135]
136
137aos_config(
138 name = "config_imu",
139 src = "y2023_imu.json",
140 flatbuffers = [
141 "//aos/network:message_bridge_client_fbs",
142 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800143 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800144 "//aos/network:timestamp_fbs",
145 "//aos/network:remote_message_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800146 "//y2023/localizer:status_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800147 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800148 "//y2023/localizer:visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800149 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800150 ],
151 target_compatible_with = ["@platforms//os:linux"],
152 visibility = ["//visibility:public"],
153 deps = [
154 "//aos/events:aos_config",
155 "//frc971/control_loops/drivetrain:aos_config",
156 ],
157)
158
159aos_config(
160 name = "config_logger",
161 src = "y2023_logger.json",
162 flatbuffers = [
163 "//aos/network:message_bridge_client_fbs",
164 "//aos/network:message_bridge_server_fbs",
165 "//aos/network:timestamp_fbs",
166 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800167 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800168 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800169 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800170 "//y2023/constants:constants_fbs",
Filip Kujawa3004f202023-02-12 16:41:40 -0800171 "//y2023/vision:game_pieces_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800172 ],
173 target_compatible_with = ["@platforms//os:linux"],
174 visibility = ["//visibility:public"],
175 deps = [
176 "//aos/events:aos_config",
177 "//frc971/control_loops/drivetrain:aos_config",
178 "//frc971/input:aos_config",
179 ],
180)
181
182aos_config(
183 name = "config_roborio",
184 src = "y2023_roborio.json",
185 flatbuffers = [
186 "//aos/network:remote_message_fbs",
187 "//aos/network:message_bridge_client_fbs",
188 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800189 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800190 "//aos/network:timestamp_fbs",
191 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800192 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
James Kuszmauldb730d72023-02-25 16:01:27 -0800193 "//y2023/control_loops/drivetrain:target_selector_hint_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800194 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800195 "//y2023/control_loops/superstructure:superstructure_output_fbs",
196 "//y2023/control_loops/superstructure:superstructure_position_fbs",
197 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800198 ],
199 target_compatible_with = ["@platforms//os:linux"],
200 deps = [
201 "//aos/events:aos_config",
202 "//frc971/autonomous:aos_config",
203 "//frc971/control_loops/drivetrain:aos_config",
204 "//frc971/input:aos_config",
205 "//frc971/wpilib:aos_config",
206 ],
207)
208
209[
210 jinja2_template(
211 name = "y2023_pi" + str(num) + ".json",
212 src = "y2023_pi_template.json",
213 parameters = {"NUM": str(num)},
214 target_compatible_with = ["@platforms//os:linux"],
215 )
216 for num in range(1, 6)
217]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800218
219cc_library(
220 name = "constants",
221 srcs = [
222 "constants.cc",
223 ],
224 hdrs = [
225 "constants.h",
226 ],
227 visibility = ["//visibility:public"],
228 deps = [
229 "//aos/mutex",
230 "//aos/network:team_number",
231 "//frc971:constants",
232 "//frc971/control_loops:pose",
233 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
234 "//frc971/shooter_interpolation:interpolation",
235 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800236 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u051c7002023-02-20 16:28:18 -0800237 "//y2023/control_loops/superstructure/roll:roll_plants",
238 "//y2023/control_loops/superstructure/wrist:wrist_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800239 "@com_github_google_glog//:glog",
240 "@com_google_absl//absl/base",
241 ],
242)
243
244cc_binary(
245 name = "wpilib_interface",
246 srcs = [
247 "wpilib_interface.cc",
248 ],
249 target_compatible_with = ["//tools/platforms/hardware:roborio"],
250 deps = [
251 ":constants",
252 "//aos:init",
253 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800254 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800255 "//aos/events:shm_event_loop",
256 "//aos/logging",
257 "//aos/stl_mutex",
258 "//aos/time",
259 "//aos/util:log_interval",
260 "//aos/util:phased_loop",
261 "//aos/util:wrapping_counter",
262 "//frc971/autonomous:auto_mode_fbs",
263 "//frc971/control_loops:control_loop",
264 "//frc971/control_loops:control_loops_fbs",
265 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
266 "//frc971/input:robot_state_fbs",
267 "//frc971/queues:gyro_fbs",
268 "//frc971/wpilib:ADIS16448",
269 "//frc971/wpilib:buffered_pcm",
270 "//frc971/wpilib:drivetrain_writer",
271 "//frc971/wpilib:encoder_and_potentiometer",
272 "//frc971/wpilib:interrupt_edge_counting",
273 "//frc971/wpilib:joystick_sender",
274 "//frc971/wpilib:logging_fbs",
275 "//frc971/wpilib:loop_output_handler",
276 "//frc971/wpilib:pdp_fetcher",
277 "//frc971/wpilib:sensor_reader",
278 "//frc971/wpilib:wpilib_interface",
279 "//frc971/wpilib:wpilib_robot_base",
280 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800281 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800282 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800283 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800284 "//y2023/control_loops/superstructure:superstructure_output_fbs",
285 "//y2023/control_loops/superstructure:superstructure_position_fbs",
286 ],
287)
288
289cc_binary(
290 name = "joystick_reader",
291 srcs = [
292 ":joystick_reader.cc",
293 ],
294 deps = [
295 ":constants",
296 "//aos:init",
297 "//aos/actions:action_lib",
298 "//aos/logging",
299 "//frc971/autonomous:auto_fbs",
300 "//frc971/autonomous:base_autonomous_actor",
301 "//frc971/control_loops:profiled_subsystem_fbs",
302 "//frc971/input:action_joystick_input",
303 "//frc971/input:drivetrain_input",
304 "//frc971/input:joystick_input",
305 "//y2023/control_loops/drivetrain:drivetrain_base",
306 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
307 "//y2023/control_loops/superstructure:superstructure_status_fbs",
milind-udefab712023-02-20 22:22:02 -0800308 "//y2023/control_loops/superstructure/arm:generated_graph",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800309 ],
310)
311
312py_library(
313 name = "python_init",
314 srcs = ["__init__.py"],
315 target_compatible_with = ["@platforms//os:linux"],
316 visibility = ["//visibility:public"],
317)
318
319sh_binary(
320 name = "log_web_proxy",
321 srcs = ["log_web_proxy.sh"],
322 data = [
323 ":aos_config",
324 "//aos/network:log_web_proxy_main",
325 "//y2023/www:field_main_bundle.min.js",
326 "//y2023/www:files",
327 ],
328 target_compatible_with = ["@platforms//os:linux"],
329)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800330
331cc_binary(
332 name = "ssd_profiler",
333 srcs = [
334 "ssd_profiler.cc",
335 ],
336 deps = [
337 "//aos:init",
338 "//aos/time",
339 "@com_github_google_glog//:glog",
340 ],
341)