blob: 51d64620277570be66db5b76ed1642b9e77d33db [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",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080044 "//y2023/vision:aprilrobotics",
Austin Schuh9f164e92022-12-29 16:15:28 -080045 "//y2022/localizer:localizer_main",
James Kuszmauld67f6d22023-02-05 17:37:25 -080046 "//y2023/constants:constants_sender",
James Kuszmaul77d536c2023-02-11 17:30:59 -080047 "//y2023/vision:foxglove_image_converter",
Maxwell Hendersonad312342023-01-10 12:07:47 -080048 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080049 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080050 "//y2023/rockpi:imu_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080051 ],
52 data = [
53 ":aos_config",
James Kuszmauld67f6d22023-02-05 17:37:25 -080054 "//y2023/constants:constants.json",
55 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080056 ],
57 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080058 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080059 ],
60 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080061 "//aos/network:message_bridge_client",
62 "//aos/network:message_bridge_server",
63 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080064 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080065 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080066 "//aos/events/logging:logger_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080067 ],
68 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
69 target_type = "pi",
70)
71
72aos_config(
73 name = "aos_config",
74 src = "y2023.json",
75 flatbuffers = [
76 "//aos/network:message_bridge_client_fbs",
77 "//aos/network:message_bridge_server_fbs",
78 "//aos/network:timestamp_fbs",
79 "//frc971/input:robot_state_fbs",
80 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080081 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080082 ],
83 target_compatible_with = ["@platforms//os:linux"],
84 visibility = ["//visibility:public"],
85 deps = [
86 ":config_imu",
87 ":config_logger",
88 ":config_pi1",
89 ":config_pi2",
90 ":config_pi3",
91 ":config_pi4",
92 ":config_roborio",
93 ],
94)
95
96[
97 aos_config(
98 name = "config_" + pi,
99 src = "y2023_" + pi + ".json",
100 flatbuffers = [
101 "//aos/network:message_bridge_client_fbs",
102 "//aos/network:message_bridge_server_fbs",
103 "//aos/network:timestamp_fbs",
104 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800105 "//y2023/constants:constants_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800106 "//y2022/localizer:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800107 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800108 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800109 "//frc971/vision:vision_fbs",
Yash Chainani728ae222023-02-04 19:48:12 -0800110 "//y2023/vision:april_debug_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800111 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800112 ],
113 target_compatible_with = ["@platforms//os:linux"],
114 visibility = ["//visibility:public"],
115 deps = [
116 "//aos/events:aos_config",
117 "//frc971/control_loops/drivetrain:aos_config",
118 "//frc971/input:aos_config",
119 ],
120 )
121 for pi in [
122 "pi1",
123 "pi2",
124 "pi3",
125 "pi4",
126 ]
127]
128
129aos_config(
130 name = "config_imu",
131 src = "y2023_imu.json",
132 flatbuffers = [
133 "//aos/network:message_bridge_client_fbs",
134 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800135 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800136 "//aos/network:timestamp_fbs",
137 "//aos/network:remote_message_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800138 "//y2022/localizer:localizer_status_fbs",
139 "//y2022/localizer:localizer_output_fbs",
140 "//y2022/localizer:localizer_visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800141 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800142 ],
143 target_compatible_with = ["@platforms//os:linux"],
144 visibility = ["//visibility:public"],
145 deps = [
146 "//aos/events:aos_config",
147 "//frc971/control_loops/drivetrain:aos_config",
148 ],
149)
150
151aos_config(
152 name = "config_logger",
153 src = "y2023_logger.json",
154 flatbuffers = [
155 "//aos/network:message_bridge_client_fbs",
156 "//aos/network:message_bridge_server_fbs",
157 "//aos/network:timestamp_fbs",
158 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800159 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800160 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800161 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800162 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800163 ],
164 target_compatible_with = ["@platforms//os:linux"],
165 visibility = ["//visibility:public"],
166 deps = [
167 "//aos/events:aos_config",
168 "//frc971/control_loops/drivetrain:aos_config",
169 "//frc971/input:aos_config",
170 ],
171)
172
173aos_config(
174 name = "config_roborio",
175 src = "y2023_roborio.json",
176 flatbuffers = [
177 "//aos/network:remote_message_fbs",
178 "//aos/network:message_bridge_client_fbs",
179 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800180 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800181 "//aos/network:timestamp_fbs",
182 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800183 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800184 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800185 "//y2023/control_loops/superstructure:superstructure_output_fbs",
186 "//y2023/control_loops/superstructure:superstructure_position_fbs",
187 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800188 ],
189 target_compatible_with = ["@platforms//os:linux"],
190 deps = [
191 "//aos/events:aos_config",
192 "//frc971/autonomous:aos_config",
193 "//frc971/control_loops/drivetrain:aos_config",
194 "//frc971/input:aos_config",
195 "//frc971/wpilib:aos_config",
196 ],
197)
198
199[
200 jinja2_template(
201 name = "y2023_pi" + str(num) + ".json",
202 src = "y2023_pi_template.json",
203 parameters = {"NUM": str(num)},
204 target_compatible_with = ["@platforms//os:linux"],
205 )
206 for num in range(1, 6)
207]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800208
209cc_library(
210 name = "constants",
211 srcs = [
212 "constants.cc",
213 ],
214 hdrs = [
215 "constants.h",
216 ],
217 visibility = ["//visibility:public"],
218 deps = [
219 "//aos/mutex",
220 "//aos/network:team_number",
221 "//frc971:constants",
222 "//frc971/control_loops:pose",
223 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
224 "//frc971/shooter_interpolation:interpolation",
225 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800226 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u051c7002023-02-20 16:28:18 -0800227 "//y2023/control_loops/superstructure/roll:roll_plants",
228 "//y2023/control_loops/superstructure/wrist:wrist_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800229 "@com_github_google_glog//:glog",
230 "@com_google_absl//absl/base",
231 ],
232)
233
234cc_binary(
235 name = "wpilib_interface",
236 srcs = [
237 "wpilib_interface.cc",
238 ],
239 target_compatible_with = ["//tools/platforms/hardware:roborio"],
240 deps = [
241 ":constants",
242 "//aos:init",
243 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800244 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800245 "//aos/events:shm_event_loop",
246 "//aos/logging",
247 "//aos/stl_mutex",
248 "//aos/time",
249 "//aos/util:log_interval",
250 "//aos/util:phased_loop",
251 "//aos/util:wrapping_counter",
252 "//frc971/autonomous:auto_mode_fbs",
253 "//frc971/control_loops:control_loop",
254 "//frc971/control_loops:control_loops_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",
260 "//frc971/wpilib:drivetrain_writer",
261 "//frc971/wpilib:encoder_and_potentiometer",
262 "//frc971/wpilib:interrupt_edge_counting",
263 "//frc971/wpilib:joystick_sender",
264 "//frc971/wpilib:logging_fbs",
265 "//frc971/wpilib:loop_output_handler",
266 "//frc971/wpilib:pdp_fetcher",
267 "//frc971/wpilib:sensor_reader",
268 "//frc971/wpilib:wpilib_interface",
269 "//frc971/wpilib:wpilib_robot_base",
270 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800271 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800272 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800273 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800274 "//y2023/control_loops/superstructure:superstructure_output_fbs",
275 "//y2023/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",
292 "//frc971/input:action_joystick_input",
293 "//frc971/input:drivetrain_input",
294 "//frc971/input:joystick_input",
295 "//y2023/control_loops/drivetrain:drivetrain_base",
296 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
297 "//y2023/control_loops/superstructure:superstructure_status_fbs",
milind-udefab712023-02-20 22:22:02 -0800298 "//y2023/control_loops/superstructure/arm:generated_graph",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800299 ],
300)
301
302py_library(
303 name = "python_init",
304 srcs = ["__init__.py"],
305 target_compatible_with = ["@platforms//os:linux"],
306 visibility = ["//visibility:public"],
307)
308
309sh_binary(
310 name = "log_web_proxy",
311 srcs = ["log_web_proxy.sh"],
312 data = [
313 ":aos_config",
314 "//aos/network:log_web_proxy_main",
315 "//y2023/www:field_main_bundle.min.js",
316 "//y2023/www:files",
317 ],
318 target_compatible_with = ["@platforms//os:linux"],
319)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800320
321cc_binary(
322 name = "ssd_profiler",
323 srcs = [
324 "ssd_profiler.cc",
325 ],
326 deps = [
327 "//aos:init",
328 "//aos/time",
329 "@com_github_google_glog//:glog",
330 ],
331)