blob: 8e91107c975420176a32f44f15611eb6916cc79b [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001load("//frc971:downloader.bzl", "robot_downloader")
2load("//aos:config.bzl", "aos_config")
Maxwell Henderson440e3f12024-01-17 19:44:13 -08003load("//tools/build_rules:template.bzl", "jinja2_template")
Niko Sohmers3860f8a2024-01-12 21:05:19 -08004load("//aos/util:config_validator_macro.bzl", "config_validator_test")
5
6config_validator_test(
7 name = "config_validator_test",
8 config = "//y2024:aos_config",
9)
10
11robot_downloader(
12 binaries = [
13 "//aos/network:web_proxy_main",
14 "//aos/events/logging:log_cat",
15 "//y2024/constants:constants_sender",
16 "//aos/events:aos_timing_report_streamer",
17 ],
18 data = [
19 ":aos_config",
20 "//aos/starter:roborio_irq_config.json",
21 "//y2024/constants:constants.json",
22 "@ctre_phoenix6_tools_athena//:shared_libraries",
23 "@ctre_phoenix_cci_athena//:shared_libraries",
24 ],
25 dirs = [
26 "//y2024/www:www_files",
27 "//y2024/autonomous:splines",
28 ],
29 start_binaries = [
30 "//aos/events/logging:logger_main",
31 "//aos/network:web_proxy_main",
32 "//aos/starter:irq_affinity",
33 "//y2024/autonomous:binaries",
34 ":joystick_reader",
35 ":wpilib_interface",
36 "//frc971/can_logger",
37 "//aos/network:message_bridge_client",
38 "//aos/network:message_bridge_server",
39 "//y2024/control_loops/drivetrain:drivetrain",
40 "//y2024/control_loops/drivetrain:trajectory_generator",
41 "//y2024/control_loops/superstructure:superstructure",
42 ],
43 target_compatible_with = ["@platforms//os:linux"],
44)
45
46robot_downloader(
47 name = "orin_download",
48 binaries = [
49 "//aos/starter:irq_affinity",
50 "//aos/util:foxglove_websocket",
51 "//aos/events:aos_timing_report_streamer",
52 "//y2024/constants:constants_sender",
53 "//aos/network:web_proxy_main",
54 ":joystick_republish",
55 "//aos/events/logging:log_cat",
56 "//frc971/image_streamer:image_streamer",
57 ],
58 data = [
59 ":aos_config",
60 "//y2024/constants:constants.json",
61 "//y2024/vision:image_streamer_start",
62 "//y2024/www:www_files",
63 ],
64 dirs = [
65 "//y2024/www:www_files",
66 "//frc971/image_streamer/www:www_files",
67 ],
68 start_binaries = [
69 "//aos/network:message_bridge_client",
70 "//aos/network:message_bridge_server",
71 "//aos/network:web_proxy_main",
72 "//aos/starter:irq_affinity",
73 "//y2024/vision:image_logger",
74 "//aos/events/logging:logger_main",
Maxwell Henderson0604e6f2024-01-15 15:24:44 -080075 "//y2024/orin:can_logger",
Maxwell Henderson440e3f12024-01-17 19:44:13 -080076 "//frc971/orin:gpu_apriltag",
77 "//frc971/orin:argus_camera",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080078 ],
79 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
80 target_type = "orin",
81)
82
83aos_config(
84 name = "aos_config",
85 src = "y2024.json",
86 flatbuffers = [
87 "//aos/network:message_bridge_client_fbs",
88 "//aos/network:message_bridge_server_fbs",
89 "//aos/network:timestamp_fbs",
90 "//frc971/input:robot_state_fbs",
91 "//frc971/vision:vision_fbs",
92 "//frc971/vision:target_map_fbs",
93 ],
94 target_compatible_with = ["@platforms//os:linux"],
95 visibility = ["//visibility:public"],
96 deps = [
97 ":config_imu",
Maxwell Henderson440e3f12024-01-17 19:44:13 -080098 ":config_orin1",
99 ":config_orin2",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800100 ":config_roborio",
101 ],
102)
103
104aos_config(
105 name = "config_imu",
106 src = "y2024_imu.json",
107 flatbuffers = [
108 "//aos/network:message_bridge_client_fbs",
109 "//aos/network:message_bridge_server_fbs",
110 "//y2024/constants:constants_fbs",
Maxwell Henderson0604e6f2024-01-15 15:24:44 -0800111 "//frc971/can_logger:can_logging_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800112 "//aos/network:timestamp_fbs",
113 "//aos/network:remote_message_fbs",
114 ],
115 target_compatible_with = ["@platforms//os:linux"],
116 visibility = ["//visibility:public"],
117 deps = [
118 "//aos/events:aos_config",
119 "//frc971/control_loops/drivetrain:aos_config",
120 ],
121)
122
123aos_config(
124 name = "config_roborio",
125 src = "y2024_roborio.json",
126 flatbuffers = [
127 "//frc971:can_configuration_fbs",
128 "//aos/network:remote_message_fbs",
129 "//aos/network:message_bridge_client_fbs",
130 "//aos/network:message_bridge_server_fbs",
131 #y2019 stuff shouldn't be here (e.g. target selector)
132 "//y2024/constants:constants_fbs",
133 "//aos/network:timestamp_fbs",
134 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
135 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
136 "//y2024/control_loops/superstructure:superstructure_output_fbs",
137 "//y2024/control_loops/superstructure:superstructure_position_fbs",
138 "//y2024/control_loops/superstructure:superstructure_status_fbs",
139 "//frc971/can_logger:can_logging_fbs",
140 ],
141 target_compatible_with = ["@platforms//os:linux"],
142 deps = [
143 "//aos/events:aos_config",
144 "//frc971/autonomous:aos_config",
145 "//frc971/control_loops/drivetrain:aos_config",
146 "//frc971/input:aos_config",
147 ],
148)
149
Maxwell Henderson440e3f12024-01-17 19:44:13 -0800150[
151 aos_config(
152 name = "config_" + orin,
153 src = "y2024_" + orin + ".json",
154 flatbuffers = [
155 "//aos/network:message_bridge_client_fbs",
156 "//aos/network:message_bridge_server_fbs",
157 "//aos/network:timestamp_fbs",
158 "//aos/network:remote_message_fbs",
159 "//y2024/constants:constants_fbs",
160 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
161 "//frc971/vision:calibration_fbs",
162 "//frc971/vision:target_map_fbs",
163 "//frc971/vision:vision_fbs",
164 "@com_github_foxglove_schemas//:schemas",
165 ],
166 target_compatible_with = ["@platforms//os:linux"],
167 visibility = ["//visibility:public"],
168 deps = [
169 "//aos/events:aos_config",
170 "//frc971/control_loops/drivetrain:aos_config",
171 "//frc971/input:aos_config",
172 ],
173 )
174 for orin in [
175 "orin1",
176 "orin2",
177 ]
178]
179
180[
181 jinja2_template(
182 name = "y2024_orin" + str(num) + ".json",
183 src = "y2024_orin_template.json",
184 parameters = {"NUM": str(num)},
185 target_compatible_with = ["@platforms//os:linux"],
186 )
187 for num in range(1, 3)
188]
189
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800190cc_library(
191 name = "constants",
192 srcs = [
193 "constants.cc",
194 ],
195 hdrs = [
196 "constants.h",
197 ],
198 visibility = ["//visibility:public"],
199 deps = [
200 "//aos/mutex",
201 "//aos/network:team_number",
202 "//frc971:constants",
203 "//frc971/control_loops:pose",
204 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
205 "//frc971/shooter_interpolation:interpolation",
206 "//frc971/zeroing:absolute_encoder",
207 "//frc971/zeroing:pot_and_absolute_encoder",
208 "//y2024/control_loops/drivetrain:polydrivetrain_plants",
209 "@com_github_google_glog//:glog",
210 "@com_google_absl//absl/base",
211 ],
212)
213
214cc_binary(
215 name = "wpilib_interface",
216 srcs = [
217 "wpilib_interface.cc",
218 ],
219 target_compatible_with = ["//tools/platforms/hardware:roborio"],
220 deps = [
221 ":constants",
222 "//aos:init",
223 "//aos:math",
224 "//aos/containers:sized_array",
225 "//aos/events:shm_event_loop",
226 "//aos/logging",
227 "//aos/stl_mutex",
228 "//aos/time",
229 "//aos/util:log_interval",
230 "//aos/util:phased_loop",
231 "//aos/util:wrapping_counter",
232 "//frc971:can_configuration_fbs",
233 "//frc971/autonomous:auto_mode_fbs",
234 "//frc971/control_loops:control_loop",
235 "//frc971/control_loops:control_loops_fbs",
236 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
237 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
238 "//frc971/input:robot_state_fbs",
239 "//frc971/queues:gyro_fbs",
240 "//frc971/wpilib:ADIS16448",
241 "//frc971/wpilib:buffered_pcm",
242 "//frc971/wpilib:dma",
243 "//frc971/wpilib:drivetrain_writer",
244 "//frc971/wpilib:encoder_and_potentiometer",
245 "//frc971/wpilib:joystick_sender",
246 "//frc971/wpilib:logging_fbs",
247 "//frc971/wpilib:pdp_fetcher",
248 "//frc971/wpilib:sensor_reader",
249 "//frc971/wpilib:wpilib_robot_base",
250 "//third_party:phoenix",
251 "//third_party:phoenix6",
252 "//third_party:wpilib",
253 "//y2024/control_loops/superstructure:superstructure_output_fbs",
254 "//y2024/control_loops/superstructure:superstructure_position_fbs",
255 ],
256)
257
258cc_binary(
259 name = "joystick_reader",
260 srcs = [
261 ":joystick_reader.cc",
262 ],
263 deps = [
264 ":constants",
265 "//aos:init",
266 "//aos/actions:action_lib",
267 "//aos/logging",
268 "//frc971/autonomous:auto_fbs",
269 "//frc971/autonomous:base_autonomous_actor",
270 "//frc971/control_loops:profiled_subsystem_fbs",
271 "//frc971/input:action_joystick_input",
272 "//frc971/input:drivetrain_input",
273 "//frc971/input:joystick_input",
274 "//frc971/input:redundant_joystick_data",
275 "//y2024/control_loops/drivetrain:drivetrain_base",
276 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
277 "//y2024/control_loops/superstructure:superstructure_status_fbs",
278 ],
279)
280
281cc_binary(
282 name = "joystick_republish",
283 srcs = [
284 "joystick_republish.cc",
285 ],
286 target_compatible_with = ["@platforms//os:linux"],
287 visibility = ["//visibility:public"],
288 deps = [
289 "//aos:configuration",
290 "//aos:flatbuffer_merge",
291 "//aos:init",
292 "//aos/events:shm_event_loop",
293 "//frc971/input:joystick_state_fbs",
294 "@com_github_google_glog//:glog",
295 ],
296)
297
298py_library(
299 name = "python_init",
300 srcs = ["__init__.py"],
301 target_compatible_with = ["@platforms//os:linux"],
302 visibility = ["//visibility:public"],
303)
304
305sh_binary(
306 name = "log_web_proxy",
307 srcs = ["log_web_proxy.sh"],
308 data = [
309 ":aos_config",
310 "//aos/network:log_web_proxy_main",
311 "//y2024/www:files",
312 ],
313 target_compatible_with = ["@platforms//os:linux"],
314)