blob: cf5d60f44fcf90d327eaab689283e6ea84697032 [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 = [
Maxwell Hendersonad312342023-01-10 12:07:47 -08008 "//y2020/vision: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",
Austin Schuh9f164e92022-12-29 16:15:28 -080077 ],
78 target_compatible_with = ["@platforms//os:linux"],
79 visibility = ["//visibility:public"],
80 deps = [
81 "//aos/events:aos_config",
82 "//frc971/control_loops/drivetrain:aos_config",
83 "//frc971/input:aos_config",
84 ],
85 )
86 for pi in [
87 "pi1",
88 "pi2",
89 "pi3",
90 "pi4",
91 ]
92]
93
94aos_config(
95 name = "config_imu",
96 src = "y2023_imu.json",
97 flatbuffers = [
98 "//aos/network:message_bridge_client_fbs",
99 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800100 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800101 "//aos/network:timestamp_fbs",
102 "//aos/network:remote_message_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800103 "//y2022/localizer:localizer_status_fbs",
104 "//y2022/localizer:localizer_output_fbs",
105 "//y2022/localizer:localizer_visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800106 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800107 ],
108 target_compatible_with = ["@platforms//os:linux"],
109 visibility = ["//visibility:public"],
110 deps = [
111 "//aos/events:aos_config",
112 "//frc971/control_loops/drivetrain:aos_config",
113 ],
114)
115
116aos_config(
117 name = "config_logger",
118 src = "y2023_logger.json",
119 flatbuffers = [
120 "//aos/network:message_bridge_client_fbs",
121 "//aos/network:message_bridge_server_fbs",
122 "//aos/network:timestamp_fbs",
123 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800124 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800125 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800126 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800127 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800128 ],
129 target_compatible_with = ["@platforms//os:linux"],
130 visibility = ["//visibility:public"],
131 deps = [
132 "//aos/events:aos_config",
133 "//frc971/control_loops/drivetrain:aos_config",
134 "//frc971/input:aos_config",
135 ],
136)
137
138aos_config(
139 name = "config_roborio",
140 src = "y2023_roborio.json",
141 flatbuffers = [
142 "//aos/network:remote_message_fbs",
143 "//aos/network:message_bridge_client_fbs",
144 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800145 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800146 "//aos/network:timestamp_fbs",
147 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800148 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
149 "//y2023/control_loops/superstructure:superstructure_output_fbs",
150 "//y2023/control_loops/superstructure:superstructure_position_fbs",
151 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800152 ],
153 target_compatible_with = ["@platforms//os:linux"],
154 deps = [
155 "//aos/events:aos_config",
156 "//frc971/autonomous:aos_config",
157 "//frc971/control_loops/drivetrain:aos_config",
158 "//frc971/input:aos_config",
159 "//frc971/wpilib:aos_config",
160 ],
161)
162
163[
164 jinja2_template(
165 name = "y2023_pi" + str(num) + ".json",
166 src = "y2023_pi_template.json",
167 parameters = {"NUM": str(num)},
168 target_compatible_with = ["@platforms//os:linux"],
169 )
170 for num in range(1, 6)
171]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800172
173cc_library(
174 name = "constants",
175 srcs = [
176 "constants.cc",
177 ],
178 hdrs = [
179 "constants.h",
180 ],
181 visibility = ["//visibility:public"],
182 deps = [
183 "//aos/mutex",
184 "//aos/network:team_number",
185 "//frc971:constants",
186 "//frc971/control_loops:pose",
187 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
188 "//frc971/shooter_interpolation:interpolation",
189 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
190 "@com_github_google_glog//:glog",
191 "@com_google_absl//absl/base",
192 ],
193)
194
195cc_binary(
196 name = "wpilib_interface",
197 srcs = [
198 "wpilib_interface.cc",
199 ],
200 target_compatible_with = ["//tools/platforms/hardware:roborio"],
201 deps = [
202 ":constants",
203 "//aos:init",
204 "//aos:math",
205 "//aos/events:shm_event_loop",
206 "//aos/logging",
207 "//aos/stl_mutex",
208 "//aos/time",
209 "//aos/util:log_interval",
210 "//aos/util:phased_loop",
211 "//aos/util:wrapping_counter",
212 "//frc971/autonomous:auto_mode_fbs",
213 "//frc971/control_loops:control_loop",
214 "//frc971/control_loops:control_loops_fbs",
215 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
216 "//frc971/input:robot_state_fbs",
217 "//frc971/queues:gyro_fbs",
218 "//frc971/wpilib:ADIS16448",
219 "//frc971/wpilib:buffered_pcm",
220 "//frc971/wpilib:drivetrain_writer",
221 "//frc971/wpilib:encoder_and_potentiometer",
222 "//frc971/wpilib:interrupt_edge_counting",
223 "//frc971/wpilib:joystick_sender",
224 "//frc971/wpilib:logging_fbs",
225 "//frc971/wpilib:loop_output_handler",
226 "//frc971/wpilib:pdp_fetcher",
227 "//frc971/wpilib:sensor_reader",
228 "//frc971/wpilib:wpilib_interface",
229 "//frc971/wpilib:wpilib_robot_base",
230 "//third_party:phoenix",
231 "//third_party:wpilib",
232 "//y2023/control_loops/superstructure:superstructure_output_fbs",
233 "//y2023/control_loops/superstructure:superstructure_position_fbs",
234 ],
235)
236
237cc_binary(
238 name = "joystick_reader",
239 srcs = [
240 ":joystick_reader.cc",
241 ],
242 deps = [
243 ":constants",
244 "//aos:init",
245 "//aos/actions:action_lib",
246 "//aos/logging",
247 "//frc971/autonomous:auto_fbs",
248 "//frc971/autonomous:base_autonomous_actor",
249 "//frc971/control_loops:profiled_subsystem_fbs",
250 "//frc971/input:action_joystick_input",
251 "//frc971/input:drivetrain_input",
252 "//frc971/input:joystick_input",
253 "//y2023/control_loops/drivetrain:drivetrain_base",
254 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
255 "//y2023/control_loops/superstructure:superstructure_status_fbs",
256 ],
257)
258
259py_library(
260 name = "python_init",
261 srcs = ["__init__.py"],
262 target_compatible_with = ["@platforms//os:linux"],
263 visibility = ["//visibility:public"],
264)
265
266sh_binary(
267 name = "log_web_proxy",
268 srcs = ["log_web_proxy.sh"],
269 data = [
270 ":aos_config",
271 "//aos/network:log_web_proxy_main",
272 "//y2023/www:field_main_bundle.min.js",
273 "//y2023/www:files",
274 ],
275 target_compatible_with = ["@platforms//os:linux"],
276)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800277
278cc_binary(
279 name = "ssd_profiler",
280 srcs = [
281 "ssd_profiler.cc",
282 ],
283 deps = [
284 "//aos:init",
285 "//aos/time",
286 "@com_github_google_glog//:glog",
287 ],
288)