blob: 010b17c6a5d3917ee17d29fe5b81dedc8e50cfce [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001load("//frc971:downloader.bzl", "robot_downloader")
2load("//aos:config.bzl", "aos_config")
3load("//aos/util:config_validator_macro.bzl", "config_validator_test")
4
5config_validator_test(
6 name = "config_validator_test",
7 config = "//y2024:aos_config",
8)
9
10robot_downloader(
11 binaries = [
12 "//aos/network:web_proxy_main",
13 "//aos/events/logging:log_cat",
14 "//y2024/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/constants:constants.json",
21 "@ctre_phoenix6_tools_athena//:shared_libraries",
22 "@ctre_phoenix_cci_athena//:shared_libraries",
23 ],
24 dirs = [
25 "//y2024/www:www_files",
26 "//y2024/autonomous:splines",
27 ],
28 start_binaries = [
29 "//aos/events/logging:logger_main",
30 "//aos/network:web_proxy_main",
31 "//aos/starter:irq_affinity",
32 "//y2024/autonomous:binaries",
33 ":joystick_reader",
34 ":wpilib_interface",
35 "//frc971/can_logger",
36 "//aos/network:message_bridge_client",
37 "//aos/network:message_bridge_server",
38 "//y2024/control_loops/drivetrain:drivetrain",
39 "//y2024/control_loops/drivetrain:trajectory_generator",
40 "//y2024/control_loops/superstructure:superstructure",
41 ],
42 target_compatible_with = ["@platforms//os:linux"],
43)
44
45robot_downloader(
46 name = "orin_download",
47 binaries = [
48 "//aos/starter:irq_affinity",
49 "//aos/util:foxglove_websocket",
50 "//aos/events:aos_timing_report_streamer",
51 "//y2024/constants:constants_sender",
52 "//aos/network:web_proxy_main",
53 ":joystick_republish",
54 "//aos/events/logging:log_cat",
55 "//frc971/image_streamer:image_streamer",
56 ],
57 data = [
58 ":aos_config",
59 "//y2024/constants:constants.json",
60 "//y2024/vision:image_streamer_start",
61 "//y2024/www:www_files",
62 ],
63 dirs = [
64 "//y2024/www:www_files",
65 "//frc971/image_streamer/www:www_files",
66 ],
67 start_binaries = [
68 "//aos/network:message_bridge_client",
69 "//aos/network:message_bridge_server",
70 "//aos/network:web_proxy_main",
71 "//aos/starter:irq_affinity",
72 "//y2024/vision:image_logger",
73 "//aos/events/logging:logger_main",
74 ],
75 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
76 target_type = "orin",
77)
78
79aos_config(
80 name = "aos_config",
81 src = "y2024.json",
82 flatbuffers = [
83 "//aos/network:message_bridge_client_fbs",
84 "//aos/network:message_bridge_server_fbs",
85 "//aos/network:timestamp_fbs",
86 "//frc971/input:robot_state_fbs",
87 "//frc971/vision:vision_fbs",
88 "//frc971/vision:target_map_fbs",
89 ],
90 target_compatible_with = ["@platforms//os:linux"],
91 visibility = ["//visibility:public"],
92 deps = [
93 ":config_imu",
94 ":config_roborio",
95 ],
96)
97
98aos_config(
99 name = "config_imu",
100 src = "y2024_imu.json",
101 flatbuffers = [
102 "//aos/network:message_bridge_client_fbs",
103 "//aos/network:message_bridge_server_fbs",
104 "//y2024/constants:constants_fbs",
105 "//aos/network:timestamp_fbs",
106 "//aos/network:remote_message_fbs",
107 ],
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 ],
114)
115
116aos_config(
117 name = "config_roborio",
118 src = "y2024_roborio.json",
119 flatbuffers = [
120 "//frc971:can_configuration_fbs",
121 "//aos/network:remote_message_fbs",
122 "//aos/network:message_bridge_client_fbs",
123 "//aos/network:message_bridge_server_fbs",
124 #y2019 stuff shouldn't be here (e.g. target selector)
125 "//y2024/constants:constants_fbs",
126 "//aos/network:timestamp_fbs",
127 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
128 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
129 "//y2024/control_loops/superstructure:superstructure_output_fbs",
130 "//y2024/control_loops/superstructure:superstructure_position_fbs",
131 "//y2024/control_loops/superstructure:superstructure_status_fbs",
132 "//frc971/can_logger:can_logging_fbs",
133 ],
134 target_compatible_with = ["@platforms//os:linux"],
135 deps = [
136 "//aos/events:aos_config",
137 "//frc971/autonomous:aos_config",
138 "//frc971/control_loops/drivetrain:aos_config",
139 "//frc971/input:aos_config",
140 ],
141)
142
143cc_library(
144 name = "constants",
145 srcs = [
146 "constants.cc",
147 ],
148 hdrs = [
149 "constants.h",
150 ],
151 visibility = ["//visibility:public"],
152 deps = [
153 "//aos/mutex",
154 "//aos/network:team_number",
155 "//frc971:constants",
156 "//frc971/control_loops:pose",
157 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
158 "//frc971/shooter_interpolation:interpolation",
159 "//frc971/zeroing:absolute_encoder",
160 "//frc971/zeroing:pot_and_absolute_encoder",
161 "//y2024/control_loops/drivetrain:polydrivetrain_plants",
162 "@com_github_google_glog//:glog",
163 "@com_google_absl//absl/base",
164 ],
165)
166
167cc_binary(
168 name = "wpilib_interface",
169 srcs = [
170 "wpilib_interface.cc",
171 ],
172 target_compatible_with = ["//tools/platforms/hardware:roborio"],
173 deps = [
174 ":constants",
175 "//aos:init",
176 "//aos:math",
177 "//aos/containers:sized_array",
178 "//aos/events:shm_event_loop",
179 "//aos/logging",
180 "//aos/stl_mutex",
181 "//aos/time",
182 "//aos/util:log_interval",
183 "//aos/util:phased_loop",
184 "//aos/util:wrapping_counter",
185 "//frc971:can_configuration_fbs",
186 "//frc971/autonomous:auto_mode_fbs",
187 "//frc971/control_loops:control_loop",
188 "//frc971/control_loops:control_loops_fbs",
189 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
190 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
191 "//frc971/input:robot_state_fbs",
192 "//frc971/queues:gyro_fbs",
193 "//frc971/wpilib:ADIS16448",
194 "//frc971/wpilib:buffered_pcm",
195 "//frc971/wpilib:dma",
196 "//frc971/wpilib:drivetrain_writer",
197 "//frc971/wpilib:encoder_and_potentiometer",
198 "//frc971/wpilib:joystick_sender",
199 "//frc971/wpilib:logging_fbs",
200 "//frc971/wpilib:pdp_fetcher",
201 "//frc971/wpilib:sensor_reader",
202 "//frc971/wpilib:wpilib_robot_base",
203 "//third_party:phoenix",
204 "//third_party:phoenix6",
205 "//third_party:wpilib",
206 "//y2024/control_loops/superstructure:superstructure_output_fbs",
207 "//y2024/control_loops/superstructure:superstructure_position_fbs",
208 ],
209)
210
211cc_binary(
212 name = "joystick_reader",
213 srcs = [
214 ":joystick_reader.cc",
215 ],
216 deps = [
217 ":constants",
218 "//aos:init",
219 "//aos/actions:action_lib",
220 "//aos/logging",
221 "//frc971/autonomous:auto_fbs",
222 "//frc971/autonomous:base_autonomous_actor",
223 "//frc971/control_loops:profiled_subsystem_fbs",
224 "//frc971/input:action_joystick_input",
225 "//frc971/input:drivetrain_input",
226 "//frc971/input:joystick_input",
227 "//frc971/input:redundant_joystick_data",
228 "//y2024/control_loops/drivetrain:drivetrain_base",
229 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
230 "//y2024/control_loops/superstructure:superstructure_status_fbs",
231 ],
232)
233
234cc_binary(
235 name = "joystick_republish",
236 srcs = [
237 "joystick_republish.cc",
238 ],
239 target_compatible_with = ["@platforms//os:linux"],
240 visibility = ["//visibility:public"],
241 deps = [
242 "//aos:configuration",
243 "//aos:flatbuffer_merge",
244 "//aos:init",
245 "//aos/events:shm_event_loop",
246 "//frc971/input:joystick_state_fbs",
247 "@com_github_google_glog//:glog",
248 ],
249)
250
251py_library(
252 name = "python_init",
253 srcs = ["__init__.py"],
254 target_compatible_with = ["@platforms//os:linux"],
255 visibility = ["//visibility:public"],
256)
257
258sh_binary(
259 name = "log_web_proxy",
260 srcs = ["log_web_proxy.sh"],
261 data = [
262 ":aos_config",
263 "//aos/network:log_web_proxy_main",
264 "//y2024/www:files",
265 ],
266 target_compatible_with = ["@platforms//os:linux"],
267)