blob: c766a5432cecced0336f7c59e7821bca545bdefe [file] [log] [blame]
James (Peilun) Lia70e5752024-09-18 20:43:00 -07001load("//aos:config.bzl", "aos_config")
2load("//aos/util:config_validator_macro.bzl", "config_validator_test")
3load("//frc971:downloader.bzl", "robot_downloader")
4
5config_validator_test(
6 name = "config_validator_test",
7 config = "//y2024_bot3:aos_config",
8)
9
10robot_downloader(
11 binaries = [
12 "//aos/network:web_proxy_main",
13 "//aos/events/logging:log_cat",
14 "//y2024_bot3/constants:constants_sender",
15 "//aos/events:aos_timing_report_streamer",
16 ],
17 data = [
18 ":aos_config",
19 "//aos/starter:roborio_irq_config.json",
20 "//y2024_bot3/constants:constants.json",
21 "@ctre_phoenix6_api_cpp_athena//:shared_libraries",
22 "@ctre_phoenix6_tools_athena//:shared_libraries",
23 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
24 "@ctre_phoenix_cci_athena//:shared_libraries",
25 ],
26 dirs = [
27 "//y2024_bot3/www:www_files",
28 ],
29 start_binaries = [
30 "//aos/events/logging:logger_main",
31 "//aos/network:web_proxy_main",
32 "//aos/starter:irq_affinity",
33 ":joystick_reader",
34 ":wpilib_interface",
35 "//frc971/can_logger",
36 "//aos/network:message_bridge_client",
37 "//aos/network:message_bridge_server",
38 "//y2024_bot3/control_loops/superstructure:superstructure",
39 ],
40 target_compatible_with = ["@platforms//os:linux"],
41)
42
43robot_downloader(
44 name = "orin_download",
45 binaries = [
46 "//frc971/wpilib:joystick_republish",
47 "//aos/events:aos_timing_report_streamer",
48 "//aos/events/logging:log_cat",
49 "//aos:aos_jitter",
50 "//aos/network:web_proxy_main",
51 "//aos/starter:irq_affinity",
52 "//aos/util:foxglove_websocket",
53 "//frc971/image_streamer:image_streamer",
54 "//frc971/orin:hardware_monitor",
55 "//frc971/orin:argus_monitor",
56 "//frc971/vision:intrinsics_calibration",
57 "//aos/util:filesystem_monitor",
58 "//y2024_bot3/vision:viewer",
59 "//y2024_bot3/constants:constants_sender",
60 "//frc971/orin:localizer_logger",
61 "//frc971/vision:foxglove_image_converter",
62 ],
63 data = [
64 ":aos_config",
65 "//frc971/orin:orin_irq_config.json",
66 "//y2024_bot3/constants:constants.json",
67 "//y2024_bot3/vision:image_streamer_start",
68 "//y2024_bot3/www:www_files",
69 ],
70 dirs = [
71 "//y2024_bot3/www:www_files",
72 "//frc971/image_streamer/www:www_files",
73 ],
74 start_binaries = [
75 "//aos/events/logging:logger_main",
76 "//frc971/imu_fdcan:can_translator",
77 "//frc971/imu_fdcan:dual_imu_blender",
78 "//aos/network:message_bridge_client",
79 "//aos/network:message_bridge_server",
80 "//aos/network:web_proxy_main",
81 "//aos/starter:irq_affinity",
82 "//frc971/orin:argus_camera",
83 "//y2024_bot3/orin:can_logger",
84 "//y2024_bot3/vision:apriltag_detector",
85 "//frc971/vision:image_logger",
86 ],
87 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
88 target_type = "pi",
89)
90
91aos_config(
92 name = "aos_config",
93 src = "y2024_bot3.json",
94 flatbuffers = [
95 "//aos/network:message_bridge_client_fbs",
96 "//aos/network:message_bridge_server_fbs",
97 "//aos/network:timestamp_fbs",
98 "//frc971/input:robot_state_fbs",
99 "//frc971/vision:vision_fbs",
100 "//frc971/vision:target_map_fbs",
101 ],
102 target_compatible_with = ["@platforms//os:linux"],
103 visibility = ["//visibility:public"],
104 deps = [
105 ":config_imu",
106 ":config_orin1",
107 ":config_roborio",
108 ],
109)
110
111aos_config(
112 name = "config_imu",
113 src = "y2024_bot3_imu.json",
114 flatbuffers = [
115 "//aos/network:message_bridge_client_fbs",
116 "//aos/network:message_bridge_server_fbs",
117 "//frc971/imu_fdcan:dual_imu_fbs",
118 "//frc971/imu_fdcan:can_translator_status_fbs",
119 "//frc971/imu_fdcan:dual_imu_blender_status_fbs",
120 "//y2024_bot3/constants:constants_fbs",
121 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
122 "//frc971/can_logger:can_logging_fbs",
123 "//frc971/orin:hardware_stats_fbs",
124 "//aos/network:timestamp_fbs",
125 "//aos/util:filesystem_fbs",
126 "//aos/network:remote_message_fbs",
127 "//frc971/vision:calibration_fbs",
128 "//frc971/vision:target_map_fbs",
129 "//frc971/vision:vision_fbs",
130 "@com_github_foxglove_schemas//:schemas",
131 ],
132 target_compatible_with = ["@platforms//os:linux"],
133 visibility = ["//visibility:public"],
134 deps = [
135 "//aos/events:aos_config",
136 "//frc971/control_loops/drivetrain:aos_config",
137 ],
138)
139
140aos_config(
141 name = "config_roborio",
142 src = "y2024_bot3_roborio.json",
143 flatbuffers = [
144 "//frc971:can_configuration_fbs",
145 "//aos/network:remote_message_fbs",
146 "//aos/network:message_bridge_client_fbs",
147 "//aos/network:message_bridge_server_fbs",
148 "//frc971/wpilib:pdp_values_fbs",
149 "//y2024_bot3/constants:constants_fbs",
150 "//aos/network:timestamp_fbs",
151 "//y2024_bot3/control_loops/superstructure:superstructure_goal_fbs",
152 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
153 "//y2024_bot3/control_loops/superstructure:superstructure_can_position_fbs",
154 "//y2024_bot3/control_loops/superstructure:superstructure_output_fbs",
155 "//frc971/control_loops/drivetrain:rio_localizer_inputs_fbs",
156 "//y2024_bot3/control_loops/superstructure:superstructure_position_fbs",
157 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
158 "//y2024_bot3/control_loops/superstructure:superstructure_status_fbs",
159 "//frc971/can_logger:can_logging_fbs",
160 ],
161 target_compatible_with = ["@platforms//os:linux"],
162 deps = [
163 "//aos/events:aos_config",
164 "//frc971/control_loops/drivetrain:aos_config",
165 "//frc971/input:aos_config",
166 ],
167)
168
169aos_config(
170 name = "config_orin1",
171 src = "y2024_bot3_orin1.json",
172 flatbuffers = [
173 "//aos/network:message_bridge_client_fbs",
174 "//aos/network:message_bridge_server_fbs",
175 "//aos/network:timestamp_fbs",
176 "//aos/network:remote_message_fbs",
177 "//y2024_bot3/constants:constants_fbs",
178 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
179 "//frc971/orin:hardware_stats_fbs",
180 "//frc971/vision:calibration_fbs",
181 "//frc971/vision:target_map_fbs",
182 "//frc971/vision:vision_fbs",
183 "//aos/util:filesystem_fbs",
184 "@com_github_foxglove_schemas//:schemas",
185 ],
186 target_compatible_with = ["@platforms//os:linux"],
187 visibility = ["//visibility:public"],
188 deps = [
189 "//aos/events:aos_config",
190 "//frc971/control_loops/drivetrain:aos_config",
191 "//frc971/input:aos_config",
192 ],
193)
194
195cc_library(
196 name = "constants",
197 srcs = [
198 "constants.cc",
199 ],
200 hdrs = [
201 "constants.h",
202 ],
203 visibility = ["//visibility:public"],
204 deps = [
205 "//aos/mutex",
206 "//aos/network:team_number",
207 "//frc971:constants",
208 "//frc971/control_loops:pose",
209 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
210 "//frc971/zeroing:absolute_encoder",
211 "//frc971/zeroing:pot_and_absolute_encoder",
212 "//y2024_bot3/constants:constants_fbs",
213 "@com_google_absl//absl/base",
214 "@com_google_absl//absl/log",
215 "@com_google_absl//absl/log:check",
216 ],
217)
218
219cc_binary(
220 name = "wpilib_interface",
221 srcs = [
222 "wpilib_interface.cc",
223 ],
224 target_compatible_with = ["//tools/platforms/hardware:roborio"],
225 deps = [
226 ":constants",
227 "//aos:init",
228 "//aos:math",
229 "//aos/containers:sized_array",
230 "//aos/events:shm_event_loop",
231 "//aos/logging",
232 "//aos/stl_mutex",
233 "//aos/time",
234 "//aos/util:log_interval",
235 "//aos/util:phased_loop",
236 "//aos/util:wrapping_counter",
237 "//frc971:can_configuration_fbs",
238 "//frc971/constants:constants_sender_lib",
239 "//frc971/control_loops:control_loop",
240 "//frc971/control_loops:control_loops_fbs",
241 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
242 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
243 "//frc971/input:robot_state_fbs",
244 "//frc971/queues:gyro_fbs",
245 "//frc971/wpilib:ADIS16448",
246 "//frc971/wpilib:buffered_pcm",
247 "//frc971/wpilib:can_drivetrain_writer",
248 "//frc971/wpilib:can_sensor_reader",
249 "//frc971/wpilib:dma",
250 "//frc971/wpilib:drivetrain_writer",
251 "//frc971/wpilib:encoder_and_potentiometer",
252 "//frc971/wpilib:generic_can_writer",
253 "//frc971/wpilib:joystick_sender",
254 "//frc971/wpilib:logging_fbs",
255 "//frc971/wpilib:pdp_fetcher",
256 "//frc971/wpilib:sensor_reader",
257 "//frc971/wpilib:talonfx",
258 "//frc971/wpilib:wpilib_robot_base",
259 "//third_party:phoenix",
260 "//third_party:phoenix6",
261 "//third_party:wpilib",
262 "//y2024_bot3/constants:constants_fbs",
263 "//y2024_bot3/control_loops/superstructure:superstructure_can_position_fbs",
264 "//y2024_bot3/control_loops/superstructure:superstructure_output_fbs",
265 "//y2024_bot3/control_loops/superstructure:superstructure_position_fbs",
266 ],
267)
268
269cc_binary(
270 name = "joystick_reader",
271 srcs = [
272 ":joystick_reader.cc",
273 ],
274 deps = [
275 ":constants",
276 "//aos:init",
277 "//aos/actions:action_lib",
278 "//aos/logging",
279 "//frc971/constants:constants_sender_lib",
280 "//frc971/control_loops:profiled_subsystem_fbs",
281 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
282 "//frc971/input:action_joystick_input",
283 "//frc971/input:drivetrain_input",
284 "//frc971/input:joystick_input",
285 "//frc971/input:redundant_joystick_data",
286 "//y2024_bot3/control_loops/superstructure:superstructure_goal_fbs",
287 "//y2024_bot3/control_loops/superstructure:superstructure_status_fbs",
288 ],
289)
290
291py_library(
292 name = "python_init",
293 srcs = ["__init__.py"],
294 target_compatible_with = ["@platforms//os:linux"],
295 visibility = ["//visibility:public"],
296)
297
298sh_binary(
299 name = "log_web_proxy",
300 srcs = ["log_web_proxy.sh"],
301 data = [
302 ":aos_config",
303 "//aos/network:log_web_proxy_main",
304 "//frc971/www:starter_main_bundle.min.js",
305 "//y2024_bot3/www:field_main_bundle.min.js",
306 "//y2024_bot3/www:files",
307 ],
308 target_compatible_with = ["@platforms//os:linux"],
309)