blob: e1c8d06430b919155a164881980ac30746095338 [file] [log] [blame]
Ariv Diggi0af59c02023-10-07 13:15:39 -07001load("//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")
Ariv Diggi0af59c02023-10-07 13:15:39 -07004
5config_validator_test(
6 name = "config_validator_test",
7 config = "//y2023_bot3:aos_config",
8)
9
10robot_downloader(
11 binaries = [
12 "//aos/network:web_proxy_main",
13 "//aos/events/logging:log_cat",
14 "//y2023_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 "@ctre_phoenix6_api_cpp_athena//:shared_libraries",
21 "@ctre_phoenix6_tools_athena//:shared_libraries",
22 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
23 "@ctre_phoenix_cci_athena//:shared_libraries",
24 ],
25 dirs = [
26 "//y2023_bot3/www:www_files",
27 "//y2023_bot3/autonomous:splines",
28 ],
29 start_binaries = [
30 "//aos/events/logging:logger_main",
31 "//aos/network:web_proxy_main",
32 "//aos/starter:irq_affinity",
33 "//y2023_bot3/autonomous:binaries",
34 ":joystick_reader",
35 ":wpilib_interface",
36 "//frc971/can_logger",
37 "//aos/network:message_bridge_client",
38 "//aos/network:message_bridge_server",
39 "//y2023_bot3/control_loops/drivetrain:drivetrain",
40 "//y2023_bot3/control_loops/drivetrain:trajectory_generator",
41 "//y2023_bot3/control_loops/superstructure:superstructure",
42 ],
43 target_compatible_with = ["@platforms//os:linux"],
44)
45
46robot_downloader(
47 name = "pi_download",
48 binaries = [
49 "//aos/starter:irq_affinity",
50 "//aos/util:foxglove_websocket",
51 "//aos/events:aos_timing_report_streamer",
52 "//y2023_bot3/constants:constants_sender",
53 "//aos/network:web_proxy_main",
54 "//aos/events/logging:log_cat",
55 "//y2023_bot3/rockpi:imu_main",
56 "//frc971/image_streamer:image_streamer",
57 ],
58 data = [
59 ":aos_config",
60 "//frc971/rockpi:rockpi_config.json",
61 "//y2023_bot3/constants:constants.json",
62 "//y2023_bot3/www:www_files",
63 ],
64 dirs = [
65 "//y2023_bot3/www:www_files",
66 "//frc971/image_streamer/www:www_files",
67 ],
68 start_binaries = [
69 "//aos/network:message_bridge_client",
70 "//aos/network:message_bridge_server",
71 "//aos/network:web_proxy_main",
72 "//aos/starter:irq_affinity",
73 "//aos/events/logging:logger_main",
74 ],
75 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
76 target_type = "pi",
77)
78
79aos_config(
80 name = "aos_config",
81 src = "y2023_bot3.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 ],
88 target_compatible_with = ["@platforms//os:linux"],
89 visibility = ["//visibility:public"],
90 deps = [
91 ":config_imu",
92 ":config_roborio",
93 ],
94)
95
96aos_config(
97 name = "config_imu",
98 src = "y2023_bot3_imu.json",
99 flatbuffers = [
100 "//aos/network:message_bridge_client_fbs",
101 "//aos/network:message_bridge_server_fbs",
102 "//y2023_bot3/constants:constants_fbs",
103 "//aos/network:timestamp_fbs",
104 "//aos/network:remote_message_fbs",
105 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
106 ],
107 target_compatible_with = ["@platforms//os:linux"],
108 visibility = ["//visibility:public"],
109 deps = [
110 "//aos/events:aos_config",
111 "//frc971/control_loops/drivetrain:aos_config",
112 ],
113)
114
115aos_config(
116 name = "config_roborio",
117 src = "y2023_bot3_roborio.json",
118 flatbuffers = [
119 "//aos/network:remote_message_fbs",
120 "//aos/network:message_bridge_client_fbs",
121 "//aos/network:message_bridge_server_fbs",
122 "//y2023_bot3/constants:constants_fbs",
123 "//aos/network:timestamp_fbs",
124 "//y2019/control_loops/drivetrain:target_selector_fbs",
125 "//y2023_bot3/control_loops/superstructure:superstructure_goal_fbs",
126 "//y2023_bot3/control_loops/superstructure:superstructure_output_fbs",
127 "//y2023_bot3/control_loops/superstructure:superstructure_position_fbs",
128 "//y2023_bot3/control_loops/superstructure:superstructure_status_fbs",
129 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
130 "//frc971:can_configuration_fbs",
131 "//frc971/can_logger:can_logging_fbs",
132 ],
133 target_compatible_with = ["@platforms//os:linux"],
134 deps = [
135 "//aos/events:aos_config",
136 "//frc971/autonomous:aos_config",
137 "//frc971/control_loops/drivetrain:aos_config",
138 "//frc971/input:aos_config",
139 "//frc971/wpilib: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",
Maxwell Henderson43684fa2023-11-06 11:08:06 -0800159 "//frc971/zeroing:pot_and_absolute_encoder",
Ariv Diggi0af59c02023-10-07 13:15:39 -0700160 "//y2023_bot3/control_loops/drivetrain:polydrivetrain_plants",
Ariv Diggi0af59c02023-10-07 13:15:39 -0700161 "@com_github_google_glog//:glog",
162 "@com_google_absl//absl/base",
163 ],
164)
165
166cc_binary(
167 name = "wpilib_interface",
168 srcs = [
169 "wpilib_interface.cc",
170 ],
171 target_compatible_with = ["//tools/platforms/hardware:roborio"],
172 deps = [
173 ":constants",
174 "//aos:init",
175 "//aos:math",
176 "//aos/containers:sized_array",
177 "//aos/events:shm_event_loop",
178 "//aos/logging",
179 "//aos/stl_mutex",
180 "//aos/time",
181 "//aos/util:log_interval",
182 "//aos/util:phased_loop",
183 "//aos/util:wrapping_counter",
184 "//frc971:can_configuration_fbs",
185 "//frc971/autonomous:auto_mode_fbs",
186 "//frc971/control_loops:control_loop",
187 "//frc971/control_loops:control_loops_fbs",
188 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
189 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
190 "//frc971/input:robot_state_fbs",
191 "//frc971/queues:gyro_fbs",
192 "//frc971/wpilib:ADIS16448",
193 "//frc971/wpilib:buffered_pcm",
194 "//frc971/wpilib:drivetrain_writer",
195 "//frc971/wpilib:encoder_and_potentiometer",
196 "//frc971/wpilib:interrupt_edge_counting",
197 "//frc971/wpilib:joystick_sender",
198 "//frc971/wpilib:logging_fbs",
199 "//frc971/wpilib:loop_output_handler",
200 "//frc971/wpilib:pdp_fetcher",
201 "//frc971/wpilib:sensor_reader",
202 "//frc971/wpilib:wpilib_interface",
203 "//frc971/wpilib:wpilib_robot_base",
204 "//third_party:phoenix",
205 "//third_party:phoenix6",
206 "//third_party:wpilib",
207 "//y2023_bot3/control_loops/superstructure:led_indicator_lib",
208 "//y2023_bot3/control_loops/superstructure:superstructure_output_fbs",
209 "//y2023_bot3/control_loops/superstructure:superstructure_position_fbs",
210 ],
211)
212
213cc_binary(
214 name = "joystick_reader",
215 srcs = [
216 ":joystick_reader.cc",
217 ],
218 deps = [
219 ":constants",
220 "//aos:init",
221 "//aos/actions:action_lib",
222 "//aos/logging",
223 "//frc971/autonomous:auto_fbs",
224 "//frc971/autonomous:base_autonomous_actor",
225 "//frc971/control_loops:profiled_subsystem_fbs",
226 "//frc971/input:action_joystick_input",
227 "//frc971/input:drivetrain_input",
228 "//frc971/input:joystick_input",
229 "//frc971/input:redundant_joystick_data",
230 "//y2023_bot3/control_loops/drivetrain:drivetrain_base",
231 "//y2023_bot3/control_loops/superstructure:superstructure_goal_fbs",
232 "//y2023_bot3/control_loops/superstructure:superstructure_status_fbs",
233 ],
234)
235
236py_library(
237 name = "python_init",
238 srcs = ["__init__.py"],
239 target_compatible_with = ["@platforms//os:linux"],
240 visibility = ["//visibility:public"],
241)