blob: 212f70ebf4fa30c8568b88655e6be5e5e1cc9c2e [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",
Jim Ostrowski9bf206a2024-01-26 23:31:58 -080058 "//y2024/vision:viewer",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080059 "//y2024/constants:constants_sender",
James Kuszmaul313e9ce2024-02-11 17:47:33 -080060 "//y2024/localizer:localizer_main",
James Kuszmaulecafe1f2024-02-27 20:29:53 -080061 "//y2024/localizer:localizer_logger",
Jim Ostrowski855b7442024-01-20 18:03:09 -080062 "//y2024/vision:foxglove_image_converter",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080063 ],
64 data = [
65 ":aos_config",
Jim Ostrowski855b7442024-01-20 18:03:09 -080066 "//frc971/rockpi:rockpi_config.json",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080067 "//y2024/constants:constants.json",
68 "//y2024/vision:image_streamer_start",
69 "//y2024/www:www_files",
70 ],
71 dirs = [
72 "//y2024/www:www_files",
73 "//frc971/image_streamer/www:www_files",
74 ],
75 start_binaries = [
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080076 "//aos/events/logging:logger_main",
Maxwell Henderson4f35c832024-02-11 15:40:30 -080077 "//frc971/imu_fdcan:can_translator",
Maxwell Henderson87b1e6c2024-02-11 23:40:05 -080078 "//frc971/imu_fdcan:dual_imu_blender",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080079 "//aos/network:message_bridge_client",
80 "//aos/network:message_bridge_server",
81 "//aos/network:web_proxy_main",
82 "//aos/starter:irq_affinity",
Maxwell Henderson440e3f12024-01-17 19:44:13 -080083 "//frc971/orin:argus_camera",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080084 "//y2024/orin:can_logger",
Jim Ostrowskicb8b4082024-01-21 02:23:46 -080085 "//y2024/vision:apriltag_detector",
Jim Ostrowski8a1480f2024-01-20 00:31:51 -080086 "//y2024/vision:image_logger",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080087 ],
88 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
Maxwell Hendersone5d758f2024-01-20 13:30:42 -080089 target_type = "pi",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080090)
91
92aos_config(
93 name = "aos_config",
94 src = "y2024.json",
95 flatbuffers = [
96 "//aos/network:message_bridge_client_fbs",
97 "//aos/network:message_bridge_server_fbs",
98 "//aos/network:timestamp_fbs",
99 "//frc971/input:robot_state_fbs",
100 "//frc971/vision:vision_fbs",
101 "//frc971/vision:target_map_fbs",
102 ],
103 target_compatible_with = ["@platforms//os:linux"],
104 visibility = ["//visibility:public"],
105 deps = [
106 ":config_imu",
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800107 ":config_orin1",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800108 ":config_roborio",
109 ],
110)
111
112aos_config(
113 name = "config_imu",
114 src = "y2024_imu.json",
115 flatbuffers = [
116 "//aos/network:message_bridge_client_fbs",
117 "//aos/network:message_bridge_server_fbs",
Maxwell Henderson4f35c832024-02-11 15:40:30 -0800118 "//frc971/imu_fdcan:dual_imu_fbs",
119 "//frc971/imu_fdcan:can_translator_status_fbs",
Maxwell Henderson87b1e6c2024-02-11 23:40:05 -0800120 "//frc971/imu_fdcan:dual_imu_blender_status_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800121 "//y2024/constants:constants_fbs",
Maxwell Henderson563efed2024-02-17 21:11:33 -0800122 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Maxwell Henderson0604e6f2024-01-15 15:24:44 -0800123 "//frc971/can_logger:can_logging_fbs",
James Kuszmaul313e9ce2024-02-11 17:47:33 -0800124 "//y2024/localizer:status_fbs",
125 "//y2024/localizer:visualization_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800126 "//aos/network:timestamp_fbs",
127 "//aos/network:remote_message_fbs",
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800128 "//frc971/vision:calibration_fbs",
129 "//frc971/vision:target_map_fbs",
130 "//frc971/vision:vision_fbs",
131 "@com_github_foxglove_schemas//:schemas",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800132 ],
133 target_compatible_with = ["@platforms//os:linux"],
134 visibility = ["//visibility:public"],
135 deps = [
136 "//aos/events:aos_config",
137 "//frc971/control_loops/drivetrain:aos_config",
138 ],
139)
140
141aos_config(
142 name = "config_roborio",
143 src = "y2024_roborio.json",
144 flatbuffers = [
145 "//frc971:can_configuration_fbs",
146 "//aos/network:remote_message_fbs",
147 "//aos/network:message_bridge_client_fbs",
148 "//aos/network:message_bridge_server_fbs",
Maxwell Henderson563efed2024-02-17 21:11:33 -0800149 "//frc971/wpilib:pdp_values_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800150 #y2019 stuff shouldn't be here (e.g. target selector)
151 "//y2024/constants:constants_fbs",
152 "//aos/network:timestamp_fbs",
153 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
154 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800155 "//y2024/control_loops/superstructure:superstructure_can_position_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800156 "//y2024/control_loops/superstructure:superstructure_output_fbs",
James Kuszmaulf6aa0382024-03-01 19:46:05 -0800157 "//frc971/control_loops/drivetrain:rio_localizer_inputs_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800158 "//y2024/control_loops/superstructure:superstructure_position_fbs",
James Kuszmaul313e9ce2024-02-11 17:47:33 -0800159 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800160 "//y2024/control_loops/superstructure:superstructure_status_fbs",
161 "//frc971/can_logger:can_logging_fbs",
162 ],
163 target_compatible_with = ["@platforms//os:linux"],
164 deps = [
165 "//aos/events:aos_config",
166 "//frc971/autonomous:aos_config",
167 "//frc971/control_loops/drivetrain:aos_config",
168 "//frc971/input:aos_config",
169 ],
170)
171
Maxwell Henderson8ba07f92024-02-27 18:54:00 -0800172aos_config(
173 name = "config_orin1",
174 src = "y2024_orin1.json",
175 flatbuffers = [
176 "//aos/network:message_bridge_client_fbs",
177 "//aos/network:message_bridge_server_fbs",
178 "//aos/network:timestamp_fbs",
179 "//aos/network:remote_message_fbs",
180 "//y2024/constants:constants_fbs",
181 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
182 "//frc971/vision:calibration_fbs",
183 "//y2024/localizer:visualization_fbs",
184 "//frc971/vision:target_map_fbs",
185 "//frc971/vision:vision_fbs",
186 "@com_github_foxglove_schemas//:schemas",
187 ],
188 target_compatible_with = ["@platforms//os:linux"],
189 visibility = ["//visibility:public"],
190 deps = [
191 "//aos/events:aos_config",
192 "//frc971/control_loops/drivetrain:aos_config",
193 "//frc971/input:aos_config",
194 ],
195)
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800196
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800197cc_library(
198 name = "constants",
199 srcs = [
200 "constants.cc",
201 ],
202 hdrs = [
203 "constants.h",
204 ],
205 visibility = ["//visibility:public"],
206 deps = [
207 "//aos/mutex",
208 "//aos/network:team_number",
209 "//frc971:constants",
210 "//frc971/control_loops:pose",
211 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
212 "//frc971/shooter_interpolation:interpolation",
213 "//frc971/zeroing:absolute_encoder",
214 "//frc971/zeroing:pot_and_absolute_encoder",
Niko Sohmersc4d2c502024-02-19 19:35:35 -0800215 "//y2024/constants:constants_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800216 "//y2024/control_loops/drivetrain:polydrivetrain_plants",
Niko Sohmers27d92c62024-02-19 14:15:07 -0800217 "//y2024/control_loops/superstructure/altitude:altitude_plants",
218 "//y2024/control_loops/superstructure/catapult:catapult_plants",
Filip Kujawa37aa0bc2024-01-31 20:59:49 -0800219 "//y2024/control_loops/superstructure/climber:climber_plants",
Austin Schuh3db875a2024-02-18 20:02:40 -0800220 "//y2024/control_loops/superstructure/extend:extend_plants",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800221 "//y2024/control_loops/superstructure/intake_pivot:intake_pivot_plants",
Niko Sohmers27d92c62024-02-19 14:15:07 -0800222 "//y2024/control_loops/superstructure/turret:turret_plants",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800223 "@com_github_google_glog//:glog",
224 "@com_google_absl//absl/base",
225 ],
226)
227
228cc_binary(
229 name = "wpilib_interface",
230 srcs = [
231 "wpilib_interface.cc",
232 ],
233 target_compatible_with = ["//tools/platforms/hardware:roborio"],
234 deps = [
235 ":constants",
236 "//aos:init",
237 "//aos:math",
238 "//aos/containers:sized_array",
239 "//aos/events:shm_event_loop",
240 "//aos/logging",
241 "//aos/stl_mutex",
242 "//aos/time",
243 "//aos/util:log_interval",
244 "//aos/util:phased_loop",
245 "//aos/util:wrapping_counter",
246 "//frc971:can_configuration_fbs",
247 "//frc971/autonomous:auto_mode_fbs",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800248 "//frc971/constants:constants_sender_lib",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800249 "//frc971/control_loops:control_loop",
250 "//frc971/control_loops:control_loops_fbs",
251 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
252 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
253 "//frc971/input:robot_state_fbs",
254 "//frc971/queues:gyro_fbs",
255 "//frc971/wpilib:ADIS16448",
256 "//frc971/wpilib:buffered_pcm",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800257 "//frc971/wpilib:can_drivetrain_writer",
258 "//frc971/wpilib:can_sensor_reader",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800259 "//frc971/wpilib:dma",
260 "//frc971/wpilib:drivetrain_writer",
261 "//frc971/wpilib:encoder_and_potentiometer",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800262 "//frc971/wpilib:generic_can_writer",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800263 "//frc971/wpilib:joystick_sender",
264 "//frc971/wpilib:logging_fbs",
265 "//frc971/wpilib:pdp_fetcher",
266 "//frc971/wpilib:sensor_reader",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800267 "//frc971/wpilib:talonfx",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800268 "//frc971/wpilib:wpilib_robot_base",
269 "//third_party:phoenix",
270 "//third_party:phoenix6",
271 "//third_party:wpilib",
Niko Sohmersb21dbdc2024-01-20 20:06:59 -0800272 "//y2024/constants:constants_fbs",
Niko Sohmers1259b2a2024-01-29 18:00:37 -0800273 "//y2024/control_loops/superstructure:superstructure_can_position_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800274 "//y2024/control_loops/superstructure:superstructure_output_fbs",
275 "//y2024/control_loops/superstructure:superstructure_position_fbs",
276 ],
277)
278
279cc_binary(
280 name = "joystick_reader",
281 srcs = [
282 ":joystick_reader.cc",
283 ],
284 deps = [
285 ":constants",
286 "//aos:init",
287 "//aos/actions:action_lib",
288 "//aos/logging",
289 "//frc971/autonomous:auto_fbs",
290 "//frc971/autonomous:base_autonomous_actor",
291 "//frc971/control_loops:profiled_subsystem_fbs",
Filip Kujawaa7c8b412024-02-24 18:29:29 -0800292 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800293 "//frc971/input:action_joystick_input",
294 "//frc971/input:drivetrain_input",
295 "//frc971/input:joystick_input",
296 "//frc971/input:redundant_joystick_data",
297 "//y2024/control_loops/drivetrain:drivetrain_base",
298 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
299 "//y2024/control_loops/superstructure:superstructure_status_fbs",
300 ],
301)
302
303cc_binary(
304 name = "joystick_republish",
305 srcs = [
306 "joystick_republish.cc",
307 ],
308 target_compatible_with = ["@platforms//os:linux"],
309 visibility = ["//visibility:public"],
310 deps = [
311 "//aos:configuration",
312 "//aos:flatbuffer_merge",
313 "//aos:init",
314 "//aos/events:shm_event_loop",
315 "//frc971/input:joystick_state_fbs",
316 "@com_github_google_glog//:glog",
317 ],
318)
319
320py_library(
321 name = "python_init",
322 srcs = ["__init__.py"],
323 target_compatible_with = ["@platforms//os:linux"],
324 visibility = ["//visibility:public"],
325)
326
327sh_binary(
328 name = "log_web_proxy",
329 srcs = ["log_web_proxy.sh"],
330 data = [
331 ":aos_config",
332 "//aos/network:log_web_proxy_main",
Niko Sohmers2d108762024-02-02 20:21:14 -0800333 "//y2024/www:field_main_bundle.min.js",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800334 "//y2024/www:files",
335 ],
336 target_compatible_with = ["@platforms//os:linux"],
337)