blob: d5f85ca71be4edbbe7221a7869c68ade2b027924 [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",
Ravago Jones2060ee62023-02-03 18:12:24 -080012 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
13 "@ctre_phoenix_cci_athena//:shared_libraries",
14 "@ctre_phoenixpro_api_cpp_athena//:shared_libraries",
15 "@ctre_phoenixpro_tools_athena//:shared_libraries",
16 ],
17 dirs = [
18 "//y2023/www:www_files",
19 ],
20 start_binaries = [
21 "//aos/events/logging:logger_main",
22 "//aos/network:web_proxy_main",
23 ":joystick_reader",
24 ":wpilib_interface",
25 "//aos/network:message_bridge_client",
26 "//aos/network:message_bridge_server",
27 "//y2023/control_loops/drivetrain:drivetrain",
28 "//y2023/control_loops/drivetrain:trajectory_generator",
29 "//y2023/control_loops/superstructure:superstructure",
30 ],
31 target_compatible_with = ["@platforms//os:linux"],
32)
33
34robot_downloader(
Austin Schuh9f164e92022-12-29 16:15:28 -080035 name = "pi_download",
36 binaries = [
James Kuszmaul7e958812023-02-11 15:34:31 -080037 "//frc971/vision:intrinsics_calibration",
James Kuszmaul77d536c2023-02-11 17:30:59 -080038 "//aos/util:foxglove_websocket",
Austin Schuh9f164e92022-12-29 16:15:28 -080039 "//y2023/vision:viewer",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080040 "//y2023/vision:aprilrobotics",
Austin Schuh9f164e92022-12-29 16:15:28 -080041 "//y2022/localizer:localizer_main",
James Kuszmauld67f6d22023-02-05 17:37:25 -080042 "//y2023/constants:constants_sender",
James Kuszmaul77d536c2023-02-11 17:30:59 -080043 "//y2023/vision:foxglove_image_converter",
Maxwell Hendersonad312342023-01-10 12:07:47 -080044 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080045 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080046 "//y2023/rockpi:imu_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080047 ],
48 data = [
49 ":aos_config",
James Kuszmauld67f6d22023-02-05 17:37:25 -080050 "//y2023/constants:constants.json",
51 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080052 ],
53 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080054 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080055 ],
56 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080057 "//aos/network:message_bridge_client",
58 "//aos/network:message_bridge_server",
59 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080060 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080061 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080062 "//aos/events/logging:logger_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080063 ],
64 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
65 target_type = "pi",
66)
67
68aos_config(
69 name = "aos_config",
70 src = "y2023.json",
71 flatbuffers = [
72 "//aos/network:message_bridge_client_fbs",
73 "//aos/network:message_bridge_server_fbs",
74 "//aos/network:timestamp_fbs",
75 "//frc971/input:robot_state_fbs",
76 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080077 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080078 ],
79 target_compatible_with = ["@platforms//os:linux"],
80 visibility = ["//visibility:public"],
81 deps = [
82 ":config_imu",
83 ":config_logger",
84 ":config_pi1",
85 ":config_pi2",
86 ":config_pi3",
87 ":config_pi4",
88 ":config_roborio",
89 ],
90)
91
92[
93 aos_config(
94 name = "config_" + pi,
95 src = "y2023_" + pi + ".json",
96 flatbuffers = [
97 "//aos/network:message_bridge_client_fbs",
98 "//aos/network:message_bridge_server_fbs",
99 "//aos/network:timestamp_fbs",
100 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800101 "//y2023/constants:constants_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800102 "//y2022/localizer:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800103 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800104 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800105 "//frc971/vision:vision_fbs",
Yash Chainani728ae222023-02-04 19:48:12 -0800106 "//y2023/vision:april_debug_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800107 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800108 ],
109 target_compatible_with = ["@platforms//os:linux"],
110 visibility = ["//visibility:public"],
111 deps = [
112 "//aos/events:aos_config",
113 "//frc971/control_loops/drivetrain:aos_config",
114 "//frc971/input:aos_config",
115 ],
116 )
117 for pi in [
118 "pi1",
119 "pi2",
120 "pi3",
121 "pi4",
122 ]
123]
124
125aos_config(
126 name = "config_imu",
127 src = "y2023_imu.json",
128 flatbuffers = [
129 "//aos/network:message_bridge_client_fbs",
130 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800131 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800132 "//aos/network:timestamp_fbs",
133 "//aos/network:remote_message_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800134 "//y2022/localizer:localizer_status_fbs",
135 "//y2022/localizer:localizer_output_fbs",
136 "//y2022/localizer:localizer_visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800137 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800138 ],
139 target_compatible_with = ["@platforms//os:linux"],
140 visibility = ["//visibility:public"],
141 deps = [
142 "//aos/events:aos_config",
143 "//frc971/control_loops/drivetrain:aos_config",
144 ],
145)
146
147aos_config(
148 name = "config_logger",
149 src = "y2023_logger.json",
150 flatbuffers = [
151 "//aos/network:message_bridge_client_fbs",
152 "//aos/network:message_bridge_server_fbs",
153 "//aos/network:timestamp_fbs",
154 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800155 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800156 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800157 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800158 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800159 ],
160 target_compatible_with = ["@platforms//os:linux"],
161 visibility = ["//visibility:public"],
162 deps = [
163 "//aos/events:aos_config",
164 "//frc971/control_loops/drivetrain:aos_config",
165 "//frc971/input:aos_config",
166 ],
167)
168
169aos_config(
170 name = "config_roborio",
171 src = "y2023_roborio.json",
172 flatbuffers = [
173 "//aos/network:remote_message_fbs",
174 "//aos/network:message_bridge_client_fbs",
175 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800176 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800177 "//aos/network:timestamp_fbs",
178 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800179 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800180 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800181 "//y2023/control_loops/superstructure:superstructure_output_fbs",
182 "//y2023/control_loops/superstructure:superstructure_position_fbs",
183 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800184 ],
185 target_compatible_with = ["@platforms//os:linux"],
186 deps = [
187 "//aos/events:aos_config",
188 "//frc971/autonomous:aos_config",
189 "//frc971/control_loops/drivetrain:aos_config",
190 "//frc971/input:aos_config",
191 "//frc971/wpilib:aos_config",
192 ],
193)
194
195[
196 jinja2_template(
197 name = "y2023_pi" + str(num) + ".json",
198 src = "y2023_pi_template.json",
199 parameters = {"NUM": str(num)},
200 target_compatible_with = ["@platforms//os:linux"],
201 )
202 for num in range(1, 6)
203]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800204
205cc_library(
206 name = "constants",
207 srcs = [
208 "constants.cc",
209 ],
210 hdrs = [
211 "constants.h",
212 ],
213 visibility = ["//visibility:public"],
214 deps = [
215 "//aos/mutex",
216 "//aos/network:team_number",
217 "//frc971:constants",
218 "//frc971/control_loops:pose",
219 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
220 "//frc971/shooter_interpolation:interpolation",
221 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800222 "//y2023/control_loops/superstructure/arm:arm_constants",
Maxwell Hendersonad312342023-01-10 12:07:47 -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",
Ravago Jones2060ee62023-02-03 18:12:24 -0800238 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800239 "//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/autonomous:auto_mode_fbs",
247 "//frc971/control_loops:control_loop",
248 "//frc971/control_loops:control_loops_fbs",
249 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
250 "//frc971/input:robot_state_fbs",
251 "//frc971/queues:gyro_fbs",
252 "//frc971/wpilib:ADIS16448",
253 "//frc971/wpilib:buffered_pcm",
254 "//frc971/wpilib:drivetrain_writer",
255 "//frc971/wpilib:encoder_and_potentiometer",
256 "//frc971/wpilib:interrupt_edge_counting",
257 "//frc971/wpilib:joystick_sender",
258 "//frc971/wpilib:logging_fbs",
259 "//frc971/wpilib:loop_output_handler",
260 "//frc971/wpilib:pdp_fetcher",
261 "//frc971/wpilib:sensor_reader",
262 "//frc971/wpilib:wpilib_interface",
263 "//frc971/wpilib:wpilib_robot_base",
264 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800265 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800266 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800267 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800268 "//y2023/control_loops/superstructure:superstructure_output_fbs",
269 "//y2023/control_loops/superstructure:superstructure_position_fbs",
270 ],
271)
272
273cc_binary(
274 name = "joystick_reader",
275 srcs = [
276 ":joystick_reader.cc",
277 ],
278 deps = [
279 ":constants",
280 "//aos:init",
281 "//aos/actions:action_lib",
282 "//aos/logging",
283 "//frc971/autonomous:auto_fbs",
284 "//frc971/autonomous:base_autonomous_actor",
285 "//frc971/control_loops:profiled_subsystem_fbs",
286 "//frc971/input:action_joystick_input",
287 "//frc971/input:drivetrain_input",
288 "//frc971/input:joystick_input",
289 "//y2023/control_loops/drivetrain:drivetrain_base",
290 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
291 "//y2023/control_loops/superstructure:superstructure_status_fbs",
292 ],
293)
294
295py_library(
296 name = "python_init",
297 srcs = ["__init__.py"],
298 target_compatible_with = ["@platforms//os:linux"],
299 visibility = ["//visibility:public"],
300)
301
302sh_binary(
303 name = "log_web_proxy",
304 srcs = ["log_web_proxy.sh"],
305 data = [
306 ":aos_config",
307 "//aos/network:log_web_proxy_main",
308 "//y2023/www:field_main_bundle.min.js",
309 "//y2023/www:files",
310 ],
311 target_compatible_with = ["@platforms//os:linux"],
312)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800313
314cc_binary(
315 name = "ssd_profiler",
316 srcs = [
317 "ssd_profiler.cc",
318 ],
319 deps = [
320 "//aos:init",
321 "//aos/time",
322 "@com_github_google_glog//:glog",
323 ],
324)