blob: 669e6910d70d64f57dd0a43f86231c1259613f82 [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 ],
51 includes = [
52 "//frc971/control_loops:control_loops_fbs_includes",
53 "//frc971/control_loops:profiled_subsystem_fbs_includes",
54 ],
55 target_compatible_with = ["@platforms//os:linux"],
56)
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",
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 Upadhyay225156b2022-02-25 22:42:12 -0800133cc_library(
134 name = "collision_avoidance_lib",
135 srcs = ["collision_avoidance.cc"],
136 hdrs = ["collision_avoidance.h"],
137 target_compatible_with = ["@platforms//os:linux"],
138 deps = [
139 ":superstructure_goal_fbs",
140 ":superstructure_status_fbs",
141 "//frc971/control_loops:control_loops_fbs",
142 "//frc971/control_loops:profiled_subsystem_fbs",
143 "@com_github_google_glog//:glog",
144 "@com_google_absl//absl/functional:bind_front",
145 ],
146)
147
148cc_test(
149 name = "collision_avoidance_test",
150 srcs = ["collision_avoidance_test.cc"],
151 target_compatible_with = ["@platforms//os:linux"],
152 deps = [
153 ":collision_avoidance_lib",
154 ":superstructure_goal_fbs",
155 ":superstructure_status_fbs",
156 "//aos:flatbuffers",
157 "//aos:math",
158 "//aos/testing:googletest",
159 ],
160)
161
Henry Speiser77747b72022-03-06 17:18:29 -0800162cc_library(
163 name = "led_indicator_lib",
164 srcs = ["led_indicator.cc"],
165 hdrs = ["led_indicator.h"],
166 data = [
167 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
168 "@ctre_phoenix_cci_athena//:shared_libraries",
169 ],
170 target_compatible_with = ["//tools/platforms/hardware:roborio"],
171 deps = [
172 ":superstructure_output_fbs",
173 ":superstructure_status_fbs",
174 "//aos/events:event_loop",
175 "//aos/network:message_bridge_server_fbs",
176 "//frc971/control_loops:control_loop",
177 "//frc971/control_loops:control_loops_fbs",
178 "//frc971/control_loops:profiled_subsystem_fbs",
179 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
180 "//third_party:phoenix",
181 "//third_party:wpilib",
182 ],
183)
184
milind-u086d7262022-01-19 20:44:18 -0800185ts_library(
186 name = "superstructure_plotter",
187 srcs = ["superstructure_plotter.ts"],
188 target_compatible_with = ["@platforms//os:linux"],
189 deps = [
190 "//aos/network/www:aos_plotter",
191 "//aos/network/www:colors",
192 "//aos/network/www:proxy",
193 ],
194)
Austin Schuh76f227c2022-02-23 16:34:08 -0800195
196ts_library(
197 name = "catapult_plotter",
198 srcs = ["catapult_plotter.ts"],
199 target_compatible_with = ["@platforms//os:linux"],
200 deps = [
201 "//aos/network/www:aos_plotter",
202 "//aos/network/www:colors",
203 "//aos/network/www:proxy",
204 ],
205)
Milind Upadhyayeb739bb2022-03-02 10:49:21 -0800206
207ts_library(
208 name = "intake_plotter",
209 srcs = ["intake_plotter.ts"],
210 target_compatible_with = ["@platforms//os:linux"],
211 deps = [
212 "//aos/network/www:aos_plotter",
213 "//aos/network/www:colors",
214 "//aos/network/www:proxy",
215 ],
216)
217
218ts_library(
219 name = "turret_plotter",
220 srcs = ["turret_plotter.ts"],
221 target_compatible_with = ["@platforms//os:linux"],
222 deps = [
223 "//aos/network/www:aos_plotter",
224 "//aos/network/www:colors",
225 "//aos/network/www:proxy",
226 ],
227)
228
229ts_library(
230 name = "climber_plotter",
231 srcs = ["climber_plotter.ts"],
232 target_compatible_with = ["@platforms//os:linux"],
233 deps = [
234 "//aos/network/www:aos_plotter",
235 "//aos/network/www:colors",
236 "//aos/network/www:proxy",
237 ],
238)