blob: 6025e3fdce80e6ce0f1e09239f96cfdf404e2caa [file] [log] [blame]
Ariv Diggi0af59c02023-10-07 13:15:39 -07001load("//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 = "//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",
159 "//y2023_bot3/control_loops/drivetrain:polydrivetrain_plants",
160 "@com_github_google_glog//:glog",
161 "@com_google_absl//absl/base",
162 ],
163)
164
165cc_binary(
166 name = "wpilib_interface",
167 srcs = [
168 "wpilib_interface.cc",
169 ],
170 target_compatible_with = ["//tools/platforms/hardware:roborio"],
171 deps = [
172 ":constants",
173 "//aos:init",
174 "//aos:math",
175 "//aos/containers:sized_array",
176 "//aos/events:shm_event_loop",
177 "//aos/logging",
178 "//aos/stl_mutex",
179 "//aos/time",
180 "//aos/util:log_interval",
181 "//aos/util:phased_loop",
182 "//aos/util:wrapping_counter",
183 "//frc971:can_configuration_fbs",
184 "//frc971/autonomous:auto_mode_fbs",
185 "//frc971/control_loops:control_loop",
186 "//frc971/control_loops:control_loops_fbs",
187 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
188 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
189 "//frc971/input:robot_state_fbs",
190 "//frc971/queues:gyro_fbs",
191 "//frc971/wpilib:ADIS16448",
192 "//frc971/wpilib:buffered_pcm",
193 "//frc971/wpilib:drivetrain_writer",
194 "//frc971/wpilib:encoder_and_potentiometer",
195 "//frc971/wpilib:interrupt_edge_counting",
196 "//frc971/wpilib:joystick_sender",
197 "//frc971/wpilib:logging_fbs",
198 "//frc971/wpilib:loop_output_handler",
199 "//frc971/wpilib:pdp_fetcher",
200 "//frc971/wpilib:sensor_reader",
201 "//frc971/wpilib:wpilib_interface",
202 "//frc971/wpilib:wpilib_robot_base",
203 "//third_party:phoenix",
204 "//third_party:phoenix6",
205 "//third_party:wpilib",
206 "//y2023_bot3/control_loops/superstructure:led_indicator_lib",
207 "//y2023_bot3/control_loops/superstructure:superstructure_output_fbs",
208 "//y2023_bot3/control_loops/superstructure:superstructure_position_fbs",
209 ],
210)
211
212cc_binary(
213 name = "joystick_reader",
214 srcs = [
215 ":joystick_reader.cc",
216 ],
217 deps = [
218 ":constants",
219 "//aos:init",
220 "//aos/actions:action_lib",
221 "//aos/logging",
222 "//frc971/autonomous:auto_fbs",
223 "//frc971/autonomous:base_autonomous_actor",
224 "//frc971/control_loops:profiled_subsystem_fbs",
225 "//frc971/input:action_joystick_input",
226 "//frc971/input:drivetrain_input",
227 "//frc971/input:joystick_input",
228 "//frc971/input:redundant_joystick_data",
229 "//y2023_bot3/control_loops/drivetrain:drivetrain_base",
230 "//y2023_bot3/control_loops/superstructure:superstructure_goal_fbs",
231 "//y2023_bot3/control_loops/superstructure:superstructure_status_fbs",
232 ],
233)
234
235py_library(
236 name = "python_init",
237 srcs = ["__init__.py"],
238 target_compatible_with = ["@platforms//os:linux"],
239 visibility = ["//visibility:public"],
240)