blob: 704a5a437c5462077f08311f5d2d8efe164d0f58 [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",
53 "//aos/network:web_proxy_main",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080054 "//aos/starter:irq_affinity",
55 "//aos/util:foxglove_websocket",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080056 "//frc971/image_streamer:image_streamer",
Jim Ostrowskicb8b4082024-01-21 02:23:46 -080057 "//frc971/vision:intrinsics_calibration",
Austin Schuh19731b02024-03-02 16:53:19 -080058 "//aos/util:filesystem_monitor",
Jim Ostrowski9bf206a2024-01-26 23:31:58 -080059 "//y2024/vision:viewer",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080060 "//y2024/constants:constants_sender",
James Kuszmaul313e9ce2024-02-11 17:47:33 -080061 "//y2024/localizer:localizer_main",
James Kuszmaulecafe1f2024-02-27 20:29:53 -080062 "//y2024/localizer:localizer_logger",
Jim Ostrowski855b7442024-01-20 18:03:09 -080063 "//y2024/vision:foxglove_image_converter",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080064 ],
65 data = [
66 ":aos_config",
Austin Schuh19731b02024-03-02 16:53:19 -080067 "//frc971/orin:orin_irq_config.json",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080068 "//y2024/constants:constants.json",
69 "//y2024/vision:image_streamer_start",
70 "//y2024/www:www_files",
71 ],
72 dirs = [
73 "//y2024/www:www_files",
74 "//frc971/image_streamer/www:www_files",
75 ],
76 start_binaries = [
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080077 "//aos/events/logging:logger_main",
Maxwell Henderson4f35c832024-02-11 15:40:30 -080078 "//frc971/imu_fdcan:can_translator",
Maxwell Henderson87b1e6c2024-02-11 23:40:05 -080079 "//frc971/imu_fdcan:dual_imu_blender",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080080 "//aos/network:message_bridge_client",
81 "//aos/network:message_bridge_server",
82 "//aos/network:web_proxy_main",
83 "//aos/starter:irq_affinity",
Maxwell Henderson440e3f12024-01-17 19:44:13 -080084 "//frc971/orin:argus_camera",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080085 "//y2024/orin:can_logger",
Jim Ostrowskicb8b4082024-01-21 02:23:46 -080086 "//y2024/vision:apriltag_detector",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080087 "//y2024/vision:image_logger",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080088 ],
89 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
Maxwell Hendersone5d758f2024-01-20 13:30:42 -080090 target_type = "pi",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080091)
92
93aos_config(
94 name = "aos_config",
95 src = "y2024.json",
96 flatbuffers = [
97 "//aos/network:message_bridge_client_fbs",
98 "//aos/network:message_bridge_server_fbs",
99 "//aos/network:timestamp_fbs",
100 "//frc971/input:robot_state_fbs",
101 "//frc971/vision:vision_fbs",
102 "//frc971/vision:target_map_fbs",
103 ],
104 target_compatible_with = ["@platforms//os:linux"],
105 visibility = ["//visibility:public"],
106 deps = [
107 ":config_imu",
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800108 ":config_orin1",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800109 ":config_roborio",
110 ],
111)
112
113aos_config(
114 name = "config_imu",
115 src = "y2024_imu.json",
116 flatbuffers = [
117 "//aos/network:message_bridge_client_fbs",
118 "//aos/network:message_bridge_server_fbs",
Maxwell Henderson4f35c832024-02-11 15:40:30 -0800119 "//frc971/imu_fdcan:dual_imu_fbs",
120 "//frc971/imu_fdcan:can_translator_status_fbs",
Maxwell Henderson87b1e6c2024-02-11 23:40:05 -0800121 "//frc971/imu_fdcan:dual_imu_blender_status_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800122 "//y2024/constants:constants_fbs",
Maxwell Henderson563efed2024-02-17 21:11:33 -0800123 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Maxwell Henderson0604e6f2024-01-15 15:24:44 -0800124 "//frc971/can_logger:can_logging_fbs",
James Kuszmaul313e9ce2024-02-11 17:47:33 -0800125 "//y2024/localizer:status_fbs",
126 "//y2024/localizer:visualization_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800127 "//aos/network:timestamp_fbs",
Austin Schuhc979f7c2024-03-02 16:49:20 -0800128 "//aos/util:filesystem_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800129 "//aos/network:remote_message_fbs",
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800130 "//frc971/vision:calibration_fbs",
131 "//frc971/vision:target_map_fbs",
132 "//frc971/vision:vision_fbs",
133 "@com_github_foxglove_schemas//:schemas",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800134 ],
135 target_compatible_with = ["@platforms//os:linux"],
136 visibility = ["//visibility:public"],
137 deps = [
138 "//aos/events:aos_config",
139 "//frc971/control_loops/drivetrain:aos_config",
140 ],
141)
142
143aos_config(
144 name = "config_roborio",
145 src = "y2024_roborio.json",
146 flatbuffers = [
147 "//frc971:can_configuration_fbs",
148 "//aos/network:remote_message_fbs",
149 "//aos/network:message_bridge_client_fbs",
150 "//aos/network:message_bridge_server_fbs",
Maxwell Henderson563efed2024-02-17 21:11:33 -0800151 "//frc971/wpilib:pdp_values_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800152 #y2019 stuff shouldn't be here (e.g. target selector)
153 "//y2024/constants:constants_fbs",
154 "//aos/network:timestamp_fbs",
155 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
156 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800157 "//y2024/control_loops/superstructure:superstructure_can_position_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800158 "//y2024/control_loops/superstructure:superstructure_output_fbs",
James Kuszmaulf6aa0382024-03-01 19:46:05 -0800159 "//frc971/control_loops/drivetrain:rio_localizer_inputs_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800160 "//y2024/control_loops/superstructure:superstructure_position_fbs",
James Kuszmaul313e9ce2024-02-11 17:47:33 -0800161 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800162 "//y2024/control_loops/superstructure:superstructure_status_fbs",
163 "//frc971/can_logger:can_logging_fbs",
164 ],
165 target_compatible_with = ["@platforms//os:linux"],
166 deps = [
167 "//aos/events:aos_config",
168 "//frc971/autonomous:aos_config",
169 "//frc971/control_loops/drivetrain:aos_config",
170 "//frc971/input:aos_config",
171 ],
172)
173
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800174aos_config(
175 name = "config_orin1",
176 src = "y2024_orin1.json",
177 flatbuffers = [
178 "//aos/network:message_bridge_client_fbs",
179 "//aos/network:message_bridge_server_fbs",
180 "//aos/network:timestamp_fbs",
181 "//aos/network:remote_message_fbs",
182 "//y2024/constants:constants_fbs",
183 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
184 "//frc971/vision:calibration_fbs",
185 "//y2024/localizer:visualization_fbs",
186 "//frc971/vision:target_map_fbs",
187 "//frc971/vision:vision_fbs",
Austin Schuhc979f7c2024-03-02 16:49:20 -0800188 "//aos/util:filesystem_fbs",
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800189 "@com_github_foxglove_schemas//:schemas",
190 ],
191 target_compatible_with = ["@platforms//os:linux"],
192 visibility = ["//visibility:public"],
193 deps = [
194 "//aos/events:aos_config",
195 "//frc971/control_loops/drivetrain:aos_config",
196 "//frc971/input:aos_config",
197 ],
198)
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800199
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800200cc_library(
201 name = "constants",
202 srcs = [
203 "constants.cc",
204 ],
205 hdrs = [
206 "constants.h",
207 ],
208 visibility = ["//visibility:public"],
209 deps = [
210 "//aos/mutex",
211 "//aos/network:team_number",
212 "//frc971:constants",
213 "//frc971/control_loops:pose",
214 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
215 "//frc971/shooter_interpolation:interpolation",
216 "//frc971/zeroing:absolute_encoder",
217 "//frc971/zeroing:pot_and_absolute_encoder",
Niko Sohmersc4d2c502024-02-19 19:35:35 -0800218 "//y2024/constants:constants_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800219 "//y2024/control_loops/drivetrain:polydrivetrain_plants",
Niko Sohmers27d92c62024-02-19 14:15:07 -0800220 "//y2024/control_loops/superstructure/altitude:altitude_plants",
221 "//y2024/control_loops/superstructure/catapult:catapult_plants",
Filip Kujawa37aa0bc2024-01-31 20:59:49 -0800222 "//y2024/control_loops/superstructure/climber:climber_plants",
Austin Schuh3db875a2024-02-18 20:02:40 -0800223 "//y2024/control_loops/superstructure/extend:extend_plants",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800224 "//y2024/control_loops/superstructure/intake_pivot:intake_pivot_plants",
Niko Sohmers27d92c62024-02-19 14:15:07 -0800225 "//y2024/control_loops/superstructure/turret:turret_plants",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800226 "@com_github_google_glog//:glog",
227 "@com_google_absl//absl/base",
228 ],
229)
230
231cc_binary(
232 name = "wpilib_interface",
233 srcs = [
234 "wpilib_interface.cc",
235 ],
236 target_compatible_with = ["//tools/platforms/hardware:roborio"],
237 deps = [
238 ":constants",
239 "//aos:init",
240 "//aos:math",
241 "//aos/containers:sized_array",
242 "//aos/events:shm_event_loop",
243 "//aos/logging",
244 "//aos/stl_mutex",
245 "//aos/time",
246 "//aos/util:log_interval",
247 "//aos/util:phased_loop",
248 "//aos/util:wrapping_counter",
249 "//frc971:can_configuration_fbs",
250 "//frc971/autonomous:auto_mode_fbs",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800251 "//frc971/constants:constants_sender_lib",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800252 "//frc971/control_loops:control_loop",
253 "//frc971/control_loops:control_loops_fbs",
254 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
255 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
256 "//frc971/input:robot_state_fbs",
257 "//frc971/queues:gyro_fbs",
258 "//frc971/wpilib:ADIS16448",
259 "//frc971/wpilib:buffered_pcm",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800260 "//frc971/wpilib:can_drivetrain_writer",
261 "//frc971/wpilib:can_sensor_reader",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800262 "//frc971/wpilib:dma",
263 "//frc971/wpilib:drivetrain_writer",
264 "//frc971/wpilib:encoder_and_potentiometer",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800265 "//frc971/wpilib:generic_can_writer",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800266 "//frc971/wpilib:joystick_sender",
267 "//frc971/wpilib:logging_fbs",
268 "//frc971/wpilib:pdp_fetcher",
269 "//frc971/wpilib:sensor_reader",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800270 "//frc971/wpilib:talonfx",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800271 "//frc971/wpilib:wpilib_robot_base",
272 "//third_party:phoenix",
273 "//third_party:phoenix6",
274 "//third_party:wpilib",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800275 "//y2024/constants:constants_fbs",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800276 "//y2024/control_loops/superstructure:superstructure_can_position_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800277 "//y2024/control_loops/superstructure:superstructure_output_fbs",
278 "//y2024/control_loops/superstructure:superstructure_position_fbs",
279 ],
280)
281
282cc_binary(
283 name = "joystick_reader",
284 srcs = [
285 ":joystick_reader.cc",
286 ],
287 deps = [
288 ":constants",
289 "//aos:init",
290 "//aos/actions:action_lib",
291 "//aos/logging",
292 "//frc971/autonomous:auto_fbs",
293 "//frc971/autonomous:base_autonomous_actor",
294 "//frc971/control_loops:profiled_subsystem_fbs",
Filip Kujawaa7c8b412024-02-24 18:29:29 -0800295 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800296 "//frc971/input:action_joystick_input",
297 "//frc971/input:drivetrain_input",
298 "//frc971/input:joystick_input",
299 "//frc971/input:redundant_joystick_data",
300 "//y2024/control_loops/drivetrain:drivetrain_base",
301 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
302 "//y2024/control_loops/superstructure:superstructure_status_fbs",
303 ],
304)
305
306cc_binary(
307 name = "joystick_republish",
308 srcs = [
309 "joystick_republish.cc",
310 ],
311 target_compatible_with = ["@platforms//os:linux"],
312 visibility = ["//visibility:public"],
313 deps = [
314 "//aos:configuration",
315 "//aos:flatbuffer_merge",
316 "//aos:init",
317 "//aos/events:shm_event_loop",
318 "//frc971/input:joystick_state_fbs",
319 "@com_github_google_glog//:glog",
320 ],
321)
322
323py_library(
324 name = "python_init",
325 srcs = ["__init__.py"],
326 target_compatible_with = ["@platforms//os:linux"],
327 visibility = ["//visibility:public"],
328)
329
330sh_binary(
331 name = "log_web_proxy",
332 srcs = ["log_web_proxy.sh"],
333 data = [
334 ":aos_config",
335 "//aos/network:log_web_proxy_main",
Niko Sohmers2d108762024-02-02 20:21:14 -0800336 "//y2024/www:field_main_bundle.min.js",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800337 "//y2024/www:files",
338 ],
339 target_compatible_with = ["@platforms//os:linux"],
340)