blob: 09dc4ed93373a72570500fbdbb253e6c805321b9 [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",
James Kuszmaule01ae1e2023-02-25 20:54:06 -080045 "//aos/events:aos_timing_report_streamer",
James Kuszmaul04a343c2023-02-20 16:38:22 -080046 "//y2023/localizer:localizer_main",
James Kuszmauld67f6d22023-02-05 17:37:25 -080047 "//y2023/constants:constants_sender",
James Kuszmaul77d536c2023-02-11 17:30:59 -080048 "//y2023/vision:foxglove_image_converter",
Maxwell Hendersonad312342023-01-10 12:07:47 -080049 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080050 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080051 "//y2023/rockpi:imu_main",
milind-u8e98cb92023-02-05 16:07:10 -080052 "//frc971/image_streamer:image_streamer",
Austin Schuh9f164e92022-12-29 16:15:28 -080053 ],
54 data = [
55 ":aos_config",
James Kuszmaul08a4d852023-02-22 16:57:54 -080056 "//frc971/rockpi:rockpi_config.json",
James Kuszmauld67f6d22023-02-05 17:37:25 -080057 "//y2023/constants:constants.json",
milind-u8e98cb92023-02-05 16:07:10 -080058 "//y2023/vision:image_streamer_start",
James Kuszmauld67f6d22023-02-05 17:37:25 -080059 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080060 ],
61 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080062 "//y2023/www:www_files",
milind-u8e98cb92023-02-05 16:07:10 -080063 "//frc971/image_streamer/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080064 ],
65 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080066 "//aos/network:message_bridge_client",
67 "//aos/network:message_bridge_server",
68 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080069 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080070 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080071 "//aos/events/logging:logger_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080072 ],
73 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
74 target_type = "pi",
75)
76
77aos_config(
78 name = "aos_config",
79 src = "y2023.json",
80 flatbuffers = [
81 "//aos/network:message_bridge_client_fbs",
82 "//aos/network:message_bridge_server_fbs",
83 "//aos/network:timestamp_fbs",
84 "//frc971/input:robot_state_fbs",
85 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080086 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080087 ],
88 target_compatible_with = ["@platforms//os:linux"],
89 visibility = ["//visibility:public"],
90 deps = [
91 ":config_imu",
92 ":config_logger",
93 ":config_pi1",
94 ":config_pi2",
95 ":config_pi3",
96 ":config_pi4",
97 ":config_roborio",
98 ],
99)
100
101[
102 aos_config(
103 name = "config_" + pi,
104 src = "y2023_" + pi + ".json",
105 flatbuffers = [
106 "//aos/network:message_bridge_client_fbs",
107 "//aos/network:message_bridge_server_fbs",
108 "//aos/network:timestamp_fbs",
109 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800110 "//y2023/constants:constants_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800111 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800112 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800113 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800114 "//frc971/vision:vision_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800115 "//y2023/localizer:visualization_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800116 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800117 ],
118 target_compatible_with = ["@platforms//os:linux"],
119 visibility = ["//visibility:public"],
120 deps = [
121 "//aos/events:aos_config",
122 "//frc971/control_loops/drivetrain:aos_config",
123 "//frc971/input:aos_config",
124 ],
125 )
126 for pi in [
127 "pi1",
128 "pi2",
129 "pi3",
130 "pi4",
131 ]
132]
133
134aos_config(
135 name = "config_imu",
136 src = "y2023_imu.json",
137 flatbuffers = [
138 "//aos/network:message_bridge_client_fbs",
139 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800140 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800141 "//aos/network:timestamp_fbs",
142 "//aos/network:remote_message_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800143 "//y2023/localizer:status_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800144 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800145 "//y2023/localizer:visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800146 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800147 ],
148 target_compatible_with = ["@platforms//os:linux"],
149 visibility = ["//visibility:public"],
150 deps = [
151 "//aos/events:aos_config",
152 "//frc971/control_loops/drivetrain:aos_config",
153 ],
154)
155
156aos_config(
157 name = "config_logger",
158 src = "y2023_logger.json",
159 flatbuffers = [
160 "//aos/network:message_bridge_client_fbs",
161 "//aos/network:message_bridge_server_fbs",
162 "//aos/network:timestamp_fbs",
163 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800164 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800165 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800166 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800167 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800168 ],
169 target_compatible_with = ["@platforms//os:linux"],
170 visibility = ["//visibility:public"],
171 deps = [
172 "//aos/events:aos_config",
173 "//frc971/control_loops/drivetrain:aos_config",
174 "//frc971/input:aos_config",
175 ],
176)
177
178aos_config(
179 name = "config_roborio",
180 src = "y2023_roborio.json",
181 flatbuffers = [
182 "//aos/network:remote_message_fbs",
183 "//aos/network:message_bridge_client_fbs",
184 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800185 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800186 "//aos/network:timestamp_fbs",
187 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800188 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800189 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800190 "//y2023/control_loops/superstructure:superstructure_output_fbs",
191 "//y2023/control_loops/superstructure:superstructure_position_fbs",
192 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800193 ],
194 target_compatible_with = ["@platforms//os:linux"],
195 deps = [
196 "//aos/events:aos_config",
197 "//frc971/autonomous:aos_config",
198 "//frc971/control_loops/drivetrain:aos_config",
199 "//frc971/input:aos_config",
200 "//frc971/wpilib:aos_config",
201 ],
202)
203
204[
205 jinja2_template(
206 name = "y2023_pi" + str(num) + ".json",
207 src = "y2023_pi_template.json",
208 parameters = {"NUM": str(num)},
209 target_compatible_with = ["@platforms//os:linux"],
210 )
211 for num in range(1, 6)
212]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800213
214cc_library(
215 name = "constants",
216 srcs = [
217 "constants.cc",
218 ],
219 hdrs = [
220 "constants.h",
221 ],
222 visibility = ["//visibility:public"],
223 deps = [
224 "//aos/mutex",
225 "//aos/network:team_number",
226 "//frc971:constants",
227 "//frc971/control_loops:pose",
228 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
229 "//frc971/shooter_interpolation:interpolation",
230 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800231 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u051c7002023-02-20 16:28:18 -0800232 "//y2023/control_loops/superstructure/roll:roll_plants",
233 "//y2023/control_loops/superstructure/wrist:wrist_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800234 "@com_github_google_glog//:glog",
235 "@com_google_absl//absl/base",
236 ],
237)
238
239cc_binary(
240 name = "wpilib_interface",
241 srcs = [
242 "wpilib_interface.cc",
243 ],
244 target_compatible_with = ["//tools/platforms/hardware:roborio"],
245 deps = [
246 ":constants",
247 "//aos:init",
248 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800249 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800250 "//aos/events:shm_event_loop",
251 "//aos/logging",
252 "//aos/stl_mutex",
253 "//aos/time",
254 "//aos/util:log_interval",
255 "//aos/util:phased_loop",
256 "//aos/util:wrapping_counter",
257 "//frc971/autonomous:auto_mode_fbs",
258 "//frc971/control_loops:control_loop",
259 "//frc971/control_loops:control_loops_fbs",
260 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
261 "//frc971/input:robot_state_fbs",
262 "//frc971/queues:gyro_fbs",
263 "//frc971/wpilib:ADIS16448",
264 "//frc971/wpilib:buffered_pcm",
265 "//frc971/wpilib:drivetrain_writer",
266 "//frc971/wpilib:encoder_and_potentiometer",
267 "//frc971/wpilib:interrupt_edge_counting",
268 "//frc971/wpilib:joystick_sender",
269 "//frc971/wpilib:logging_fbs",
270 "//frc971/wpilib:loop_output_handler",
271 "//frc971/wpilib:pdp_fetcher",
272 "//frc971/wpilib:sensor_reader",
273 "//frc971/wpilib:wpilib_interface",
274 "//frc971/wpilib:wpilib_robot_base",
275 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800276 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800277 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800278 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800279 "//y2023/control_loops/superstructure:superstructure_output_fbs",
280 "//y2023/control_loops/superstructure:superstructure_position_fbs",
281 ],
282)
283
284cc_binary(
285 name = "joystick_reader",
286 srcs = [
287 ":joystick_reader.cc",
288 ],
289 deps = [
290 ":constants",
291 "//aos:init",
292 "//aos/actions:action_lib",
293 "//aos/logging",
294 "//frc971/autonomous:auto_fbs",
295 "//frc971/autonomous:base_autonomous_actor",
296 "//frc971/control_loops:profiled_subsystem_fbs",
297 "//frc971/input:action_joystick_input",
298 "//frc971/input:drivetrain_input",
299 "//frc971/input:joystick_input",
300 "//y2023/control_loops/drivetrain:drivetrain_base",
301 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
302 "//y2023/control_loops/superstructure:superstructure_status_fbs",
milind-udefab712023-02-20 22:22:02 -0800303 "//y2023/control_loops/superstructure/arm:generated_graph",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800304 ],
305)
306
307py_library(
308 name = "python_init",
309 srcs = ["__init__.py"],
310 target_compatible_with = ["@platforms//os:linux"],
311 visibility = ["//visibility:public"],
312)
313
314sh_binary(
315 name = "log_web_proxy",
316 srcs = ["log_web_proxy.sh"],
317 data = [
318 ":aos_config",
319 "//aos/network:log_web_proxy_main",
320 "//y2023/www:field_main_bundle.min.js",
321 "//y2023/www:files",
322 ],
323 target_compatible_with = ["@platforms//os:linux"],
324)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800325
326cc_binary(
327 name = "ssd_profiler",
328 srcs = [
329 "ssd_profiler.cc",
330 ],
331 deps = [
332 "//aos:init",
333 "//aos/time",
334 "@com_github_google_glog//:glog",
335 ],
336)