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