blob: 8f888a522ee75c777ba587f3ebd0d54b2605f473 [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",
148 "@com_github_google_glog//:glog",
149 "@com_google_absl//absl/base",
150 ],
151)
152
153cc_binary(
154 name = "wpilib_interface",
155 srcs = [
156 "wpilib_interface.cc",
157 ],
158 target_compatible_with = ["//tools/platforms/hardware:roborio"],
159 deps = [
160 ":constants",
161 "//aos:init",
162 "//aos:math",
163 "//aos/containers:sized_array",
164 "//aos/events:shm_event_loop",
165 "//aos/logging",
166 "//aos/stl_mutex",
167 "//aos/time",
168 "//aos/util:log_interval",
169 "//aos/util:phased_loop",
170 "//aos/util:wrapping_counter",
171 "//frc971:can_configuration_fbs",
172 "//frc971/autonomous:auto_mode_fbs",
173 "//frc971/control_loops:control_loop",
174 "//frc971/control_loops:control_loops_fbs",
175 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
176 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
177 "//frc971/input:robot_state_fbs",
178 "//frc971/queues:gyro_fbs",
179 "//frc971/wpilib:ADIS16448",
180 "//frc971/wpilib:buffered_pcm",
181 "//frc971/wpilib:can_drivetrain_writer",
182 "//frc971/wpilib:can_sensor_reader",
183 "//frc971/wpilib:drivetrain_writer",
184 "//frc971/wpilib:encoder_and_potentiometer",
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -0800185 "//frc971/wpilib:interrupt_edge_counting",
186 "//frc971/wpilib:joystick_sender",
187 "//frc971/wpilib:logging_fbs",
188 "//frc971/wpilib:loop_output_handler",
189 "//frc971/wpilib:pdp_fetcher",
190 "//frc971/wpilib:sensor_reader",
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800191 "//frc971/wpilib:talonfx",
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -0800192 "//frc971/wpilib:wpilib_interface",
193 "//frc971/wpilib:wpilib_robot_base",
194 "//third_party:phoenix",
195 "//third_party:phoenix6",
196 "//third_party:wpilib",
197 ],
198)
199
200cc_binary(
201 name = "joystick_reader",
202 srcs = [
203 ":joystick_reader.cc",
204 ],
205 deps = [
206 ":constants",
207 "//aos:init",
208 "//aos/actions:action_lib",
209 "//aos/logging",
210 "//frc971/autonomous:auto_fbs",
211 "//frc971/autonomous:base_autonomous_actor",
212 "//frc971/control_loops:profiled_subsystem_fbs",
213 "//frc971/input:action_joystick_input",
214 "//frc971/input:drivetrain_input",
215 "//frc971/input:joystick_input",
216 "//frc971/input:redundant_joystick_data",
217 "//y2024_defense/control_loops/drivetrain:drivetrain_base",
218 ],
219)
220
221py_library(
222 name = "python_init",
223 srcs = ["__init__.py"],
224 target_compatible_with = ["@platforms//os:linux"],
225 visibility = ["//visibility:public"],
226)
227
228sh_binary(
229 name = "log_web_proxy",
230 srcs = ["log_web_proxy.sh"],
231 data = [
232 ":aos_config",
233 "//aos/network:log_web_proxy_main",
234 "//y2024_defense/www:field_main_bundle.min.js",
235 "//y2024_defense/www:files",
236 ],
237 target_compatible_with = ["@platforms//os:linux"],
238)