blob: 274480bf511f4e33f80faaf6d5283d68dbdb4d0a [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",
12 ":message_bridge_client.sh",
13 "@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",
24 ":joystick_reader",
25 ":wpilib_interface",
26 "//aos/network:message_bridge_client",
27 "//aos/network:message_bridge_server",
28 "//y2023/control_loops/drivetrain:drivetrain",
29 "//y2023/control_loops/drivetrain:trajectory_generator",
30 "//y2023/control_loops/superstructure:superstructure",
31 ],
32 target_compatible_with = ["@platforms//os:linux"],
33)
34
35robot_downloader(
Austin Schuh9f164e92022-12-29 16:15:28 -080036 name = "pi_download",
37 binaries = [
Maxwell Hendersonad312342023-01-10 12:07:47 -080038 "//y2020/vision:calibration",
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",
Maxwell Hendersonad312342023-01-10 12:07:47 -080043 "//aos/network:web_proxy_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080044 "//aos/events/logging:log_cat",
Austin Schuhb07dd5b2023-02-05 22:29:11 -080045 "//y2023/rockpi:imu_main",
Austin Schuh9f164e92022-12-29 16:15:28 -080046 ],
47 data = [
48 ":aos_config",
Maxwell Hendersonad312342023-01-10 12:07:47 -080049 ":message_bridge_client.sh",
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",
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 "//frc971/input:aos_config",
114 ],
115 )
116 for pi in [
117 "pi1",
118 "pi2",
119 "pi3",
120 "pi4",
121 ]
122]
123
124aos_config(
125 name = "config_imu",
126 src = "y2023_imu.json",
127 flatbuffers = [
128 "//aos/network:message_bridge_client_fbs",
129 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800130 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800131 "//aos/network:timestamp_fbs",
132 "//aos/network:remote_message_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800133 "//y2022/localizer:localizer_status_fbs",
134 "//y2022/localizer:localizer_output_fbs",
135 "//y2022/localizer:localizer_visualization_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800136 "//frc971/vision:target_map_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800137 ],
138 target_compatible_with = ["@platforms//os:linux"],
139 visibility = ["//visibility:public"],
140 deps = [
141 "//aos/events:aos_config",
142 "//frc971/control_loops/drivetrain:aos_config",
143 ],
144)
145
146aos_config(
147 name = "config_logger",
148 src = "y2023_logger.json",
149 flatbuffers = [
150 "//aos/network:message_bridge_client_fbs",
151 "//aos/network:message_bridge_server_fbs",
152 "//aos/network:timestamp_fbs",
153 "//aos/network:remote_message_fbs",
milind-u2f101fc2023-01-21 12:28:49 -0800154 "//frc971/vision:calibration_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800155 "//frc971/vision:vision_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800156 "//frc971/vision:target_map_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800157 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800158 ],
159 target_compatible_with = ["@platforms//os:linux"],
160 visibility = ["//visibility:public"],
161 deps = [
162 "//aos/events:aos_config",
163 "//frc971/control_loops/drivetrain:aos_config",
164 "//frc971/input:aos_config",
165 ],
166)
167
168aos_config(
169 name = "config_roborio",
170 src = "y2023_roborio.json",
171 flatbuffers = [
172 "//aos/network:remote_message_fbs",
173 "//aos/network:message_bridge_client_fbs",
174 "//aos/network:message_bridge_server_fbs",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800175 "//y2023/constants:constants_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800176 "//aos/network:timestamp_fbs",
177 "//y2019/control_loops/drivetrain:target_selector_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800178 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
Ravago Jones2060ee62023-02-03 18:12:24 -0800179 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800180 "//y2023/control_loops/superstructure:superstructure_output_fbs",
181 "//y2023/control_loops/superstructure:superstructure_position_fbs",
182 "//y2023/control_loops/superstructure:superstructure_status_fbs",
Austin Schuh9f164e92022-12-29 16:15:28 -0800183 ],
184 target_compatible_with = ["@platforms//os:linux"],
185 deps = [
186 "//aos/events:aos_config",
187 "//frc971/autonomous:aos_config",
188 "//frc971/control_loops/drivetrain:aos_config",
189 "//frc971/input:aos_config",
190 "//frc971/wpilib:aos_config",
191 ],
192)
193
194[
195 jinja2_template(
196 name = "y2023_pi" + str(num) + ".json",
197 src = "y2023_pi_template.json",
198 parameters = {"NUM": str(num)},
199 target_compatible_with = ["@platforms//os:linux"],
200 )
201 for num in range(1, 6)
202]
Maxwell Hendersonad312342023-01-10 12:07:47 -0800203
204cc_library(
205 name = "constants",
206 srcs = [
207 "constants.cc",
208 ],
209 hdrs = [
210 "constants.h",
211 ],
212 visibility = ["//visibility:public"],
213 deps = [
214 "//aos/mutex",
215 "//aos/network:team_number",
216 "//frc971:constants",
217 "//frc971/control_loops:pose",
218 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
219 "//frc971/shooter_interpolation:interpolation",
220 "//y2023/control_loops/drivetrain:polydrivetrain_plants",
221 "@com_github_google_glog//:glog",
222 "@com_google_absl//absl/base",
223 ],
224)
225
226cc_binary(
227 name = "wpilib_interface",
228 srcs = [
229 "wpilib_interface.cc",
230 ],
231 target_compatible_with = ["//tools/platforms/hardware:roborio"],
232 deps = [
233 ":constants",
234 "//aos:init",
235 "//aos:math",
Ravago Jones2060ee62023-02-03 18:12:24 -0800236 "//aos/containers:sized_array",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800237 "//aos/events:shm_event_loop",
238 "//aos/logging",
239 "//aos/stl_mutex",
240 "//aos/time",
241 "//aos/util:log_interval",
242 "//aos/util:phased_loop",
243 "//aos/util:wrapping_counter",
244 "//frc971/autonomous:auto_mode_fbs",
245 "//frc971/control_loops:control_loop",
246 "//frc971/control_loops:control_loops_fbs",
247 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
248 "//frc971/input:robot_state_fbs",
249 "//frc971/queues:gyro_fbs",
250 "//frc971/wpilib:ADIS16448",
251 "//frc971/wpilib:buffered_pcm",
252 "//frc971/wpilib:drivetrain_writer",
253 "//frc971/wpilib:encoder_and_potentiometer",
254 "//frc971/wpilib:interrupt_edge_counting",
255 "//frc971/wpilib:joystick_sender",
256 "//frc971/wpilib:logging_fbs",
257 "//frc971/wpilib:loop_output_handler",
258 "//frc971/wpilib:pdp_fetcher",
259 "//frc971/wpilib:sensor_reader",
260 "//frc971/wpilib:wpilib_interface",
261 "//frc971/wpilib:wpilib_robot_base",
262 "//third_party:phoenix",
Ravago Jones2060ee62023-02-03 18:12:24 -0800263 "//third_party:phoenixpro",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800264 "//third_party:wpilib",
Ravago Jones2060ee62023-02-03 18:12:24 -0800265 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800266 "//y2023/control_loops/superstructure:superstructure_output_fbs",
267 "//y2023/control_loops/superstructure:superstructure_position_fbs",
268 ],
269)
270
271cc_binary(
272 name = "joystick_reader",
273 srcs = [
274 ":joystick_reader.cc",
275 ],
276 deps = [
277 ":constants",
278 "//aos:init",
279 "//aos/actions:action_lib",
280 "//aos/logging",
281 "//frc971/autonomous:auto_fbs",
282 "//frc971/autonomous:base_autonomous_actor",
283 "//frc971/control_loops:profiled_subsystem_fbs",
284 "//frc971/input:action_joystick_input",
285 "//frc971/input:drivetrain_input",
286 "//frc971/input:joystick_input",
287 "//y2023/control_loops/drivetrain:drivetrain_base",
288 "//y2023/control_loops/superstructure:superstructure_goal_fbs",
289 "//y2023/control_loops/superstructure:superstructure_status_fbs",
290 ],
291)
292
293py_library(
294 name = "python_init",
295 srcs = ["__init__.py"],
296 target_compatible_with = ["@platforms//os:linux"],
297 visibility = ["//visibility:public"],
298)
299
300sh_binary(
301 name = "log_web_proxy",
302 srcs = ["log_web_proxy.sh"],
303 data = [
304 ":aos_config",
305 "//aos/network:log_web_proxy_main",
306 "//y2023/www:field_main_bundle.min.js",
307 "//y2023/www:files",
308 ],
309 target_compatible_with = ["@platforms//os:linux"],
310)
Austin Schuhe6b2b882023-02-04 11:42:40 -0800311
312cc_binary(
313 name = "ssd_profiler",
314 srcs = [
315 "ssd_profiler.cc",
316 ],
317 deps = [
318 "//aos:init",
319 "//aos/time",
320 "@com_github_google_glog//:glog",
321 ],
322)