blob: 7bbf64fa63ed38e83b4b342669947f2e1d6d90be [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001load("//frc971:downloader.bzl", "robot_downloader")
2load("//aos:config.bzl", "aos_config")
3load("//aos/util:config_validator_macro.bzl", "config_validator_test")
4
5config_validator_test(
6 name = "config_validator_test",
7 config = "//y2024:aos_config",
8)
9
10robot_downloader(
11 binaries = [
12 "//aos/network:web_proxy_main",
13 "//aos/events/logging:log_cat",
14 "//y2024/constants:constants_sender",
15 "//aos/events:aos_timing_report_streamer",
16 ],
17 data = [
18 ":aos_config",
19 "//aos/starter:roborio_irq_config.json",
20 "//y2024/constants:constants.json",
Maxwell Henderson7be07d52024-02-20 07:59:16 -080021 "@ctre_phoenix6_api_cpp_athena//:shared_libraries",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080022 "@ctre_phoenix6_tools_athena//:shared_libraries",
Maxwell Henderson7be07d52024-02-20 07:59:16 -080023 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080024 "@ctre_phoenix_cci_athena//:shared_libraries",
25 ],
26 dirs = [
27 "//y2024/www:www_files",
28 "//y2024/autonomous:splines",
29 ],
30 start_binaries = [
31 "//aos/events/logging:logger_main",
32 "//aos/network:web_proxy_main",
33 "//aos/starter:irq_affinity",
34 "//y2024/autonomous:binaries",
35 ":joystick_reader",
36 ":wpilib_interface",
37 "//frc971/can_logger",
38 "//aos/network:message_bridge_client",
39 "//aos/network:message_bridge_server",
40 "//y2024/control_loops/drivetrain:drivetrain",
41 "//y2024/control_loops/drivetrain:trajectory_generator",
42 "//y2024/control_loops/superstructure:superstructure",
43 ],
44 target_compatible_with = ["@platforms//os:linux"],
45)
46
47robot_downloader(
48 name = "orin_download",
49 binaries = [
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080050 ":joystick_republish",
51 "//aos/events:aos_timing_report_streamer",
52 "//aos/events/logging:log_cat",
Austin Schuh99004602024-03-16 11:59:24 -070053 "//aos:aos_jitter",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080054 "//aos/network:web_proxy_main",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080055 "//aos/starter:irq_affinity",
56 "//aos/util:foxglove_websocket",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080057 "//frc971/image_streamer:image_streamer",
Tushar Pankaj47313c12024-03-16 17:03:53 -070058 "//frc971/orin:hardware_monitor",
Jim Ostrowskicb8b4082024-01-21 02:23:46 -080059 "//frc971/vision:intrinsics_calibration",
Austin Schuh19731b02024-03-02 16:53:19 -080060 "//aos/util:filesystem_monitor",
Jim Ostrowski9bf206a2024-01-26 23:31:58 -080061 "//y2024/vision:viewer",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080062 "//y2024/constants:constants_sender",
James Kuszmaul313e9ce2024-02-11 17:47:33 -080063 "//y2024/localizer:localizer_main",
James Kuszmaulecafe1f2024-02-27 20:29:53 -080064 "//y2024/localizer:localizer_logger",
Jim Ostrowski855b7442024-01-20 18:03:09 -080065 "//y2024/vision:foxglove_image_converter",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080066 ],
67 data = [
68 ":aos_config",
Austin Schuh19731b02024-03-02 16:53:19 -080069 "//frc971/orin:orin_irq_config.json",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080070 "//y2024/constants:constants.json",
71 "//y2024/vision:image_streamer_start",
72 "//y2024/www:www_files",
73 ],
74 dirs = [
75 "//y2024/www:www_files",
76 "//frc971/image_streamer/www:www_files",
77 ],
78 start_binaries = [
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080079 "//aos/events/logging:logger_main",
Maxwell Henderson4f35c832024-02-11 15:40:30 -080080 "//frc971/imu_fdcan:can_translator",
Maxwell Henderson87b1e6c2024-02-11 23:40:05 -080081 "//frc971/imu_fdcan:dual_imu_blender",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080082 "//aos/network:message_bridge_client",
83 "//aos/network:message_bridge_server",
84 "//aos/network:web_proxy_main",
85 "//aos/starter:irq_affinity",
Maxwell Henderson440e3f12024-01-17 19:44:13 -080086 "//frc971/orin:argus_camera",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080087 "//y2024/orin:can_logger",
Jim Ostrowskicb8b4082024-01-21 02:23:46 -080088 "//y2024/vision:apriltag_detector",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080089 "//y2024/vision:image_logger",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080090 ],
91 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
Maxwell Hendersone5d758f2024-01-20 13:30:42 -080092 target_type = "pi",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080093)
94
95aos_config(
96 name = "aos_config",
97 src = "y2024.json",
98 flatbuffers = [
99 "//aos/network:message_bridge_client_fbs",
100 "//aos/network:message_bridge_server_fbs",
101 "//aos/network:timestamp_fbs",
102 "//frc971/input:robot_state_fbs",
103 "//frc971/vision:vision_fbs",
104 "//frc971/vision:target_map_fbs",
105 ],
106 target_compatible_with = ["@platforms//os:linux"],
107 visibility = ["//visibility:public"],
108 deps = [
109 ":config_imu",
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800110 ":config_orin1",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800111 ":config_roborio",
112 ],
113)
114
115aos_config(
116 name = "config_imu",
117 src = "y2024_imu.json",
118 flatbuffers = [
119 "//aos/network:message_bridge_client_fbs",
120 "//aos/network:message_bridge_server_fbs",
Maxwell Henderson4f35c832024-02-11 15:40:30 -0800121 "//frc971/imu_fdcan:dual_imu_fbs",
122 "//frc971/imu_fdcan:can_translator_status_fbs",
Maxwell Henderson87b1e6c2024-02-11 23:40:05 -0800123 "//frc971/imu_fdcan:dual_imu_blender_status_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800124 "//y2024/constants:constants_fbs",
Maxwell Henderson563efed2024-02-17 21:11:33 -0800125 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Maxwell Henderson0604e6f2024-01-15 15:24:44 -0800126 "//frc971/can_logger:can_logging_fbs",
Tushar Pankaj47313c12024-03-16 17:03:53 -0700127 "//frc971/orin:hardware_stats_fbs",
James Kuszmaul313e9ce2024-02-11 17:47:33 -0800128 "//y2024/localizer:status_fbs",
129 "//y2024/localizer:visualization_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800130 "//aos/network:timestamp_fbs",
Austin Schuhc979f7c2024-03-02 16:49:20 -0800131 "//aos/util:filesystem_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800132 "//aos/network:remote_message_fbs",
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800133 "//frc971/vision:calibration_fbs",
134 "//frc971/vision:target_map_fbs",
135 "//frc971/vision:vision_fbs",
136 "@com_github_foxglove_schemas//:schemas",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800137 ],
138 target_compatible_with = ["@platforms//os:linux"],
139 visibility = ["//visibility:public"],
140 deps = [
141 "//aos/events:aos_config",
142 "//frc971/control_loops/drivetrain:aos_config",
143 ],
144)
145
146aos_config(
147 name = "config_roborio",
148 src = "y2024_roborio.json",
149 flatbuffers = [
150 "//frc971:can_configuration_fbs",
151 "//aos/network:remote_message_fbs",
152 "//aos/network:message_bridge_client_fbs",
153 "//aos/network:message_bridge_server_fbs",
Maxwell Henderson563efed2024-02-17 21:11:33 -0800154 "//frc971/wpilib:pdp_values_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800155 #y2019 stuff shouldn't be here (e.g. target selector)
156 "//y2024/constants:constants_fbs",
157 "//aos/network:timestamp_fbs",
158 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
159 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800160 "//y2024/control_loops/superstructure:superstructure_can_position_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800161 "//y2024/control_loops/superstructure:superstructure_output_fbs",
James Kuszmaulf6aa0382024-03-01 19:46:05 -0800162 "//frc971/control_loops/drivetrain:rio_localizer_inputs_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800163 "//y2024/control_loops/superstructure:superstructure_position_fbs",
James Kuszmaul313e9ce2024-02-11 17:47:33 -0800164 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800165 "//y2024/control_loops/superstructure:superstructure_status_fbs",
166 "//frc971/can_logger:can_logging_fbs",
167 ],
168 target_compatible_with = ["@platforms//os:linux"],
169 deps = [
170 "//aos/events:aos_config",
171 "//frc971/autonomous:aos_config",
172 "//frc971/control_loops/drivetrain:aos_config",
173 "//frc971/input:aos_config",
174 ],
175)
176
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800177aos_config(
178 name = "config_orin1",
179 src = "y2024_orin1.json",
180 flatbuffers = [
181 "//aos/network:message_bridge_client_fbs",
182 "//aos/network:message_bridge_server_fbs",
183 "//aos/network:timestamp_fbs",
184 "//aos/network:remote_message_fbs",
185 "//y2024/constants:constants_fbs",
186 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Tushar Pankaj47313c12024-03-16 17:03:53 -0700187 "//frc971/orin:hardware_stats_fbs",
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800188 "//frc971/vision:calibration_fbs",
189 "//y2024/localizer:visualization_fbs",
190 "//frc971/vision:target_map_fbs",
191 "//frc971/vision:vision_fbs",
Austin Schuhc979f7c2024-03-02 16:49:20 -0800192 "//aos/util:filesystem_fbs",
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800193 "@com_github_foxglove_schemas//:schemas",
194 ],
195 target_compatible_with = ["@platforms//os:linux"],
196 visibility = ["//visibility:public"],
197 deps = [
198 "//aos/events:aos_config",
199 "//frc971/control_loops/drivetrain:aos_config",
200 "//frc971/input:aos_config",
201 ],
202)
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800203
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800204cc_library(
205 name = "constants",
206 srcs = [
207 "constants.cc",
208 ],
209 hdrs = [
210 "constants.h",
211 ],
212 visibility = ["//visibility:public"],
213 deps = [
214 "//aos/mutex",
215 "//aos/network:team_number",
216 "//frc971:constants",
217 "//frc971/control_loops:pose",
218 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
219 "//frc971/shooter_interpolation:interpolation",
220 "//frc971/zeroing:absolute_encoder",
221 "//frc971/zeroing:pot_and_absolute_encoder",
Niko Sohmersc4d2c502024-02-19 19:35:35 -0800222 "//y2024/constants:constants_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800223 "//y2024/control_loops/drivetrain:polydrivetrain_plants",
Niko Sohmers27d92c62024-02-19 14:15:07 -0800224 "//y2024/control_loops/superstructure/altitude:altitude_plants",
225 "//y2024/control_loops/superstructure/catapult:catapult_plants",
Filip Kujawa37aa0bc2024-01-31 20:59:49 -0800226 "//y2024/control_loops/superstructure/climber:climber_plants",
Austin Schuh3db875a2024-02-18 20:02:40 -0800227 "//y2024/control_loops/superstructure/extend:extend_plants",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800228 "//y2024/control_loops/superstructure/intake_pivot:intake_pivot_plants",
Niko Sohmers27d92c62024-02-19 14:15:07 -0800229 "//y2024/control_loops/superstructure/turret:turret_plants",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800230 "@com_github_google_glog//:glog",
231 "@com_google_absl//absl/base",
232 ],
233)
234
235cc_binary(
236 name = "wpilib_interface",
237 srcs = [
238 "wpilib_interface.cc",
239 ],
240 target_compatible_with = ["//tools/platforms/hardware:roborio"],
241 deps = [
242 ":constants",
243 "//aos:init",
244 "//aos:math",
245 "//aos/containers:sized_array",
246 "//aos/events:shm_event_loop",
247 "//aos/logging",
248 "//aos/stl_mutex",
249 "//aos/time",
250 "//aos/util:log_interval",
251 "//aos/util:phased_loop",
252 "//aos/util:wrapping_counter",
253 "//frc971:can_configuration_fbs",
254 "//frc971/autonomous:auto_mode_fbs",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800255 "//frc971/constants:constants_sender_lib",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800256 "//frc971/control_loops:control_loop",
257 "//frc971/control_loops:control_loops_fbs",
258 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
259 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
260 "//frc971/input:robot_state_fbs",
261 "//frc971/queues:gyro_fbs",
262 "//frc971/wpilib:ADIS16448",
263 "//frc971/wpilib:buffered_pcm",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800264 "//frc971/wpilib:can_drivetrain_writer",
265 "//frc971/wpilib:can_sensor_reader",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800266 "//frc971/wpilib:dma",
267 "//frc971/wpilib:drivetrain_writer",
268 "//frc971/wpilib:encoder_and_potentiometer",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800269 "//frc971/wpilib:generic_can_writer",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800270 "//frc971/wpilib:joystick_sender",
271 "//frc971/wpilib:logging_fbs",
272 "//frc971/wpilib:pdp_fetcher",
273 "//frc971/wpilib:sensor_reader",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800274 "//frc971/wpilib:talonfx",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800275 "//frc971/wpilib:wpilib_robot_base",
276 "//third_party:phoenix",
277 "//third_party:phoenix6",
278 "//third_party:wpilib",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800279 "//y2024/constants:constants_fbs",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800280 "//y2024/control_loops/superstructure:superstructure_can_position_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800281 "//y2024/control_loops/superstructure:superstructure_output_fbs",
282 "//y2024/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",
Filip Kujawaa7c8b412024-02-24 18:29:29 -0800299 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800300 "//frc971/input:action_joystick_input",
301 "//frc971/input:drivetrain_input",
302 "//frc971/input:joystick_input",
303 "//frc971/input:redundant_joystick_data",
304 "//y2024/control_loops/drivetrain:drivetrain_base",
305 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
306 "//y2024/control_loops/superstructure:superstructure_status_fbs",
307 ],
308)
309
310cc_binary(
311 name = "joystick_republish",
312 srcs = [
313 "joystick_republish.cc",
314 ],
315 target_compatible_with = ["@platforms//os:linux"],
316 visibility = ["//visibility:public"],
317 deps = [
318 "//aos:configuration",
319 "//aos:flatbuffer_merge",
320 "//aos:init",
321 "//aos/events:shm_event_loop",
322 "//frc971/input:joystick_state_fbs",
323 "@com_github_google_glog//:glog",
324 ],
325)
326
327py_library(
328 name = "python_init",
329 srcs = ["__init__.py"],
330 target_compatible_with = ["@platforms//os:linux"],
331 visibility = ["//visibility:public"],
332)
333
334sh_binary(
335 name = "log_web_proxy",
336 srcs = ["log_web_proxy.sh"],
337 data = [
338 ":aos_config",
339 "//aos/network:log_web_proxy_main",
Niko Sohmers2d108762024-02-02 20:21:14 -0800340 "//y2024/www:field_main_bundle.min.js",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800341 "//y2024/www:files",
342 ],
343 target_compatible_with = ["@platforms//os:linux"],
344)