blob: 925dd43fd3952883a3955b27fd3ac635620bb422 [file] [log] [blame]
Austin Schuha9df9ad2021-06-16 14:49:39 -07001load("//aos:config.bzl", "aos_config")
James Kuszmaulf01da392023-12-14 11:22:14 -08002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Austin Schuha1d006e2022-09-14 21:50:42 -07003load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Brian Silverman100534c2015-09-07 15:51:23 -04004
Philipp Schradercc016b32021-12-30 08:59:58 -08005package(default_visibility = ["//visibility:public"])
6
Brian Silverman100534c2015-09-07 15:51:23 -04007cc_library(
Niko Sohmerse69ee2d2022-09-28 19:52:27 -07008 name = "subsystem_simulator",
9 testonly = True,
10 hdrs = [
11 "subsystem_simulator.h",
12 ],
13 target_compatible_with = ["@platforms//os:linux"],
14 deps = [
15 "//frc971:constants",
16 "//frc971/control_loops:capped_test_plant",
17 "//frc971/control_loops:control_loop_test",
18 "//frc971/control_loops:position_sensor_sim",
19 ],
20)
21
22cc_library(
James Kuszmaul61750662021-06-21 21:32:33 -070023 name = "control_loop_test",
24 testonly = True,
25 srcs = [
26 "control_loop_test.cc",
27 ],
28 hdrs = [
29 "control_loop_test.h",
30 ],
31 target_compatible_with = ["@platforms//os:linux"],
32 deps = [
33 "//aos:flatbuffers",
34 "//aos:json_to_flatbuffer",
35 "//aos/events:simulated_event_loop",
Austin Schuh0debde12022-08-17 16:25:17 -070036 "//aos/network:testing_time_converter",
James Kuszmaul61750662021-06-21 21:32:33 -070037 "//aos/testing:googletest",
38 "//aos/testing:test_logging",
39 "//aos/time",
40 "//frc971/input:joystick_state_fbs",
41 "//frc971/input:robot_state_fbs",
42 ],
43)
44
45cc_library(
46 name = "polytope",
47 hdrs = [
48 "polytope.h",
49 ],
50 deps = [
51 "@org_tuxfamily_eigen//:eigen",
52 ] + select({
53 "@platforms//os:linux": [
54 "//aos/logging",
55 "//third_party/cddlib",
56 "@com_github_google_glog//:glog",
57 ],
58 "//conditions:default": [],
59 }),
60)
61
62cc_test(
63 name = "polytope_test",
64 srcs = [
65 "polytope_test.cc",
66 ],
67 target_compatible_with = ["@platforms//os:linux"],
68 deps = [
69 ":polytope",
70 "//aos/testing:googletest",
71 "//aos/testing:test_logging",
72 "@org_tuxfamily_eigen//:eigen",
73 ],
74)
75
76cc_library(
77 name = "control_loop",
78 srcs = [
79 "control_loop.cc",
80 "control_loop-tmpl.h",
81 ],
82 hdrs = [
83 "control_loop.h",
84 ],
85 target_compatible_with = ["@platforms//os:linux"],
86 deps = [
Stephan Pleines743f83a2024-02-02 18:32:09 -080087 "//aos/actions:action_lib",
James Kuszmaul61750662021-06-21 21:32:33 -070088 "//aos/events:event_loop",
89 "//aos/events:shm_event_loop",
90 "//aos/logging",
91 "//aos/time",
92 "//aos/util:log_interval",
93 "//frc971/input:joystick_state_fbs",
94 "//frc971/input:robot_state_fbs",
95 ],
96)
97
98cc_library(
99 name = "quaternion_utils",
100 srcs = [
101 "quaternion_utils.cc",
102 ],
103 hdrs = [
104 "quaternion_utils.h",
105 ],
106 target_compatible_with = ["@platforms//os:linux"],
107 deps = [
108 "@com_github_google_glog//:glog",
109 "@org_tuxfamily_eigen//:eigen",
110 ],
111)
112
113cc_test(
114 name = "quarternion_utils_test",
115 srcs = [
116 "quaternion_utils_test.cc",
117 ],
118 target_compatible_with = ["@platforms//os:linux"],
119 deps = [
milind-ue53bf552021-12-11 14:42:00 -0800120 ":jacobian",
James Kuszmaul61750662021-06-21 21:32:33 -0700121 ":quaternion_utils",
milind-ue53bf552021-12-11 14:42:00 -0800122 ":runge_kutta",
James Kuszmaul61750662021-06-21 21:32:33 -0700123 "//aos/testing:googletest",
124 "//aos/testing:random_seed",
125 "@com_github_google_glog//:glog",
126 "@org_tuxfamily_eigen//:eigen",
127 ],
128)
129
130cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800131 name = "team_number_test_environment",
132 testonly = True,
133 srcs = [
134 "team_number_test_environment.cc",
135 ],
136 hdrs = [
137 "team_number_test_environment.h",
138 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800139 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800140 deps = [
John Park33858a32018-09-28 23:05:48 -0700141 "//aos/network:team_number",
Austin Schuha647d602018-02-18 14:05:15 -0800142 "//aos/testing:googletest",
143 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400144)
145
146cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800147 name = "hybrid_state_feedback_loop_test",
148 srcs = [
149 "hybrid_state_feedback_loop_test.cc",
150 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800151 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800152 deps = [
153 ":hybrid_state_feedback_loop",
154 "//aos/testing:googletest",
155 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400156)
157
158cc_library(
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800159 name = "pose",
160 hdrs = ["pose.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800161 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800162 deps = [
163 "//aos/util:math",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700164 "@org_tuxfamily_eigen//:eigen",
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800165 ],
166)
167
168cc_test(
169 name = "pose_test",
170 srcs = ["pose_test.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800171 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800172 deps = [
173 ":pose",
174 "//aos/testing:googletest",
175 ],
176)
177
178cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800179 name = "hall_effect_tracker",
180 hdrs = [
181 "hall_effect_tracker.h",
182 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800183 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800184 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700185 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800186 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400187)
188
James Kuszmauldac091f2022-03-22 09:35:06 -0700189flatbuffer_ts_library(
190 name = "control_loops_ts_fbs",
191 srcs = [
192 "control_loops.fbs",
193 ],
194)
195
James Kuszmaulf01da392023-12-14 11:22:14 -0800196static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700197 name = "control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800198 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700199 "control_loops.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800200 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400201)
202
Niko Sohmers76f47562023-12-20 20:59:06 -0800203flatbuffer_ts_library(
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800204 name = "can_talonfx_ts_fbs",
Niko Sohmers76f47562023-12-20 20:59:06 -0800205 srcs = [
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800206 "can_talonfx.fbs",
Niko Sohmers76f47562023-12-20 20:59:06 -0800207 ],
208)
209
James Kuszmaulf01da392023-12-14 11:22:14 -0800210static_flatbuffer(
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800211 name = "can_talonfx_fbs",
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700212 srcs = [
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800213 "can_talonfx.fbs",
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700214 ],
215)
216
Brian Silverman100534c2015-09-07 15:51:23 -0400217cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800218 name = "position_sensor_sim_test",
219 srcs = [
220 "position_sensor_sim_test.cc",
221 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800222 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800223 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700224 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800225 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -0700226 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800227 "//aos/testing:googletest",
228 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400229)
230
231cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800232 name = "position_sensor_sim",
233 testonly = True,
234 srcs = [
235 "position_sensor_sim.cc",
236 ],
237 hdrs = [
238 "position_sensor_sim.h",
239 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700240 linkopts = [
241 "-lm",
242 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800243 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800244 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700245 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800246 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800247 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800248 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400249)
250
251cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800252 name = "gaussian_noise",
253 srcs = [
254 "gaussian_noise.cc",
255 ],
256 hdrs = [
257 "gaussian_noise.h",
258 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800259 linkopts = [
260 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800261 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800262 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700263)
264
265cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800266 name = "coerce_goal",
267 srcs = [
268 "coerce_goal.cc",
269 ],
270 hdrs = [
271 "coerce_goal.h",
272 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800273 linkopts = select({
274 "@platforms//os:linux": ["-lm"],
275 "//conditions:default": [],
276 }),
Austin Schuha647d602018-02-18 14:05:15 -0800277 deps = [
James Kuszmaul61750662021-06-21 21:32:33 -0700278 "//frc971/control_loops:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700279 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800280 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400281)
282
Lee Mracek65686142020-01-10 22:21:39 -0500283cc_test(
284 name = "coerce_goal_test",
285 srcs = [
286 "coerce_goal_test.cc",
287 ],
288 linkopts = [
289 "-lm",
290 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800291 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500292 deps = [
293 ":coerce_goal",
Lee Mracek65686142020-01-10 22:21:39 -0500294 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700295 "//frc971/control_loops:polytope",
Lee Mracek65686142020-01-10 22:21:39 -0500296 "@org_tuxfamily_eigen//:eigen",
297 ],
298)
299
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800300cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800301 name = "state_feedback_loop",
302 hdrs = [
303 "state_feedback_loop.h",
304 ],
305 deps = [
John Park33858a32018-09-28 23:05:48 -0700306 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700307 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800308 ] + select({
309 "@platforms//os:linux": ["//aos/logging"],
310 "//conditions:default": [],
311 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400312)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500313
314cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800315 name = "hybrid_state_feedback_loop",
316 hdrs = [
317 "hybrid_state_feedback_loop.h",
318 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800319 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800320 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100321 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800322 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700323 "//aos:macros",
John Park33858a32018-09-28 23:05:48 -0700324 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700325 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700326 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800327 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500328)
Austin Schuhacd335a2017-01-01 16:20:54 -0800329
330cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800331 name = "simple_capped_state_feedback_loop",
332 hdrs = [
333 "simple_capped_state_feedback_loop.h",
334 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800335 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800336 deps = [
337 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700338 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800339 ],
340)
341
342cc_library(
343 name = "runge_kutta",
344 hdrs = [
345 "runge_kutta.h",
346 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800347 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800348 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700349 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800350 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800351)
352
353cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800354 name = "runge_kutta_test",
355 srcs = [
356 "runge_kutta_test.cc",
357 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800358 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800359 deps = [
360 ":runge_kutta",
361 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700362 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800363 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800364)
Austin Schuh473a5652017-02-05 01:30:42 -0800365
Austin Schuh173a1592018-12-19 16:20:54 +1100366cc_library(
367 name = "fixed_quadrature",
368 hdrs = [
369 "fixed_quadrature.h",
370 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800371 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha935a082023-02-20 21:45:54 -0800372 deps = [
373 "@org_tuxfamily_eigen//:eigen",
374 ],
Austin Schuh173a1592018-12-19 16:20:54 +1100375)
376
377cc_test(
378 name = "fixed_quadrature_test",
379 srcs = [
380 "fixed_quadrature_test.cc",
381 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800382 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100383 deps = [
384 ":fixed_quadrature",
385 "//aos/testing:googletest",
386 ],
387)
388
James Kuszmauldac091f2022-03-22 09:35:06 -0700389flatbuffer_ts_library(
390 name = "profiled_subsystem_ts_fbs",
391 srcs = [
392 "profiled_subsystem.fbs",
393 ],
394 deps = [
395 ":control_loops_ts_fbs",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800396 ":state_feedback_loop_ts_fbs",
James Kuszmauldac091f2022-03-22 09:35:06 -0700397 ],
398)
399
James Kuszmaulf01da392023-12-14 11:22:14 -0800400static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700401 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800402 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700403 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800404 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800405 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800406 deps = [
407 ":control_loops_fbs",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800408 ":state_feedback_loop_fbs",
James Kuszmaulf01da392023-12-14 11:22:14 -0800409 ],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700410)
411
Austin Schuh473a5652017-02-05 01:30:42 -0800412cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800413 name = "profiled_subsystem",
414 srcs = [
415 "profiled_subsystem.cc",
416 ],
417 hdrs = [
418 "profiled_subsystem.h",
419 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800420 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800421 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700422 ":control_loops_fbs",
423 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800424 ":simple_capped_state_feedback_loop",
425 ":state_feedback_loop",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800426 ":state_feedback_loop_converters",
427 "//aos:flatbuffer_merge",
John Park33858a32018-09-28 23:05:48 -0700428 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700429 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800430 "//frc971/zeroing",
James Kuszmaulec635d22023-08-12 18:39:24 -0700431 "//frc971/zeroing:pot_and_index",
Austin Schuha647d602018-02-18 14:05:15 -0800432 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800433)
Austin Schuha647d602018-02-18 14:05:15 -0800434
435cc_library(
436 name = "jacobian",
437 hdrs = [
438 "jacobian.h",
439 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800440 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800441 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700442 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800443 ],
444)
445
446cc_test(
447 name = "jacobian_test",
448 srcs = [
449 "jacobian_test.cc",
450 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800451 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800452 deps = [
453 ":jacobian",
454 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700455 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800456 ],
457)
458
James Kuszmaul59a5c612019-01-22 07:56:08 -0800459cc_test(
460 name = "c2d_test",
461 srcs = [
462 "c2d_test.cc",
463 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800464 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800465 visibility = ["//visibility:public"],
466 deps = [
467 ":c2d",
468 ":runge_kutta",
469 "//aos/testing:googletest",
470 ],
471)
472
Austin Schuh03785132018-02-19 18:29:06 -0800473cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100474 name = "c2d",
475 hdrs = [
476 "c2d.h",
477 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800478 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100479 visibility = ["//visibility:public"],
480 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700481 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700482 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100483 ],
484)
485
486cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800487 name = "dlqr",
488 hdrs = [
489 "dlqr.h",
490 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800491 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800492 visibility = ["//visibility:public"],
493 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700494 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800495 "@slycot_repo//:slicot",
496 ],
497)
Brian Silverman6470f442018-08-05 12:08:16 -0700498
499py_library(
500 name = "python_init",
501 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800502 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700503 visibility = ["//visibility:public"],
504 deps = ["//frc971:python_init"],
505)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800506
507cc_library(
508 name = "binomial",
509 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800510 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800511)
512
513cc_test(
514 name = "binomial_test",
515 srcs = [
516 "binomial_test.cc",
517 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800518 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800519 deps = [
520 ":binomial",
521 "//aos/testing:googletest",
522 ],
523)
Tyler Chatow12581562019-01-26 20:42:42 -0800524
525cc_library(
526 name = "capped_test_plant",
527 testonly = True,
528 srcs = [
529 "capped_test_plant.cc",
530 ],
531 hdrs = [
532 "capped_test_plant.h",
533 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800534 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800535 deps = [
536 ":state_feedback_loop",
537 "//aos/testing:googletest",
538 ],
539)
540
541cc_library(
542 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800543 hdrs = [
544 "static_zeroing_single_dof_profiled_subsystem.h",
545 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800546 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800547 deps = [
548 "//frc971/control_loops:profiled_subsystem",
549 ],
550)
551
552genrule(
553 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
554 outs = [
555 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
556 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800557 "static_zeroing_single_dof_profiled_subsystem_test_plant.json",
Tyler Chatow12581562019-01-26 20:42:42 -0800558 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
559 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800560 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.json",
Tyler Chatow12581562019-01-26 20:42:42 -0800561 ],
562 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800563 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800564 tools = [
565 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
566 ],
567)
568
569cc_library(
570 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
571 srcs = [
572 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
573 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
574 ],
575 hdrs = [
576 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
577 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
578 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800579 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800580 deps = [
581 ":state_feedback_loop",
582 ],
583)
584
James Kuszmaulf01da392023-12-14 11:22:14 -0800585static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700586 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700587 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700588 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700589 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700590 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800591 deps = [
592 ":control_loops_fbs",
593 ":profiled_subsystem_fbs",
594 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700595)
596
James Kuszmaulf01da392023-12-14 11:22:14 -0800597static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700598 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
599 srcs = [
600 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
601 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700602 target_compatible_with = ["@platforms//os:linux"],
603)
604
James Kuszmaulf01da392023-12-14 11:22:14 -0800605static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700606 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
607 srcs = [
608 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
609 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700610 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800611 deps = [
612 ":control_loops_fbs",
613 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700614)
615
James Kuszmaulf01da392023-12-14 11:22:14 -0800616static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700617 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
618 srcs = [
619 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
620 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700621 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800622 deps = [
623 ":control_loops_fbs",
624 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700625)
626
James Kuszmaulf01da392023-12-14 11:22:14 -0800627static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700628 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
629 srcs = [
630 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
631 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700632 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800633 deps = [
634 ":control_loops_fbs",
635 ":profiled_subsystem_fbs",
636 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700637)
638
James Kuszmaulf01da392023-12-14 11:22:14 -0800639static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700640 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
641 srcs = [
642 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
643 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800644 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800645 deps = [
646 ":control_loops_fbs",
647 ":profiled_subsystem_fbs",
648 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700649)
650
Tyler Chatow12581562019-01-26 20:42:42 -0800651cc_test(
652 name = "static_zeroing_single_dof_profiled_subsystem_test",
653 srcs = [
654 "static_zeroing_single_dof_profiled_subsystem_test.cc",
655 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700656 data = [
657 ":static_zeroing_single_dof_profiled_subsystem_test_config",
658 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800659 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800660 deps = [
661 ":capped_test_plant",
662 ":position_sensor_sim",
663 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700664 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
665 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800666 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700667 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
668 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
669 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
670 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800671 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700672 "//frc971/control_loops:control_loop_test",
James Kuszmaulec635d22023-08-12 18:39:24 -0700673 "//frc971/zeroing:absolute_and_absolute_encoder",
674 "//frc971/zeroing:absolute_encoder",
675 "//frc971/zeroing:pot_and_absolute_encoder",
Tyler Chatow12581562019-01-26 20:42:42 -0800676 ],
677)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700678
679aos_config(
680 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
681 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
682 flatbuffers = [
683 "//frc971/input:joystick_state_fbs",
684 "//frc971/input:robot_state_fbs",
685 "//aos/logging:log_message_fbs",
686 "//aos/events:event_loop_fbs",
687 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
688 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
689 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
690 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
691 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
692 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
693 ],
694 target_compatible_with = ["@platforms//os:linux"],
695)
James Kuszmauleeb98e92024-01-14 22:15:32 -0800696
697static_flatbuffer(
698 name = "state_feedback_loop_fbs",
699 srcs = ["state_feedback_loop.fbs"],
700 deps = ["//frc971/math:matrix_fbs"],
701)
702
703flatbuffer_ts_library(
704 name = "state_feedback_loop_ts_fbs",
705 srcs = ["state_feedback_loop.fbs"],
706 deps = ["//frc971/math:matrix_ts_fbs"],
707)
708
709cc_library(
710 name = "hybrid_state_feedback_loop_converters",
711 srcs = ["hybrid_state_feedback_loop_converters.h"],
712 deps = [
713 ":hybrid_state_feedback_loop",
714 ":state_feedback_loop_converters",
715 ":state_feedback_loop_fbs",
716 "//frc971/math:flatbuffers_matrix",
717 ],
718)
719
720cc_library(
721 name = "state_feedback_loop_converters",
722 srcs = ["state_feedback_loop_converters.h"],
723 deps = [
724 ":state_feedback_loop",
725 ":state_feedback_loop_fbs",
726 "//frc971/math:flatbuffers_matrix",
727 ],
728)