blob: 0f2737d11ebd3388fb78f7d9b5f07f976b420964 [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08002load("//tools/build_rules:js.bzl", "ts_project")
Austin Schuha1d006e2022-09-14 21:50:42 -07003load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
milind-u086d7262022-01-19 20:44:18 -08004
5package(default_visibility = ["//visibility:public"])
6
James Kuszmaulf01da392023-12-14 11:22:14 -08007static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -08008 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080012 deps = [
13 "//frc971/control_loops:control_loops_fbs",
14 "//frc971/control_loops:profiled_subsystem_fbs",
milind-u086d7262022-01-19 20:44:18 -080015 ],
16)
17
James Kuszmaulf01da392023-12-14 11:22:14 -080018static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -080019 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
milind-u086d7262022-01-19 20:44:18 -080023)
24
James Kuszmaulf01da392023-12-14 11:22:14 -080025static_flatbuffer(
Milind Upadhyay482b0ba2022-02-26 21:51:59 -080026 name = "superstructure_can_position_fbs",
27 srcs = [
28 "superstructure_can_position.fbs",
29 ],
Milind Upadhyay482b0ba2022-02-26 21:51:59 -080030)
31
James Kuszmaulf01da392023-12-14 11:22:14 -080032static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -080033 name = "superstructure_status_fbs",
34 srcs = [
35 "superstructure_status.fbs",
36 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080037 deps = [
38 "//frc971/control_loops:control_loops_fbs",
39 "//frc971/control_loops:profiled_subsystem_fbs",
milind-u086d7262022-01-19 20:44:18 -080040 ],
41)
42
Austin Schuh76f227c2022-02-23 16:34:08 -080043flatbuffer_ts_library(
44 name = "superstructure_status_ts_fbs",
45 srcs = [
46 "superstructure_status.fbs",
47 ],
James Kuszmauldac091f2022-03-22 09:35:06 -070048 deps = [
49 "//frc971/control_loops:control_loops_ts_fbs",
50 "//frc971/control_loops:profiled_subsystem_ts_fbs",
Austin Schuh76f227c2022-02-23 16:34:08 -080051 ],
Austin Schuh76f227c2022-02-23 16:34:08 -080052)
53
James Kuszmaulf01da392023-12-14 11:22:14 -080054static_flatbuffer(
milind-u086d7262022-01-19 20:44:18 -080055 name = "superstructure_position_fbs",
56 srcs = [
57 "superstructure_position.fbs",
58 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080059 deps = [
60 "//frc971/control_loops:control_loops_fbs",
61 "//frc971/control_loops:profiled_subsystem_fbs",
milind-u086d7262022-01-19 20:44:18 -080062 ],
63)
64
65cc_library(
66 name = "superstructure_lib",
67 srcs = [
68 "superstructure.cc",
69 ],
70 hdrs = [
71 "superstructure.h",
72 ],
73 deps = [
Milind Upadhyay225156b2022-02-25 22:42:12 -080074 ":collision_avoidance_lib",
Ravago Jones5da06352022-03-04 20:26:24 -080075 ":superstructure_can_position_fbs",
milind-u086d7262022-01-19 20:44:18 -080076 ":superstructure_goal_fbs",
77 ":superstructure_output_fbs",
78 ":superstructure_position_fbs",
79 ":superstructure_status_fbs",
Ravago Jones3283ce02022-03-09 19:31:29 -080080 "//aos:flatbuffer_merge",
milind-u086d7262022-01-19 20:44:18 -080081 "//aos/events:event_loop",
82 "//frc971/control_loops:control_loop",
Henry Speiser55aa3ba2022-02-21 23:21:12 -080083 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulec635d22023-08-12 18:39:24 -070084 "//frc971/zeroing:pot_and_absolute_encoder",
milind-u086d7262022-01-19 20:44:18 -080085 "//y2022:constants",
Austin Schuh39f26f62022-02-24 21:34:46 -080086 "//y2022/control_loops/superstructure/catapult",
James Kuszmaul84083f42022-02-27 17:24:38 -080087 "//y2022/control_loops/superstructure/turret:aiming",
Ravago Jonesd51af7a2022-03-26 21:44:20 -070088 "//y2022/vision:ball_color_fbs",
milind-u086d7262022-01-19 20:44:18 -080089 ],
90)
91
92cc_binary(
93 name = "superstructure",
94 srcs = [
95 "superstructure_main.cc",
96 ],
97 deps = [
98 ":superstructure_lib",
99 "//aos:init",
100 "//aos/events:shm_event_loop",
101 ],
102)
103
104cc_test(
105 name = "superstructure_lib_test",
106 srcs = [
107 "superstructure_lib_test.cc",
108 ],
109 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800110 "//y2022:aos_config",
milind-u086d7262022-01-19 20:44:18 -0800111 ],
112 deps = [
113 ":superstructure_goal_fbs",
114 ":superstructure_lib",
115 ":superstructure_output_fbs",
116 ":superstructure_position_fbs",
117 ":superstructure_status_fbs",
118 "//aos:math",
119 "//aos/events/logging:log_writer",
120 "//aos/testing:googletest",
121 "//aos/time",
122 "//frc971/control_loops:capped_test_plant",
123 "//frc971/control_loops:control_loop_test",
124 "//frc971/control_loops:position_sensor_sim",
Niko Sohmerse69ee2d2022-09-28 19:52:27 -0700125 "//frc971/control_loops:subsystem_simulator",
milind-u086d7262022-01-19 20:44:18 -0800126 "//frc971/control_loops:team_number_test_environment",
127 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
128 ],
129)
130
Milind Upadhyay9d68b132022-04-01 10:58:18 -0700131cc_binary(
132 name = "superstructure_replay",
133 srcs = ["superstructure_replay.cc"],
134 deps = [
135 ":superstructure_lib",
136 "//aos:configuration",
137 "//aos:init",
138 "//aos/events:simulated_event_loop",
139 "//aos/events/logging:log_reader",
140 "//aos/network:team_number",
141 ],
142)
143
Milind Upadhyay225156b2022-02-25 22:42:12 -0800144cc_library(
145 name = "collision_avoidance_lib",
146 srcs = ["collision_avoidance.cc"],
147 hdrs = ["collision_avoidance.h"],
148 target_compatible_with = ["@platforms//os:linux"],
149 deps = [
150 ":superstructure_goal_fbs",
151 ":superstructure_status_fbs",
152 "//frc971/control_loops:control_loops_fbs",
153 "//frc971/control_loops:profiled_subsystem_fbs",
154 "@com_github_google_glog//:glog",
155 "@com_google_absl//absl/functional:bind_front",
156 ],
157)
158
159cc_test(
160 name = "collision_avoidance_test",
161 srcs = ["collision_avoidance_test.cc"],
162 target_compatible_with = ["@platforms//os:linux"],
163 deps = [
164 ":collision_avoidance_lib",
165 ":superstructure_goal_fbs",
166 ":superstructure_status_fbs",
167 "//aos:flatbuffers",
168 "//aos:math",
169 "//aos/testing:googletest",
170 ],
171)
172
Henry Speiser77747b72022-03-06 17:18:29 -0800173cc_library(
174 name = "led_indicator_lib",
175 srcs = ["led_indicator.cc"],
176 hdrs = ["led_indicator.h"],
177 data = [
178 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
179 "@ctre_phoenix_cci_athena//:shared_libraries",
180 ],
181 target_compatible_with = ["//tools/platforms/hardware:roborio"],
182 deps = [
183 ":superstructure_output_fbs",
184 ":superstructure_status_fbs",
185 "//aos/events:event_loop",
Henry Speiser888c1962022-03-16 20:54:56 -0700186 "//aos/network:message_bridge_client_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800187 "//aos/network:message_bridge_server_fbs",
188 "//frc971/control_loops:control_loop",
189 "//frc971/control_loops:control_loops_fbs",
190 "//frc971/control_loops:profiled_subsystem_fbs",
191 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
James Kuszmaule3df1ed2023-02-20 16:21:17 -0800192 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
Henry Speisere562e322022-04-01 16:09:32 -0700193 "//frc971/queues:gyro_fbs",
Henry Speiser77747b72022-03-06 17:18:29 -0800194 "//third_party:phoenix",
195 "//third_party:wpilib",
196 ],
197)
198
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800199ts_project(
milind-u086d7262022-01-19 20:44:18 -0800200 name = "superstructure_plotter",
201 srcs = ["superstructure_plotter.ts"],
202 target_compatible_with = ["@platforms//os:linux"],
203 deps = [
204 "//aos/network/www:aos_plotter",
205 "//aos/network/www:colors",
206 "//aos/network/www:proxy",
207 ],
208)
Austin Schuh76f227c2022-02-23 16:34:08 -0800209
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800210ts_project(
Austin Schuh76f227c2022-02-23 16:34:08 -0800211 name = "catapult_plotter",
212 srcs = ["catapult_plotter.ts"],
213 target_compatible_with = ["@platforms//os:linux"],
214 deps = [
215 "//aos/network/www:aos_plotter",
216 "//aos/network/www:colors",
217 "//aos/network/www:proxy",
218 ],
219)
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800220
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800221ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800222 name = "intake_plotter",
223 srcs = ["intake_plotter.ts"],
224 target_compatible_with = ["@platforms//os:linux"],
225 deps = [
226 "//aos/network/www:aos_plotter",
227 "//aos/network/www:colors",
228 "//aos/network/www:proxy",
229 ],
230)
231
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800232ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800233 name = "turret_plotter",
234 srcs = ["turret_plotter.ts"],
235 target_compatible_with = ["@platforms//os:linux"],
236 deps = [
237 "//aos/network/www:aos_plotter",
238 "//aos/network/www:colors",
239 "//aos/network/www:proxy",
240 ],
241)
242
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800243ts_project(
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800244 name = "climber_plotter",
245 srcs = ["climber_plotter.ts"],
246 target_compatible_with = ["@platforms//os:linux"],
247 deps = [
248 "//aos/network/www:aos_plotter",
249 "//aos/network/www:colors",
250 "//aos/network/www:proxy",
251 ],
252)