blob: fabc87124871a026e2876b3066d8122813964ac8 [file] [log] [blame]
Austin Schuh76f227c2022-02-23 16:34:08 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library")
milind-u086d7262022-01-19 20:44:18 -08002load("@npm//@bazel/typescript:index.bzl", "ts_library")
3
4package(default_visibility = ["//visibility:public"])
5
6flatbuffer_cc_library(
7 name = "superstructure_goal_fbs",
8 srcs = [
9 "superstructure_goal.fbs",
10 ],
11 gen_reflections = 1,
12 includes = [
13 "//frc971/control_loops:control_loops_fbs_includes",
14 "//frc971/control_loops:profiled_subsystem_fbs_includes",
15 ],
16)
17
18flatbuffer_cc_library(
19 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
23 gen_reflections = 1,
24)
25
26flatbuffer_cc_library(
Milind Upadhyay482b0ba2022-02-26 21:51:59 -080027 name = "superstructure_can_position_fbs",
28 srcs = [
29 "superstructure_can_position.fbs",
30 ],
31 gen_reflections = 1,
32)
33
34flatbuffer_cc_library(
milind-u086d7262022-01-19 20:44:18 -080035 name = "superstructure_status_fbs",
36 srcs = [
37 "superstructure_status.fbs",
38 ],
39 gen_reflections = 1,
40 includes = [
41 "//frc971/control_loops:control_loops_fbs_includes",
42 "//frc971/control_loops:profiled_subsystem_fbs_includes",
43 ],
44)
45
Austin Schuh76f227c2022-02-23 16:34:08 -080046flatbuffer_ts_library(
47 name = "superstructure_status_ts_fbs",
48 srcs = [
49 "superstructure_status.fbs",
50 ],
James Kuszmauldac091f2022-03-22 09:35:06 -070051 deps = [
52 "//frc971/control_loops:control_loops_ts_fbs",
53 "//frc971/control_loops:profiled_subsystem_ts_fbs",
Austin Schuh76f227c2022-02-23 16:34:08 -080054 ],
Austin Schuh76f227c2022-02-23 16:34:08 -080055)
56
milind-u086d7262022-01-19 20:44:18 -080057flatbuffer_cc_library(
58 name = "superstructure_position_fbs",
59 srcs = [
60 "superstructure_position.fbs",
61 ],
62 gen_reflections = 1,
63 includes = [
64 "//frc971/control_loops:control_loops_fbs_includes",
65 "//frc971/control_loops:profiled_subsystem_fbs_includes",
66 ],
67)
68
69cc_library(
70 name = "superstructure_lib",
71 srcs = [
72 "superstructure.cc",
73 ],
74 hdrs = [
75 "superstructure.h",
76 ],
77 deps = [
Milind Upadhyay225156b2022-02-25 22:42:12 -080078 ":collision_avoidance_lib",
Ravago Jones5da06352022-03-04 20:26:24 -080079 ":superstructure_can_position_fbs",
milind-u086d7262022-01-19 20:44:18 -080080 ":superstructure_goal_fbs",
81 ":superstructure_output_fbs",
82 ":superstructure_position_fbs",
83 ":superstructure_status_fbs",
Ravago Jones3283ce02022-03-09 19:31:29 -080084 "//aos:flatbuffer_merge",
milind-u086d7262022-01-19 20:44:18 -080085 "//aos/events:event_loop",
86 "//frc971/control_loops:control_loop",
Henry Speiser55aa3ba2022-02-21 23:21:12 -080087 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u086d7262022-01-19 20:44:18 -080088 "//y2022:constants",
Austin Schuh39f26f62022-02-24 21:34:46 -080089 "//y2022/control_loops/superstructure/catapult",
James Kuszmaul84083f42022-02-27 17:24:38 -080090 "//y2022/control_loops/superstructure/turret:aiming",
Ravago Jonesd51af7a2022-03-26 21:44:20 -070091 "//y2022/vision:ball_color_fbs",
milind-u086d7262022-01-19 20:44:18 -080092 ],
93)
94
95cc_binary(
96 name = "superstructure",
97 srcs = [
98 "superstructure_main.cc",
99 ],
100 deps = [
101 ":superstructure_lib",
102 "//aos:init",
103 "//aos/events:shm_event_loop",
104 ],
105)
106
107cc_test(
108 name = "superstructure_lib_test",
109 srcs = [
110 "superstructure_lib_test.cc",
111 ],
112 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800113 "//y2022:aos_config",
milind-u086d7262022-01-19 20:44:18 -0800114 ],
115 deps = [
116 ":superstructure_goal_fbs",
117 ":superstructure_lib",
118 ":superstructure_output_fbs",
119 ":superstructure_position_fbs",
120 ":superstructure_status_fbs",
121 "//aos:math",
122 "//aos/events/logging:log_writer",
123 "//aos/testing:googletest",
124 "//aos/time",
125 "//frc971/control_loops:capped_test_plant",
126 "//frc971/control_loops:control_loop_test",
127 "//frc971/control_loops:position_sensor_sim",
128 "//frc971/control_loops:team_number_test_environment",
129 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
130 ],
131)
132
Milind Upadhyay9d68b132022-04-01 10:58:18 -0700133cc_binary(
134 name = "superstructure_replay",
135 srcs = ["superstructure_replay.cc"],
136 deps = [
137 ":superstructure_lib",
138 "//aos:configuration",
139 "//aos:init",
140 "//aos/events:simulated_event_loop",
141 "//aos/events/logging:log_reader",
142 "//aos/network:team_number",
143 ],
144)
145
Milind Upadhyay225156b2022-02-25 22:42:12 -0800146cc_library(
147 name = "collision_avoidance_lib",
148 srcs = ["collision_avoidance.cc"],
149 hdrs = ["collision_avoidance.h"],
150 target_compatible_with = ["@platforms//os:linux"],
151 deps = [
152 ":superstructure_goal_fbs",
153 ":superstructure_status_fbs",
154 "//frc971/control_loops:control_loops_fbs",
155 "//frc971/control_loops:profiled_subsystem_fbs",
156 "@com_github_google_glog//:glog",
157 "@com_google_absl//absl/functional:bind_front",
158 ],
159)
160
161cc_test(
162 name = "collision_avoidance_test",
163 srcs = ["collision_avoidance_test.cc"],
164 target_compatible_with = ["@platforms//os:linux"],
165 deps = [
166 ":collision_avoidance_lib",
167 ":superstructure_goal_fbs",
168 ":superstructure_status_fbs",
169 "//aos:flatbuffers",
170 "//aos:math",
171 "//aos/testing:googletest",
172 ],
173)
174
Henry Speiser77747b72022-03-06 17:18:29 -0800175cc_library(
176 name = "led_indicator_lib",
177 srcs = ["led_indicator.cc"],
178 hdrs = ["led_indicator.h"],
179 data = [
180 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
181 "@ctre_phoenix_cci_athena//:shared_libraries",
182 ],
183 target_compatible_with = ["//tools/platforms/hardware:roborio"],
184 deps = [
185 ":superstructure_output_fbs",
186 ":superstructure_status_fbs",
187 "//aos/events:event_loop",
Henry Speiser888c1962022-03-16 20:54:56 -0700188 "//aos/network:message_bridge_client_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800189 "//aos/network:message_bridge_server_fbs",
190 "//frc971/control_loops:control_loop",
191 "//frc971/control_loops:control_loops_fbs",
192 "//frc971/control_loops:profiled_subsystem_fbs",
193 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Henry Speisere562e322022-04-01 16:09:32 -0700194 "//frc971/queues:gyro_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800195 "//third_party:phoenix",
196 "//third_party:wpilib",
Austin Schuh3806ffb2022-04-13 19:44:10 -0700197 "//y2022/localizer:localizer_output_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800198 ],
199)
200
milind-u086d7262022-01-19 20:44:18 -0800201ts_library(
202 name = "superstructure_plotter",
203 srcs = ["superstructure_plotter.ts"],
204 target_compatible_with = ["@platforms//os:linux"],
205 deps = [
206 "//aos/network/www:aos_plotter",
207 "//aos/network/www:colors",
208 "//aos/network/www:proxy",
209 ],
210)
Austin Schuh76f227c2022-02-23 16:34:08 -0800211
212ts_library(
213 name = "catapult_plotter",
214 srcs = ["catapult_plotter.ts"],
215 target_compatible_with = ["@platforms//os:linux"],
216 deps = [
217 "//aos/network/www:aos_plotter",
218 "//aos/network/www:colors",
219 "//aos/network/www:proxy",
220 ],
221)
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800222
223ts_library(
224 name = "intake_plotter",
225 srcs = ["intake_plotter.ts"],
226 target_compatible_with = ["@platforms//os:linux"],
227 deps = [
228 "//aos/network/www:aos_plotter",
229 "//aos/network/www:colors",
230 "//aos/network/www:proxy",
231 ],
232)
233
234ts_library(
235 name = "turret_plotter",
236 srcs = ["turret_plotter.ts"],
237 target_compatible_with = ["@platforms//os:linux"],
238 deps = [
239 "//aos/network/www:aos_plotter",
240 "//aos/network/www:colors",
241 "//aos/network/www:proxy",
242 ],
243)
244
245ts_library(
246 name = "climber_plotter",
247 srcs = ["climber_plotter.ts"],
248 target_compatible_with = ["@platforms//os:linux"],
249 deps = [
250 "//aos/network/www:aos_plotter",
251 "//aos/network/www:colors",
252 "//aos/network/www:proxy",
253 ],
254)