blob: a0850494d9382e998f1538b1a92bcbcebb5553bb [file] [log] [blame]
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08001load("//tools/build_rules:js.bzl", "ts_project")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
3load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
milind-u086d7262022-01-19 20:44:18 -08004
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",
Niko Sohmerse69ee2d2022-09-28 19:52:27 -0700129 "//frc971/control_loops:subsystem_simulator",
milind-u086d7262022-01-19 20:44:18 -0800130 "//frc971/control_loops:team_number_test_environment",
131 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
132 ],
133)
134
Milind Upadhyay9d68b132022-04-01 10:58:18 -0700135cc_binary(
136 name = "superstructure_replay",
137 srcs = ["superstructure_replay.cc"],
138 deps = [
139 ":superstructure_lib",
140 "//aos:configuration",
141 "//aos:init",
142 "//aos/events:simulated_event_loop",
143 "//aos/events/logging:log_reader",
144 "//aos/network:team_number",
145 ],
146)
147
Milind Upadhyay225156b2022-02-25 22:42:12 -0800148cc_library(
149 name = "collision_avoidance_lib",
150 srcs = ["collision_avoidance.cc"],
151 hdrs = ["collision_avoidance.h"],
152 target_compatible_with = ["@platforms//os:linux"],
153 deps = [
154 ":superstructure_goal_fbs",
155 ":superstructure_status_fbs",
156 "//frc971/control_loops:control_loops_fbs",
157 "//frc971/control_loops:profiled_subsystem_fbs",
158 "@com_github_google_glog//:glog",
159 "@com_google_absl//absl/functional:bind_front",
160 ],
161)
162
163cc_test(
164 name = "collision_avoidance_test",
165 srcs = ["collision_avoidance_test.cc"],
166 target_compatible_with = ["@platforms//os:linux"],
167 deps = [
168 ":collision_avoidance_lib",
169 ":superstructure_goal_fbs",
170 ":superstructure_status_fbs",
171 "//aos:flatbuffers",
172 "//aos:math",
173 "//aos/testing:googletest",
174 ],
175)
176
Henry Speiser77747b72022-03-06 17:18:29 -0800177cc_library(
178 name = "led_indicator_lib",
179 srcs = ["led_indicator.cc"],
180 hdrs = ["led_indicator.h"],
181 data = [
182 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
183 "@ctre_phoenix_cci_athena//:shared_libraries",
184 ],
185 target_compatible_with = ["//tools/platforms/hardware:roborio"],
186 deps = [
187 ":superstructure_output_fbs",
188 ":superstructure_status_fbs",
189 "//aos/events:event_loop",
Henry Speiser888c1962022-03-16 20:54:56 -0700190 "//aos/network:message_bridge_client_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800191 "//aos/network:message_bridge_server_fbs",
192 "//frc971/control_loops:control_loop",
193 "//frc971/control_loops:control_loops_fbs",
194 "//frc971/control_loops:profiled_subsystem_fbs",
195 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Henry Speisere562e322022-04-01 16:09:32 -0700196 "//frc971/queues:gyro_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800197 "//third_party:phoenix",
198 "//third_party:wpilib",
Austin Schuh3806ffb2022-04-13 19:44:10 -0700199 "//y2022/localizer:localizer_output_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800200 ],
201)
202
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800203ts_project(
milind-u086d7262022-01-19 20:44:18 -0800204 name = "superstructure_plotter",
205 srcs = ["superstructure_plotter.ts"],
206 target_compatible_with = ["@platforms//os:linux"],
207 deps = [
208 "//aos/network/www:aos_plotter",
209 "//aos/network/www:colors",
210 "//aos/network/www:proxy",
211 ],
212)
Austin Schuh76f227c2022-02-23 16:34:08 -0800213
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800214ts_project(
Austin Schuh76f227c2022-02-23 16:34:08 -0800215 name = "catapult_plotter",
216 srcs = ["catapult_plotter.ts"],
217 target_compatible_with = ["@platforms//os:linux"],
218 deps = [
219 "//aos/network/www:aos_plotter",
220 "//aos/network/www:colors",
221 "//aos/network/www:proxy",
222 ],
223)
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800224
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800225ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800226 name = "intake_plotter",
227 srcs = ["intake_plotter.ts"],
228 target_compatible_with = ["@platforms//os:linux"],
229 deps = [
230 "//aos/network/www:aos_plotter",
231 "//aos/network/www:colors",
232 "//aos/network/www:proxy",
233 ],
234)
235
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800236ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800237 name = "turret_plotter",
238 srcs = ["turret_plotter.ts"],
239 target_compatible_with = ["@platforms//os:linux"],
240 deps = [
241 "//aos/network/www:aos_plotter",
242 "//aos/network/www:colors",
243 "//aos/network/www:proxy",
244 ],
245)
246
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800247ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800248 name = "climber_plotter",
249 srcs = ["climber_plotter.ts"],
250 target_compatible_with = ["@platforms//os:linux"],
251 deps = [
252 "//aos/network/www:aos_plotter",
253 "//aos/network/www:colors",
254 "//aos/network/www:proxy",
255 ],
256)