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