blob: 014f957e22ab4cbc8a47a8be1555cf4ef18d5b83 [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(
6 name = "pi_download",
7 binaries = [
James Kuszmaul7e958812023-02-11 15:34:31 -08008 "//frc971/vision:intrinsics_calibration",
Austin Schuh9f164e92022-12-29 16:15:28 -08009 "//y2023/vision:viewer",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080010 "//y2023/vision:aprilrobotics",
Austin Schuh9f164e92022-12-29 16:15:28 -080011 "//y2022/localizer:localizer_main",
James Kuszmauld67f6d22023-02-05 17:37:25 -080012 "//y2023/constants:constants_sender",
Maxwell Hendersonad312342023-01-10 12:07:47 -080013 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080014 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080015 "//y2023/rockpi:imu_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080016 ],
17 data = [
18 ":aos_config",
Maxwell Hendersonad312342023-01-10 12:07:47 -080019 ":message_bridge_client.sh",
James Kuszmauld67f6d22023-02-05 17:37:25 -080020 "//y2023/constants:constants.json",
21 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080022 ],
23 dirs = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080024 "//y2023/www:www_files",
Austin Schuh9f164e92022-12-29 16:15:28 -080025 ],
26 start_binaries = [
Austin Schuh9f164e92022-12-29 16:15:28 -080027 "//aos/network:message_bridge_client",
28 "//aos/network:message_bridge_server",
29 "//aos/network:web_proxy_main",
Austin Schuh3e1d3b62023-01-08 13:52:31 -080030 "//aos/starter:irq_affinity",
Austin Schuh9f164e92022-12-29 16:15:28 -080031 "//y2023/vision:camera_reader",
Maxwell Hendersonad312342023-01-10 12:07:47 -080032 "//aos/events/logging:logger_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080033 ],
34 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
35 target_type = "pi",
36)
37
38aos_config(
39 name = "aos_config",
40 src = "y2023.json",
41 flatbuffers = [
42 "//aos/network:message_bridge_client_fbs",
43 "//aos/network:message_bridge_server_fbs",
44 "//aos/network:timestamp_fbs",
45 "//frc971/input:robot_state_fbs",
46 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080047 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080048 ],
49 target_compatible_with = ["@platforms//os:linux"],
50 visibility = ["//visibility:public"],
51 deps = [
52 ":config_imu",
53 ":config_logger",
54 ":config_pi1",
55 ":config_pi2",
56 ":config_pi3",
57 ":config_pi4",
58 ":config_roborio",
59 ],
60)
61
62[
63 aos_config(
64 name = "config_" + pi,
65 src = "y2023_" + pi + ".json",
66 flatbuffers = [
67 "//aos/network:message_bridge_client_fbs",
68 "//aos/network:message_bridge_server_fbs",
69 "//aos/network:timestamp_fbs",
70 "//aos/network:remote_message_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -080071 "//y2023/constants:constants_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080072 "//y2022/localizer:localizer_output_fbs",
milind-u2f101fc2023-01-21 12:28:49 -080073 "//frc971/vision:calibration_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -080074 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -080075 "//frc971/vision:vision_fbs",
Yash Chainani728ae222023-02-04 19:48:12 -080076 "//y2023/vision:april_debug_fbs",
James Kuszmaulf3ec4db2023-02-12 14:18:41 -080077 "@com_github_foxglove_schemas//:schemas",
Austin Schuh9f164e92022-12-29 16:15:28 -080078 ],
79 target_compatible_with = ["@platforms//os:linux"],
80 visibility = ["//visibility:public"],
81 deps = [
82 "//aos/events:aos_config",
83 "//frc971/control_loops/drivetrain:aos_config",
84 "//frc971/input:aos_config",
85 ],
86 )
87 for pi in [
88 "pi1",
89 "pi2",
90 "pi3",
91 "pi4",
92 ]
93]
94
95aos_config(
96 name = "config_imu",
97 src = "y2023_imu.json",
98 flatbuffers = [
99 "//aos/network:message_bridge_client_fbs",
100 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800101 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800102 "//aos/network:timestamp_fbs",
103 "//aos/network:remote_message_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800104 "//y2022/localizer:localizer_status_fbs",
105 "//y2022/localizer:localizer_output_fbs",
106 "//y2022/localizer:localizer_visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800107 "//frc971/vision:target_map_fbs",
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 ],
115)
116
117aos_config(
118 name = "config_logger",
119 src = "y2023_logger.json",
120 flatbuffers = [
121 "//aos/network:message_bridge_client_fbs",
122 "//aos/network:message_bridge_server_fbs",
123 "//aos/network:timestamp_fbs",
124 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800125 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800126 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800127 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800128 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800129 ],
130 target_compatible_with = ["@platforms//os:linux"],
131 visibility = ["//visibility:public"],
132 deps = [
133 "//aos/events:aos_config",
134 "//frc971/control_loops/drivetrain:aos_config",
135 "//frc971/input:aos_config",
136 ],
137)
138
139aos_config(
140 name = "config_roborio",
141 src = "y2023_roborio.json",
142 flatbuffers = [
143 "//aos/network:remote_message_fbs",
144 "//aos/network:message_bridge_client_fbs",
145 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800146 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800147 "//aos/network:timestamp_fbs",
148 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800149 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
150 "//y2023/control_loops/superstructure:superstructure_output_fbs",
151 "//y2023/control_loops/superstructure:superstructure_position_fbs",
152 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800153 ],
154 target_compatible_with = ["@platforms//os:linux"],
155 deps = [
156 "//aos/events:aos_config",
157 "//frc971/autonomous:aos_config",
158 "//frc971/control_loops/drivetrain:aos_config",
159 "//frc971/input:aos_config",
160 "//frc971/wpilib:aos_config",
161 ],
162)
163
164[
165 jinja2_template(
166 name = "y2023_pi" + str(num) + ".json",
167 src = "y2023_pi_template.json",
168 parameters = {"NUM": str(num)},
169 target_compatible_with = ["@platforms//os:linux"],
170 )
171 for num in range(1, 6)
172]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800173
174cc_library(
175 name = "constants",
176 srcs = [
177 "constants.cc",
178 ],
179 hdrs = [
180 "constants.h",
181 ],
182 visibility = ["//visibility:public"],
183 deps = [
184 "//aos/mutex",
185 "//aos/network:team_number",
186 "//frc971:constants",
187 "//frc971/control_loops:pose",
188 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
189 "//frc971/shooter_interpolation:interpolation",
190 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
191 "@com_github_google_glog//:glog",
192 "@com_google_absl//absl/base",
193 ],
194)
195
196cc_binary(
197 name = "wpilib_interface",
198 srcs = [
199 "wpilib_interface.cc",
200 ],
201 target_compatible_with = ["//tools/platforms/hardware:roborio"],
202 deps = [
203 ":constants",
204 "//aos:init",
205 "//aos:math",
206 "//aos/events:shm_event_loop",
207 "//aos/logging",
208 "//aos/stl_mutex",
209 "//aos/time",
210 "//aos/util:log_interval",
211 "//aos/util:phased_loop",
212 "//aos/util:wrapping_counter",
213 "//frc971/autonomous:auto_mode_fbs",
214 "//frc971/control_loops:control_loop",
215 "//frc971/control_loops:control_loops_fbs",
216 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
217 "//frc971/input:robot_state_fbs",
218 "//frc971/queues:gyro_fbs",
219 "//frc971/wpilib:ADIS16448",
220 "//frc971/wpilib:buffered_pcm",
221 "//frc971/wpilib:drivetrain_writer",
222 "//frc971/wpilib:encoder_and_potentiometer",
223 "//frc971/wpilib:interrupt_edge_counting",
224 "//frc971/wpilib:joystick_sender",
225 "//frc971/wpilib:logging_fbs",
226 "//frc971/wpilib:loop_output_handler",
227 "//frc971/wpilib:pdp_fetcher",
228 "//frc971/wpilib:sensor_reader",
229 "//frc971/wpilib:wpilib_interface",
230 "//frc971/wpilib:wpilib_robot_base",
231 "//third_party:phoenix",
232 "//third_party:wpilib",
233 "//y2023/control_loops/superstructure:superstructure_output_fbs",
234 "//y2023/control_loops/superstructure:superstructure_position_fbs",
235 ],
236)
237
238cc_binary(
239 name = "joystick_reader",
240 srcs = [
241 ":joystick_reader.cc",
242 ],
243 deps = [
244 ":constants",
245 "//aos:init",
246 "//aos/actions:action_lib",
247 "//aos/logging",
248 "//frc971/autonomous:auto_fbs",
249 "//frc971/autonomous:base_autonomous_actor",
250 "//frc971/control_loops:profiled_subsystem_fbs",
251 "//frc971/input:action_joystick_input",
252 "//frc971/input:drivetrain_input",
253 "//frc971/input:joystick_input",
254 "//y2023/control_loops/drivetrain:drivetrain_base",
255 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
256 "//y2023/control_loops/superstructure:superstructure_status_fbs",
257 ],
258)
259
260py_library(
261 name = "python_init",
262 srcs = ["__init__.py"],
263 target_compatible_with = ["@platforms//os:linux"],
264 visibility = ["//visibility:public"],
265)
266
267sh_binary(
268 name = "log_web_proxy",
269 srcs = ["log_web_proxy.sh"],
270 data = [
271 ":aos_config",
272 "//aos/network:log_web_proxy_main",
273 "//y2023/www:field_main_bundle.min.js",
274 "//y2023/www:files",
275 ],
276 target_compatible_with = ["@platforms//os:linux"],
277)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800278
279cc_binary(
280 name = "ssd_profiler",
281 srcs = [
282 "ssd_profiler.cc",
283 ],
284 deps = [
285 "//aos:init",
286 "//aos/time",
287 "@com_github_google_glog//:glog",
288 ],
289)