blob: a500a8311d92e419c71fb8a74c2cd24e10628af6 [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",
Austin Schuh9f164e92022-12-29 16:15:28 -080073 ],
74 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
75 target_type = "pi",
76)
77
78aos_config(
79 name = "aos_config",
80 src = "y2023.json",
81 flatbuffers = [
82 "//aos/network:message_bridge_client_fbs",
83 "//aos/network:message_bridge_server_fbs",
84 "//aos/network:timestamp_fbs",
85 "//frc971/input:robot_state_fbs",
86 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080087 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080088 ],
89 target_compatible_with = ["@platforms//os:linux"],
90 visibility = ["//visibility:public"],
91 deps = [
92 ":config_imu",
93 ":config_logger",
94 ":config_pi1",
95 ":config_pi2",
96 ":config_pi3",
97 ":config_pi4",
98 ":config_roborio",
99 ],
100)
101
102[
103 aos_config(
104 name = "config_" + pi,
105 src = "y2023_" + pi + ".json",
106 flatbuffers = [
107 "//aos/network:message_bridge_client_fbs",
108 "//aos/network:message_bridge_server_fbs",
109 "//aos/network:timestamp_fbs",
110 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800111 "//y2023/constants:constants_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800112 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800113 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800114 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800115 "//frc971/vision:vision_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800116 "//y2023/localizer:visualization_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800117 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800118 ],
119 target_compatible_with = ["@platforms//os:linux"],
120 visibility = ["//visibility:public"],
121 deps = [
122 "//aos/events:aos_config",
123 "//frc971/control_loops/drivetrain:aos_config",
124 "//frc971/input:aos_config",
125 ],
126 )
127 for pi in [
128 "pi1",
129 "pi2",
130 "pi3",
131 "pi4",
132 ]
133]
134
135aos_config(
136 name = "config_imu",
137 src = "y2023_imu.json",
138 flatbuffers = [
139 "//aos/network:message_bridge_client_fbs",
140 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800141 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800142 "//aos/network:timestamp_fbs",
143 "//aos/network:remote_message_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800144 "//y2023/localizer:status_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800145 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800146 "//y2023/localizer:visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800147 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800148 ],
149 target_compatible_with = ["@platforms//os:linux"],
150 visibility = ["//visibility:public"],
151 deps = [
152 "//aos/events:aos_config",
153 "//frc971/control_loops/drivetrain:aos_config",
154 ],
155)
156
157aos_config(
158 name = "config_logger",
159 src = "y2023_logger.json",
160 flatbuffers = [
161 "//aos/network:message_bridge_client_fbs",
162 "//aos/network:message_bridge_server_fbs",
163 "//aos/network:timestamp_fbs",
164 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800165 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800166 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800167 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800168 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800169 ],
170 target_compatible_with = ["@platforms//os:linux"],
171 visibility = ["//visibility:public"],
172 deps = [
173 "//aos/events:aos_config",
174 "//frc971/control_loops/drivetrain:aos_config",
175 "//frc971/input:aos_config",
176 ],
177)
178
179aos_config(
180 name = "config_roborio",
181 src = "y2023_roborio.json",
182 flatbuffers = [
183 "//aos/network:remote_message_fbs",
184 "//aos/network:message_bridge_client_fbs",
185 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800186 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800187 "//aos/network:timestamp_fbs",
188 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800189 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
James Kuszmauldb730d72023-02-25 16:01:27 -0800190 "//y2023/control_loops/drivetrain:target_selector_hint_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800191 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800192 "//y2023/control_loops/superstructure:superstructure_output_fbs",
193 "//y2023/control_loops/superstructure:superstructure_position_fbs",
194 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800195 ],
196 target_compatible_with = ["@platforms//os:linux"],
197 deps = [
198 "//aos/events:aos_config",
199 "//frc971/autonomous:aos_config",
200 "//frc971/control_loops/drivetrain:aos_config",
201 "//frc971/input:aos_config",
202 "//frc971/wpilib:aos_config",
203 ],
204)
205
206[
207 jinja2_template(
208 name = "y2023_pi" + str(num) + ".json",
209 src = "y2023_pi_template.json",
210 parameters = {"NUM": str(num)},
211 target_compatible_with = ["@platforms//os:linux"],
212 )
213 for num in range(1, 6)
214]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800215
216cc_library(
217 name = "constants",
218 srcs = [
219 "constants.cc",
220 ],
221 hdrs = [
222 "constants.h",
223 ],
224 visibility = ["//visibility:public"],
225 deps = [
226 "//aos/mutex",
227 "//aos/network:team_number",
228 "//frc971:constants",
229 "//frc971/control_loops:pose",
230 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
231 "//frc971/shooter_interpolation:interpolation",
232 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800233 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u051c7002023-02-20 16:28:18 -0800234 "//y2023/control_loops/superstructure/roll:roll_plants",
235 "//y2023/control_loops/superstructure/wrist:wrist_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800236 "@com_github_google_glog//:glog",
237 "@com_google_absl//absl/base",
238 ],
239)
240
241cc_binary(
242 name = "wpilib_interface",
243 srcs = [
244 "wpilib_interface.cc",
245 ],
246 target_compatible_with = ["//tools/platforms/hardware:roborio"],
247 deps = [
248 ":constants",
249 "//aos:init",
250 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800251 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800252 "//aos/events:shm_event_loop",
253 "//aos/logging",
254 "//aos/stl_mutex",
255 "//aos/time",
256 "//aos/util:log_interval",
257 "//aos/util:phased_loop",
258 "//aos/util:wrapping_counter",
259 "//frc971/autonomous:auto_mode_fbs",
260 "//frc971/control_loops:control_loop",
261 "//frc971/control_loops:control_loops_fbs",
262 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
263 "//frc971/input:robot_state_fbs",
264 "//frc971/queues:gyro_fbs",
265 "//frc971/wpilib:ADIS16448",
266 "//frc971/wpilib:buffered_pcm",
267 "//frc971/wpilib:drivetrain_writer",
268 "//frc971/wpilib:encoder_and_potentiometer",
269 "//frc971/wpilib:interrupt_edge_counting",
270 "//frc971/wpilib:joystick_sender",
271 "//frc971/wpilib:logging_fbs",
272 "//frc971/wpilib:loop_output_handler",
273 "//frc971/wpilib:pdp_fetcher",
274 "//frc971/wpilib:sensor_reader",
275 "//frc971/wpilib:wpilib_interface",
276 "//frc971/wpilib:wpilib_robot_base",
277 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800278 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800279 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800280 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800281 "//y2023/control_loops/superstructure:superstructure_output_fbs",
282 "//y2023/control_loops/superstructure:superstructure_position_fbs",
283 ],
284)
285
286cc_binary(
287 name = "joystick_reader",
288 srcs = [
289 ":joystick_reader.cc",
290 ],
291 deps = [
292 ":constants",
293 "//aos:init",
294 "//aos/actions:action_lib",
295 "//aos/logging",
296 "//frc971/autonomous:auto_fbs",
297 "//frc971/autonomous:base_autonomous_actor",
298 "//frc971/control_loops:profiled_subsystem_fbs",
299 "//frc971/input:action_joystick_input",
300 "//frc971/input:drivetrain_input",
301 "//frc971/input:joystick_input",
302 "//y2023/control_loops/drivetrain:drivetrain_base",
303 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
304 "//y2023/control_loops/superstructure:superstructure_status_fbs",
milind-udefab712023-02-20 22:22:02 -0800305 "//y2023/control_loops/superstructure/arm:generated_graph",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800306 ],
307)
308
309py_library(
310 name = "python_init",
311 srcs = ["__init__.py"],
312 target_compatible_with = ["@platforms//os:linux"],
313 visibility = ["//visibility:public"],
314)
315
316sh_binary(
317 name = "log_web_proxy",
318 srcs = ["log_web_proxy.sh"],
319 data = [
320 ":aos_config",
321 "//aos/network:log_web_proxy_main",
322 "//y2023/www:field_main_bundle.min.js",
323 "//y2023/www:files",
324 ],
325 target_compatible_with = ["@platforms//os:linux"],
326)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800327
328cc_binary(
329 name = "ssd_profiler",
330 srcs = [
331 "ssd_profiler.cc",
332 ],
333 deps = [
334 "//aos:init",
335 "//aos/time",
336 "@com_github_google_glog//:glog",
337 ],
338)