blob: 213a5af451096003e97346302d4fd627127a96e2 [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",
James Kuszmaul04a343c2023-02-20 16:38:22 -080044 "//y2023/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",
milind-u8e98cb92023-02-05 16:07:10 -080050 "//frc971/image_streamer:image_streamer",
Austin Schuh9f164e92022-12-29 16:15:28 -080051 ],
52 data = [
53 ":aos_config",
James Kuszmaul08a4d852023-02-22 16:57:54 -080054 "//frc971/rockpi:rockpi_config.json",
James Kuszmauld67f6d22023-02-05 17:37:25 -080055 "//y2023/constants:constants.json",
milind-u8e98cb92023-02-05 16:07:10 -080056 "//y2023/vision:image_streamer_start",
James Kuszmauld67f6d22023-02-05 17:37:25 -080057 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080058 ],
59 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080060 "//y2023/www:www_files",
milind-u8e98cb92023-02-05 16:07:10 -080061 "//frc971/image_streamer/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080062 ],
63 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080064 "//aos/network:message_bridge_client",
65 "//aos/network:message_bridge_server",
66 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080067 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080068 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080069 "//aos/events/logging:logger_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080070 ],
71 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
72 target_type = "pi",
73)
74
75aos_config(
76 name = "aos_config",
77 src = "y2023.json",
78 flatbuffers = [
79 "//aos/network:message_bridge_client_fbs",
80 "//aos/network:message_bridge_server_fbs",
81 "//aos/network:timestamp_fbs",
82 "//frc971/input:robot_state_fbs",
83 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080084 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080085 ],
86 target_compatible_with = ["@platforms//os:linux"],
87 visibility = ["//visibility:public"],
88 deps = [
89 ":config_imu",
90 ":config_logger",
91 ":config_pi1",
92 ":config_pi2",
93 ":config_pi3",
94 ":config_pi4",
95 ":config_roborio",
96 ],
97)
98
99[
100 aos_config(
101 name = "config_" + pi,
102 src = "y2023_" + pi + ".json",
103 flatbuffers = [
104 "//aos/network:message_bridge_client_fbs",
105 "//aos/network:message_bridge_server_fbs",
106 "//aos/network:timestamp_fbs",
107 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800108 "//y2023/constants:constants_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800109 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800110 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800111 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800112 "//frc971/vision:vision_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800113 "//y2023/localizer:visualization_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -0800114 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -0800115 ],
116 target_compatible_with = ["@platforms//os:linux"],
117 visibility = ["//visibility:public"],
118 deps = [
119 "//aos/events:aos_config",
120 "//frc971/control_loops/drivetrain:aos_config",
121 "//frc971/input:aos_config",
122 ],
123 )
124 for pi in [
125 "pi1",
126 "pi2",
127 "pi3",
128 "pi4",
129 ]
130]
131
132aos_config(
133 name = "config_imu",
134 src = "y2023_imu.json",
135 flatbuffers = [
136 "//aos/network:message_bridge_client_fbs",
137 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800138 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800139 "//aos/network:timestamp_fbs",
140 "//aos/network:remote_message_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800141 "//y2023/localizer:status_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800142 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
James Kuszmaul04a343c2023-02-20 16:38:22 -0800143 "//y2023/localizer:visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800144 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800145 ],
146 target_compatible_with = ["@platforms//os:linux"],
147 visibility = ["//visibility:public"],
148 deps = [
149 "//aos/events:aos_config",
150 "//frc971/control_loops/drivetrain:aos_config",
151 ],
152)
153
154aos_config(
155 name = "config_logger",
156 src = "y2023_logger.json",
157 flatbuffers = [
158 "//aos/network:message_bridge_client_fbs",
159 "//aos/network:message_bridge_server_fbs",
160 "//aos/network:timestamp_fbs",
161 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800162 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800163 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800164 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800165 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800166 ],
167 target_compatible_with = ["@platforms//os:linux"],
168 visibility = ["//visibility:public"],
169 deps = [
170 "//aos/events:aos_config",
171 "//frc971/control_loops/drivetrain:aos_config",
172 "//frc971/input:aos_config",
173 ],
174)
175
176aos_config(
177 name = "config_roborio",
178 src = "y2023_roborio.json",
179 flatbuffers = [
180 "//aos/network:remote_message_fbs",
181 "//aos/network:message_bridge_client_fbs",
182 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800183 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800184 "//aos/network:timestamp_fbs",
185 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800186 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800187 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800188 "//y2023/control_loops/superstructure:superstructure_output_fbs",
189 "//y2023/control_loops/superstructure:superstructure_position_fbs",
190 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800191 ],
192 target_compatible_with = ["@platforms//os:linux"],
193 deps = [
194 "//aos/events:aos_config",
195 "//frc971/autonomous:aos_config",
196 "//frc971/control_loops/drivetrain:aos_config",
197 "//frc971/input:aos_config",
198 "//frc971/wpilib:aos_config",
199 ],
200)
201
202[
203 jinja2_template(
204 name = "y2023_pi" + str(num) + ".json",
205 src = "y2023_pi_template.json",
206 parameters = {"NUM": str(num)},
207 target_compatible_with = ["@platforms//os:linux"],
208 )
209 for num in range(1, 6)
210]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800211
212cc_library(
213 name = "constants",
214 srcs = [
215 "constants.cc",
216 ],
217 hdrs = [
218 "constants.h",
219 ],
220 visibility = ["//visibility:public"],
221 deps = [
222 "//aos/mutex",
223 "//aos/network:team_number",
224 "//frc971:constants",
225 "//frc971/control_loops:pose",
226 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
227 "//frc971/shooter_interpolation:interpolation",
228 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
milind-u37385182023-02-20 15:07:28 -0800229 "//y2023/control_loops/superstructure/arm:arm_constants",
milind-u051c7002023-02-20 16:28:18 -0800230 "//y2023/control_loops/superstructure/roll:roll_plants",
231 "//y2023/control_loops/superstructure/wrist:wrist_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800232 "@com_github_google_glog//:glog",
233 "@com_google_absl//absl/base",
234 ],
235)
236
237cc_binary(
238 name = "wpilib_interface",
239 srcs = [
240 "wpilib_interface.cc",
241 ],
242 target_compatible_with = ["//tools/platforms/hardware:roborio"],
243 deps = [
244 ":constants",
245 "//aos:init",
246 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800247 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800248 "//aos/events:shm_event_loop",
249 "//aos/logging",
250 "//aos/stl_mutex",
251 "//aos/time",
252 "//aos/util:log_interval",
253 "//aos/util:phased_loop",
254 "//aos/util:wrapping_counter",
255 "//frc971/autonomous:auto_mode_fbs",
256 "//frc971/control_loops:control_loop",
257 "//frc971/control_loops:control_loops_fbs",
258 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
259 "//frc971/input:robot_state_fbs",
260 "//frc971/queues:gyro_fbs",
261 "//frc971/wpilib:ADIS16448",
262 "//frc971/wpilib:buffered_pcm",
263 "//frc971/wpilib:drivetrain_writer",
264 "//frc971/wpilib:encoder_and_potentiometer",
265 "//frc971/wpilib:interrupt_edge_counting",
266 "//frc971/wpilib:joystick_sender",
267 "//frc971/wpilib:logging_fbs",
268 "//frc971/wpilib:loop_output_handler",
269 "//frc971/wpilib:pdp_fetcher",
270 "//frc971/wpilib:sensor_reader",
271 "//frc971/wpilib:wpilib_interface",
272 "//frc971/wpilib:wpilib_robot_base",
273 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800274 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800275 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800276 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800277 "//y2023/control_loops/superstructure:superstructure_output_fbs",
278 "//y2023/control_loops/superstructure:superstructure_position_fbs",
279 ],
280)
281
282cc_binary(
283 name = "joystick_reader",
284 srcs = [
285 ":joystick_reader.cc",
286 ],
287 deps = [
288 ":constants",
289 "//aos:init",
290 "//aos/actions:action_lib",
291 "//aos/logging",
292 "//frc971/autonomous:auto_fbs",
293 "//frc971/autonomous:base_autonomous_actor",
294 "//frc971/control_loops:profiled_subsystem_fbs",
295 "//frc971/input:action_joystick_input",
296 "//frc971/input:drivetrain_input",
297 "//frc971/input:joystick_input",
298 "//y2023/control_loops/drivetrain:drivetrain_base",
299 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
300 "//y2023/control_loops/superstructure:superstructure_status_fbs",
milind-udefab712023-02-20 22:22:02 -0800301 "//y2023/control_loops/superstructure/arm:generated_graph",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800302 ],
303)
304
305py_library(
306 name = "python_init",
307 srcs = ["__init__.py"],
308 target_compatible_with = ["@platforms//os:linux"],
309 visibility = ["//visibility:public"],
310)
311
312sh_binary(
313 name = "log_web_proxy",
314 srcs = ["log_web_proxy.sh"],
315 data = [
316 ":aos_config",
317 "//aos/network:log_web_proxy_main",
318 "//y2023/www:field_main_bundle.min.js",
319 "//y2023/www:files",
320 ],
321 target_compatible_with = ["@platforms//os:linux"],
322)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800323
324cc_binary(
325 name = "ssd_profiler",
326 srcs = [
327 "ssd_profiler.cc",
328 ],
329 deps = [
330 "//aos:init",
331 "//aos/time",
332 "@com_github_google_glog//:glog",
333 ],
334)