blob: ec30c34489c1104d5f044bca1ddcb2d49a00c7a1 [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",
9 ],
10 data = [
11 ":aos_config",
Xander Yee1ad2f7b2023-02-21 14:46:56 -080012 "//aos/starter:roborio_irq_config.json",
Ravago Jones2060ee62023-02-03 18:12:24 -080013 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
14 "@ctre_phoenix_cci_athena//:shared_libraries",
15 "@ctre_phoenixpro_api_cpp_athena//:shared_libraries",
16 "@ctre_phoenixpro_tools_athena//:shared_libraries",
17 ],
18 dirs = [
19 "//y2023/www:www_files",
20 ],
21 start_binaries = [
22 "//aos/events/logging:logger_main",
23 "//aos/network:web_proxy_main",
Xander Yee1ad2f7b2023-02-21 14:46:56 -080024 "//aos/starter:irq_affinity",
Ravago Jones2060ee62023-02-03 18:12:24 -080025 ":joystick_reader",
26 ":wpilib_interface",
27 "//aos/network:message_bridge_client",
28 "//aos/network:message_bridge_server",
29 "//y2023/control_loops/drivetrain:drivetrain",
30 "//y2023/control_loops/drivetrain:trajectory_generator",
31 "//y2023/control_loops/superstructure:superstructure",
32 ],
33 target_compatible_with = ["@platforms//os:linux"],
34)
35
36robot_downloader(
Austin Schuh9f164e92022-12-29 16:15:28 -080037 name = "pi_download",
38 binaries = [
James Kuszmaul7e958812023-02-11 15:34:31 -080039 "//frc971/vision:intrinsics_calibration",
Xander Yee1ad2f7b2023-02-21 14:46:56 -080040 "//aos/starter:irq_affinity",
James Kuszmaul77d536c2023-02-11 17:30:59 -080041 "//aos/util:foxglove_websocket",
Austin Schuh9f164e92022-12-29 16:15:28 -080042 "//y2023/vision:viewer",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080043 "//y2023/vision:aprilrobotics",
Austin Schuh9f164e92022-12-29 16:15:28 -080044 "//y2022/localizer:localizer_main",
James Kuszmauld67f6d22023-02-05 17:37:25 -080045 "//y2023/constants:constants_sender",
James Kuszmaul77d536c2023-02-11 17:30:59 -080046 "//y2023/vision:foxglove_image_converter",
Maxwell Hendersonad312342023-01-10 12:07:47 -080047 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080048 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080049 "//y2023/rockpi:imu_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080050 ],
51 data = [
52 ":aos_config",
James Kuszmauld67f6d22023-02-05 17:37:25 -080053 "//y2023/constants:constants.json",
54 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080055 ],
56 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080057 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080058 ],
59 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080060 "//aos/network:message_bridge_client",
61 "//aos/network:message_bridge_server",
62 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080063 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080064 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080065 "//aos/events/logging:logger_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080066 ],
67 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
68 target_type = "pi",
69)
70
71aos_config(
72 name = "aos_config",
73 src = "y2023.json",
74 flatbuffers = [
75 "//aos/network:message_bridge_client_fbs",
76 "//aos/network:message_bridge_server_fbs",
77 "//aos/network:timestamp_fbs",
78 "//frc971/input:robot_state_fbs",
79 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080080 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080081 ],
82 target_compatible_with = ["@platforms//os:linux"],
83 visibility = ["//visibility:public"],
84 deps = [
85 ":config_imu",
86 ":config_logger",
87 ":config_pi1",
88 ":config_pi2",
89 ":config_pi3",
90 ":config_pi4",
91 ":config_roborio",
92 ],
93)
94
95[
96 aos_config(
97 name = "config_" + pi,
98 src = "y2023_" + pi + ".json",
99 flatbuffers = [
100 "//aos/network:message_bridge_client_fbs",
101 "//aos/network:message_bridge_server_fbs",
102 "//aos/network:timestamp_fbs",
103 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800104 "//y2023/constants:constants_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800105 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800106 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800107 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800108 "//frc971/vision:vision_fbs",
Yash Chainani728ae222023-02-04 19:48:12 -0800109 "//y2023/vision:april_debug_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800110 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800111 ],
112 target_compatible_with = ["@platforms//os:linux"],
113 visibility = ["//visibility:public"],
114 deps = [
115 "//aos/events:aos_config",
116 "//frc971/control_loops/drivetrain:aos_config",
117 "//frc971/input:aos_config",
118 ],
119 )
120 for pi in [
121 "pi1",
122 "pi2",
123 "pi3",
124 "pi4",
125 ]
126]
127
128aos_config(
129 name = "config_imu",
130 src = "y2023_imu.json",
131 flatbuffers = [
132 "//aos/network:message_bridge_client_fbs",
133 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800134 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800135 "//aos/network:timestamp_fbs",
136 "//aos/network:remote_message_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800137 "//y2022/localizer:localizer_status_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800138 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800139 "//y2022/localizer:localizer_visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800140 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800141 ],
142 target_compatible_with = ["@platforms//os:linux"],
143 visibility = ["//visibility:public"],
144 deps = [
145 "//aos/events:aos_config",
146 "//frc971/control_loops/drivetrain:aos_config",
147 ],
148)
149
150aos_config(
151 name = "config_logger",
152 src = "y2023_logger.json",
153 flatbuffers = [
154 "//aos/network:message_bridge_client_fbs",
155 "//aos/network:message_bridge_server_fbs",
156 "//aos/network:timestamp_fbs",
157 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800158 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800159 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800160 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800161 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800162 ],
163 target_compatible_with = ["@platforms//os:linux"],
164 visibility = ["//visibility:public"],
165 deps = [
166 "//aos/events:aos_config",
167 "//frc971/control_loops/drivetrain:aos_config",
168 "//frc971/input:aos_config",
169 ],
170)
171
172aos_config(
173 name = "config_roborio",
174 src = "y2023_roborio.json",
175 flatbuffers = [
176 "//aos/network:remote_message_fbs",
177 "//aos/network:message_bridge_client_fbs",
178 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800179 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800180 "//aos/network:timestamp_fbs",
181 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800182 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800183 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800184 "//y2023/control_loops/superstructure:superstructure_output_fbs",
185 "//y2023/control_loops/superstructure:superstructure_position_fbs",
186 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800187 ],
188 target_compatible_with = ["@platforms//os:linux"],
189 deps = [
190 "//aos/events:aos_config",
191 "//frc971/autonomous:aos_config",
192 "//frc971/control_loops/drivetrain:aos_config",
193 "//frc971/input:aos_config",
194 "//frc971/wpilib:aos_config",
195 ],
196)
197
198[
199 jinja2_template(
200 name = "y2023_pi" + str(num) + ".json",
201 src = "y2023_pi_template.json",
202 parameters = {"NUM": str(num)},
203 target_compatible_with = ["@platforms//os:linux"],
204 )
205 for num in range(1, 6)
206]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800207
208cc_library(
209 name = "constants",
210 srcs = [
211 "constants.cc",
212 ],
213 hdrs = [
214 "constants.h",
215 ],
216 visibility = ["//visibility:public"],
217 deps = [
218 "//aos/mutex",
219 "//aos/network:team_number",
220 "//frc971:constants",
221 "//frc971/control_loops:pose",
222 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
223 "//frc971/shooter_interpolation:interpolation",
224 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800225 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u051c7002023-02-20 16:28:18 -0800226 "//y2023/control_loops/superstructure/roll:roll_plants",
227 "//y2023/control_loops/superstructure/wrist:wrist_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800228 "@com_github_google_glog//:glog",
229 "@com_google_absl//absl/base",
230 ],
231)
232
233cc_binary(
234 name = "wpilib_interface",
235 srcs = [
236 "wpilib_interface.cc",
237 ],
238 target_compatible_with = ["//tools/platforms/hardware:roborio"],
239 deps = [
240 ":constants",
241 "//aos:init",
242 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800243 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800244 "//aos/events:shm_event_loop",
245 "//aos/logging",
246 "//aos/stl_mutex",
247 "//aos/time",
248 "//aos/util:log_interval",
249 "//aos/util:phased_loop",
250 "//aos/util:wrapping_counter",
251 "//frc971/autonomous:auto_mode_fbs",
252 "//frc971/control_loops:control_loop",
253 "//frc971/control_loops:control_loops_fbs",
254 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
255 "//frc971/input:robot_state_fbs",
256 "//frc971/queues:gyro_fbs",
257 "//frc971/wpilib:ADIS16448",
258 "//frc971/wpilib:buffered_pcm",
259 "//frc971/wpilib:drivetrain_writer",
260 "//frc971/wpilib:encoder_and_potentiometer",
261 "//frc971/wpilib:interrupt_edge_counting",
262 "//frc971/wpilib:joystick_sender",
263 "//frc971/wpilib:logging_fbs",
264 "//frc971/wpilib:loop_output_handler",
265 "//frc971/wpilib:pdp_fetcher",
266 "//frc971/wpilib:sensor_reader",
267 "//frc971/wpilib:wpilib_interface",
268 "//frc971/wpilib:wpilib_robot_base",
269 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800270 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800271 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800272 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800273 "//y2023/control_loops/superstructure:superstructure_output_fbs",
274 "//y2023/control_loops/superstructure:superstructure_position_fbs",
275 ],
276)
277
278cc_binary(
279 name = "joystick_reader",
280 srcs = [
281 ":joystick_reader.cc",
282 ],
283 deps = [
284 ":constants",
285 "//aos:init",
286 "//aos/actions:action_lib",
287 "//aos/logging",
288 "//frc971/autonomous:auto_fbs",
289 "//frc971/autonomous:base_autonomous_actor",
290 "//frc971/control_loops:profiled_subsystem_fbs",
291 "//frc971/input:action_joystick_input",
292 "//frc971/input:drivetrain_input",
293 "//frc971/input:joystick_input",
294 "//y2023/control_loops/drivetrain:drivetrain_base",
295 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
296 "//y2023/control_loops/superstructure:superstructure_status_fbs",
milind-udefab712023-02-20 22:22:02 -0800297 "//y2023/control_loops/superstructure/arm:generated_graph",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800298 ],
299)
300
301py_library(
302 name = "python_init",
303 srcs = ["__init__.py"],
304 target_compatible_with = ["@platforms//os:linux"],
305 visibility = ["//visibility:public"],
306)
307
308sh_binary(
309 name = "log_web_proxy",
310 srcs = ["log_web_proxy.sh"],
311 data = [
312 ":aos_config",
313 "//aos/network:log_web_proxy_main",
314 "//y2023/www:field_main_bundle.min.js",
315 "//y2023/www:files",
316 ],
317 target_compatible_with = ["@platforms//os:linux"],
318)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800319
320cc_binary(
321 name = "ssd_profiler",
322 srcs = [
323 "ssd_profiler.cc",
324 ],
325 deps = [
326 "//aos:init",
327 "//aos/time",
328 "@com_github_google_glog//:glog",
329 ],
330)