blob: 125ff447471288953b26f38dc45401cb7f8025f2 [file] [log] [blame]
Henry Speiser354d2782022-07-22 13:56:48 -07001load("//frc971:downloader.bzl", "robot_downloader")
2load("//aos:config.bzl", "aos_config")
3
4robot_downloader(
5 binaries = [
6 "//aos/network:web_proxy_main",
7 "//aos/events/logging:log_cat",
8 ],
9 data = [
10 ":aos_config",
Maxwell Hendersonfcc0d122023-08-05 17:03:34 -070011 "@ctre_phoenix6_api_cpp_athena//:shared_libraries",
12 "@ctre_phoenix6_tools_athena//:shared_libraries",
Henry Speiser354d2782022-07-22 13:56:48 -070013 ],
14 dirs = [
15 "//y2022_bot3/actors:splines",
16 ],
17 start_binaries = [
18 "//aos/events/logging:logger_main",
Henry Speiser354d2782022-07-22 13:56:48 -070019 ":joystick_reader",
20 ":wpilib_interface",
Henry Speiser354d2782022-07-22 13:56:48 -070021 "//y2022_bot3/control_loops/drivetrain:drivetrain",
22 "//y2022_bot3/control_loops/drivetrain:trajectory_generator",
Henry Speiser354d2782022-07-22 13:56:48 -070023 ],
24 target_compatible_with = ["@platforms//os:linux"],
25)
26
27robot_downloader(
28 name = "pi_download",
29 binaries = [
30 "//aos/events/logging:log_cat",
31 ],
32 data = [
33 ":aos_config",
34 ],
35 start_binaries = [
36 "//aos/events/logging:logger_main",
37 "//aos/network:message_bridge_client",
38 "//aos/network:message_bridge_server",
39 "//aos/network:web_proxy_main",
40 ],
41 target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"],
42 target_type = "pi",
43)
44
45aos_config(
46 name = "aos_config",
47 src = "y2022_bot3.json",
48 flatbuffers = [
49 "//aos/network:message_bridge_client_fbs",
50 "//aos/network:message_bridge_server_fbs",
51 "//aos/network:timestamp_fbs",
52 "//frc971/input:robot_state_fbs",
53 ],
54 target_compatible_with = ["@platforms//os:linux"],
55 visibility = ["//visibility:public"],
56 deps = [
57 ":config_imu",
58 ":config_roborio",
59 ],
60)
61
62aos_config(
63 name = "config_imu",
64 src = "y2022_bot3_imu.json",
65 flatbuffers = [
66 "//aos/network:message_bridge_client_fbs",
67 "//aos/network:message_bridge_server_fbs",
68 "//aos/network:timestamp_fbs",
69 "//aos/network:remote_message_fbs",
70 ],
71 target_compatible_with = ["@platforms//os:linux"],
72 visibility = ["//visibility:public"],
73 deps = [
74 "//aos/events:aos_config",
75 "//frc971/control_loops/drivetrain:aos_config",
76 ],
77)
78
79aos_config(
80 name = "config_roborio",
81 src = "y2022_bot3_roborio.json",
82 flatbuffers = [
83 "//aos/network:remote_message_fbs",
84 "//aos/network:message_bridge_client_fbs",
85 "//aos/network:message_bridge_server_fbs",
86 "//aos/network:timestamp_fbs",
87 "//y2019/control_loops/drivetrain:target_selector_fbs",
88 "//y2022_bot3/control_loops/superstructure:superstructure_goal_fbs",
89 "//y2022_bot3/control_loops/superstructure:superstructure_output_fbs",
90 "//y2022_bot3/control_loops/superstructure:superstructure_position_fbs",
91 "//y2022_bot3/control_loops/superstructure:superstructure_status_fbs",
92 ],
93 target_compatible_with = ["@platforms//os:linux"],
94 deps = [
95 "//aos/events:aos_config",
96 "//frc971/autonomous:aos_config",
97 "//frc971/control_loops/drivetrain:aos_config",
98 "//frc971/input:aos_config",
99 "//frc971/wpilib:aos_config",
100 ],
101)
102
103cc_library(
104 name = "constants",
105 srcs = [
106 "constants.cc",
107 ],
108 hdrs = [
109 "constants.h",
110 ],
111 visibility = ["//visibility:public"],
112 deps = [
113 "//aos/mutex",
114 "//aos/network:team_number",
115 "//frc971:constants",
116 "//frc971/control_loops:pose",
117 "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
118 "//frc971/shooter_interpolation:interpolation",
James Kuszmaulec635d22023-08-12 18:39:24 -0700119 "//frc971/zeroing:pot_and_absolute_encoder",
Henry Speiser354d2782022-07-22 13:56:48 -0700120 "//y2022_bot3/control_loops/drivetrain:polydrivetrain_plants",
Thiago Monteiroa47ae662022-08-27 16:05:54 -0700121 "//y2022_bot3/control_loops/superstructure/climber:climber_plants",
122 "//y2022_bot3/control_loops/superstructure/intake:intake_plants",
Henry Speiser354d2782022-07-22 13:56:48 -0700123 "@com_github_google_glog//:glog",
124 "@com_google_absl//absl/base",
125 ],
126)
127
128cc_binary(
129 name = "wpilib_interface",
130 srcs = [
131 "wpilib_interface.cc",
132 ],
133 target_compatible_with = ["//tools/platforms/hardware:roborio"],
134 deps = [
135 ":constants",
136 "//aos:init",
137 "//aos:math",
138 "//aos/events:shm_event_loop",
139 "//aos/logging",
140 "//aos/stl_mutex",
141 "//aos/time",
142 "//aos/util:log_interval",
143 "//aos/util:phased_loop",
144 "//aos/util:wrapping_counter",
145 "//frc971/autonomous:auto_mode_fbs",
146 "//frc971/control_loops:control_loop",
147 "//frc971/control_loops:control_loops_fbs",
148 "//frc971/control_loops/drivetrain:drivetrain_position_fbs",
149 "//frc971/input:robot_state_fbs",
150 "//frc971/queues:gyro_fbs",
151 "//frc971/wpilib:ADIS16448",
152 "//frc971/wpilib:buffered_pcm",
153 "//frc971/wpilib:drivetrain_writer",
154 "//frc971/wpilib:encoder_and_potentiometer",
155 "//frc971/wpilib:interrupt_edge_counting",
156 "//frc971/wpilib:joystick_sender",
157 "//frc971/wpilib:logging_fbs",
158 "//frc971/wpilib:loop_output_handler",
159 "//frc971/wpilib:pdp_fetcher",
160 "//frc971/wpilib:sensor_reader",
161 "//frc971/wpilib:wpilib_interface",
162 "//frc971/wpilib:wpilib_robot_base",
163 "//third_party:phoenix",
164 "//third_party:wpilib",
165 "//y2022_bot3/control_loops/superstructure:superstructure_output_fbs",
166 "//y2022_bot3/control_loops/superstructure:superstructure_position_fbs",
167 ],
168)
169
170cc_binary(
171 name = "joystick_reader",
172 srcs = [
173 ":joystick_reader.cc",
174 ],
175 deps = [
176 ":constants",
177 "//aos:init",
178 "//aos/actions:action_lib",
179 "//aos/logging",
180 "//frc971/autonomous:auto_fbs",
181 "//frc971/autonomous:base_autonomous_actor",
182 "//frc971/control_loops:profiled_subsystem_fbs",
183 "//frc971/input:action_joystick_input",
184 "//frc971/input:drivetrain_input",
185 "//frc971/input:joystick_input",
186 "//y2022_bot3/control_loops/drivetrain:drivetrain_base",
187 "//y2022_bot3/control_loops/superstructure:superstructure_goal_fbs",
188 "//y2022_bot3/control_loops/superstructure:superstructure_status_fbs",
189 ],
190)
191
192py_library(
193 name = "python_init",
194 srcs = ["__init__.py"],
195 target_compatible_with = ["@platforms//os:linux"],
196 visibility = ["//visibility:public"],
197)
198
199sh_binary(
200 name = "log_web_proxy",
201 srcs = ["log_web_proxy.sh"],
202 data = [
203 ":aos_config",
204 "//aos/network:log_web_proxy_main",
205 ],
206 target_compatible_with = ["@platforms//os:linux"],
207)