blob: c639d70a1d5f8654b532040417ff9687506f8572 [file] [log] [blame]
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -08001load("//aos:config.bzl", "aos_config")
2load("//aos/util:config_validator_macro.bzl", "config_validator_test")
Austin Schuh8f99c822024-05-05 22:43:40 -07003load("//frc971:downloader.bzl", "robot_downloader")
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -08004
5config_validator_test(
6 name = "config_validator_test",
7 config = "//y2024_defense:aos_config",
8)
9
10robot_downloader(
11 binaries = [
12 "//aos/network:web_proxy_main",
13 "//aos/events/logging:log_cat",
14 "//aos/events:aos_timing_report_streamer",
15 ],
16 data = [
17 ":aos_config",
18 "//aos/starter:roborio_irq_config.json",
19 "@ctre_phoenix6_api_cpp_athena//:shared_libraries",
20 "@ctre_phoenix6_tools_athena//:shared_libraries",
21 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
22 "@ctre_phoenix_cci_athena//:shared_libraries",
23 ],
24 dirs = [
25 "//y2024_defense/www:www_files",
26 ],
27 start_binaries = [
28 "//aos/events/logging:logger_main",
29 "//aos/network:web_proxy_main",
30 "//aos/starter:irq_affinity",
31 ":joystick_reader",
32 ":wpilib_interface",
33 "//frc971/can_logger",
34 "//aos/network:message_bridge_client",
35 "//aos/network:message_bridge_server",
36 "//y2024_defense/control_loops/drivetrain:drivetrain",
37 ],
38 target_compatible_with = ["@platforms//os:linux"],
39)
40
41robot_downloader(
42 name = "pi_download",
43 binaries = [
44 "//aos/starter:irq_affinity",
45 "//aos/util:foxglove_websocket",
46 "//aos/events:aos_timing_report_streamer",
47 "//aos/network:web_proxy_main",
48 "//aos/events/logging:log_cat",
49 "//y2024_defense/rockpi:imu_main",
50 "//frc971/image_streamer:image_streamer",
51 ],
52 data = [
53 ":aos_config",
54 "//frc971/rockpi:rockpi_config.json",
55 "//y2024_defense/www:www_files",
56 "@game_pieces_edgetpu_model//file",
57 ],
58 dirs = [
59 "//frc971/image_streamer/www:www_files",
60 ],
61 start_binaries = [
62 "//aos/network:message_bridge_client",
63 "//aos/network:message_bridge_server",
64 "//aos/network:web_proxy_main",
65 "//aos/starter:irq_affinity",
66 "//aos/events/logging:logger_main",
67 ],
68 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
69 target_type = "pi",
70)
71
72aos_config(
73 name = "aos_config",
74 src = "y2024_defense.json",
75 flatbuffers = [
76 "//aos/network:message_bridge_client_fbs",
77 "//aos/network:message_bridge_server_fbs",
78 "//aos/network:timestamp_fbs",
79 "//frc971/input:robot_state_fbs",
80 ],
81 target_compatible_with = ["@platforms//os:linux"],
82 visibility = ["//visibility:public"],
83 deps = [
84 ":config_imu",
85 ":config_roborio",
86 ],
87)
88
89aos_config(
90 name = "config_imu",
91 src = "y2024_defense_imu.json",
92 flatbuffers = [
93 "//aos/network:message_bridge_client_fbs",
94 "//aos/network:message_bridge_server_fbs",
95 "//aos/network:timestamp_fbs",
96 "//aos/network:remote_message_fbs",
97 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
98 ],
99 target_compatible_with = ["@platforms//os:linux"],
100 visibility = ["//visibility:public"],
101 deps = [
102 "//aos/events:aos_config",
103 "//frc971/control_loops/drivetrain:aos_config",
104 ],
105)
106
107aos_config(
108 name = "config_roborio",
109 src = "y2024_defense_roborio.json",
110 flatbuffers = [
111 "//frc971:can_configuration_fbs",
112 "//aos/network:remote_message_fbs",
113 "//aos/network:message_bridge_client_fbs",
114 "//aos/network:message_bridge_server_fbs",
115 "//aos/network:timestamp_fbs",
116 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
117 "//frc971/can_logger:can_logging_fbs",
118 ],
119 target_compatible_with = ["@platforms//os:linux"],
120 deps = [
121 "//aos/events:aos_config",
122 "//frc971/autonomous:aos_config",
123 "//frc971/control_loops/drivetrain:aos_config",
124 "//frc971/input:aos_config",
125 "//frc971/wpilib:aos_config",
126 ],
127)
128
129cc_library(
130 name = "constants",
131 srcs = [
132 "constants.cc",
133 ],
134 hdrs = [
135 "constants.h",
136 ],
137 visibility = ["//visibility:public"],
138 deps = [
139 "//aos/mutex",
140 "//aos/network:team_number",
141 "//frc971:constants",
142 "//frc971/control_loops:pose",
143 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
144 "//frc971/shooter_interpolation:interpolation",
145 "//frc971/zeroing:absolute_encoder",
146 "//frc971/zeroing:pot_and_absolute_encoder",
147 "//y2024_defense/control_loops/drivetrain:polydrivetrain_plants",
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -0800148 "@com_google_absl//absl/base",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700149 "@com_google_absl//absl/log",
150 "@com_google_absl//absl/log:check",
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -0800151 ],
152)
153
154cc_binary(
155 name = "wpilib_interface",
156 srcs = [
157 "wpilib_interface.cc",
158 ],
159 target_compatible_with = ["//tools/platforms/hardware:roborio"],
160 deps = [
161 ":constants",
162 "//aos:init",
163 "//aos:math",
164 "//aos/containers:sized_array",
165 "//aos/events:shm_event_loop",
166 "//aos/logging",
167 "//aos/stl_mutex",
168 "//aos/time",
169 "//aos/util:log_interval",
170 "//aos/util:phased_loop",
171 "//aos/util:wrapping_counter",
172 "//frc971:can_configuration_fbs",
173 "//frc971/autonomous:auto_mode_fbs",
174 "//frc971/control_loops:control_loop",
175 "//frc971/control_loops:control_loops_fbs",
176 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
177 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
178 "//frc971/input:robot_state_fbs",
179 "//frc971/queues:gyro_fbs",
180 "//frc971/wpilib:ADIS16448",
181 "//frc971/wpilib:buffered_pcm",
182 "//frc971/wpilib:can_drivetrain_writer",
183 "//frc971/wpilib:can_sensor_reader",
184 "//frc971/wpilib:drivetrain_writer",
185 "//frc971/wpilib:encoder_and_potentiometer",
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -0800186 "//frc971/wpilib:interrupt_edge_counting",
187 "//frc971/wpilib:joystick_sender",
188 "//frc971/wpilib:logging_fbs",
189 "//frc971/wpilib:loop_output_handler",
190 "//frc971/wpilib:pdp_fetcher",
191 "//frc971/wpilib:sensor_reader",
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800192 "//frc971/wpilib:talonfx",
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -0800193 "//frc971/wpilib:wpilib_interface",
194 "//frc971/wpilib:wpilib_robot_base",
195 "//third_party:phoenix",
196 "//third_party:phoenix6",
197 "//third_party:wpilib",
198 ],
199)
200
201cc_binary(
202 name = "joystick_reader",
203 srcs = [
204 ":joystick_reader.cc",
205 ],
206 deps = [
207 ":constants",
208 "//aos:init",
209 "//aos/actions:action_lib",
210 "//aos/logging",
211 "//frc971/autonomous:auto_fbs",
212 "//frc971/autonomous:base_autonomous_actor",
213 "//frc971/control_loops:profiled_subsystem_fbs",
214 "//frc971/input:action_joystick_input",
215 "//frc971/input:drivetrain_input",
216 "//frc971/input:joystick_input",
217 "//frc971/input:redundant_joystick_data",
218 "//y2024_defense/control_loops/drivetrain:drivetrain_base",
219 ],
220)
221
222py_library(
223 name = "python_init",
224 srcs = ["__init__.py"],
225 target_compatible_with = ["@platforms//os:linux"],
226 visibility = ["//visibility:public"],
227)
228
229sh_binary(
230 name = "log_web_proxy",
231 srcs = ["log_web_proxy.sh"],
232 data = [
233 ":aos_config",
234 "//aos/network:log_web_proxy_main",
235 "//y2024_defense/www:field_main_bundle.min.js",
236 "//y2024_defense/www:files",
237 ],
238 target_compatible_with = ["@platforms//os:linux"],
239)