blob: 41cb85c312dba95a14633f827481ba12a30705da [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",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800195 "//frc971/wpilib:can_drivetrain_writer",
196 "//frc971/wpilib:can_sensor_reader",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800197 "//frc971/wpilib:dma",
198 "//frc971/wpilib:drivetrain_writer",
199 "//frc971/wpilib:encoder_and_potentiometer",
200 "//frc971/wpilib:joystick_sender",
201 "//frc971/wpilib:logging_fbs",
202 "//frc971/wpilib:pdp_fetcher",
203 "//frc971/wpilib:sensor_reader",
Maxwell Hendersonf75800f2024-01-12 19:52:05 -0800204 "//frc971/wpilib:talonfx",
Niko Sohmers3860f8a2024-01-12 21:05:19 -0800205 "//frc971/wpilib:wpilib_robot_base",
206 "//third_party:phoenix",
207 "//third_party:phoenix6",
208 "//third_party:wpilib",
209 "//y2024/control_loops/superstructure:superstructure_output_fbs",
210 "//y2024/control_loops/superstructure:superstructure_position_fbs",
211 ],
212)
213
214cc_binary(
215 name = "joystick_reader",
216 srcs = [
217 ":joystick_reader.cc",
218 ],
219 deps = [
220 ":constants",
221 "//aos:init",
222 "//aos/actions:action_lib",
223 "//aos/logging",
224 "//frc971/autonomous:auto_fbs",
225 "//frc971/autonomous:base_autonomous_actor",
226 "//frc971/control_loops:profiled_subsystem_fbs",
227 "//frc971/input:action_joystick_input",
228 "//frc971/input:drivetrain_input",
229 "//frc971/input:joystick_input",
230 "//frc971/input:redundant_joystick_data",
231 "//y2024/control_loops/drivetrain:drivetrain_base",
232 "//y2024/control_loops/superstructure:superstructure_goal_fbs",
233 "//y2024/control_loops/superstructure:superstructure_status_fbs",
234 ],
235)
236
237cc_binary(
238 name = "joystick_republish",
239 srcs = [
240 "joystick_republish.cc",
241 ],
242 target_compatible_with = ["@platforms//os:linux"],
243 visibility = ["//visibility:public"],
244 deps = [
245 "//aos:configuration",
246 "//aos:flatbuffer_merge",
247 "//aos:init",
248 "//aos/events:shm_event_loop",
249 "//frc971/input:joystick_state_fbs",
250 "@com_github_google_glog//:glog",
251 ],
252)
253
254py_library(
255 name = "python_init",
256 srcs = ["__init__.py"],
257 target_compatible_with = ["@platforms//os:linux"],
258 visibility = ["//visibility:public"],
259)
260
261sh_binary(
262 name = "log_web_proxy",
263 srcs = ["log_web_proxy.sh"],
264 data = [
265 ":aos_config",
266 "//aos/network:log_web_proxy_main",
267 "//y2024/www:files",
268 ],
269 target_compatible_with = ["@platforms//os:linux"],
270)