blob: 1c1b7976180bf0c7da4eeb785bd92cae874f8d65 [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 = [
87 "//aos/events:event_loop",
88 "//aos/events:shm_event_loop",
89 "//aos/logging",
90 "//aos/time",
91 "//aos/util:log_interval",
92 "//frc971/input:joystick_state_fbs",
93 "//frc971/input:robot_state_fbs",
94 ],
95)
96
97cc_library(
98 name = "quaternion_utils",
99 srcs = [
100 "quaternion_utils.cc",
101 ],
102 hdrs = [
103 "quaternion_utils.h",
104 ],
105 target_compatible_with = ["@platforms//os:linux"],
106 deps = [
107 "@com_github_google_glog//:glog",
108 "@org_tuxfamily_eigen//:eigen",
109 ],
110)
111
112cc_test(
113 name = "quarternion_utils_test",
114 srcs = [
115 "quaternion_utils_test.cc",
116 ],
117 target_compatible_with = ["@platforms//os:linux"],
118 deps = [
milind-ue53bf552021-12-11 14:42:00 -0800119 ":jacobian",
James Kuszmaul61750662021-06-21 21:32:33 -0700120 ":quaternion_utils",
milind-ue53bf552021-12-11 14:42:00 -0800121 ":runge_kutta",
James Kuszmaul61750662021-06-21 21:32:33 -0700122 "//aos/testing:googletest",
123 "//aos/testing:random_seed",
124 "@com_github_google_glog//:glog",
125 "@org_tuxfamily_eigen//:eigen",
126 ],
127)
128
129cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800130 name = "team_number_test_environment",
131 testonly = True,
132 srcs = [
133 "team_number_test_environment.cc",
134 ],
135 hdrs = [
136 "team_number_test_environment.h",
137 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800138 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800139 deps = [
John Park33858a32018-09-28 23:05:48 -0700140 "//aos/network:team_number",
Austin Schuha647d602018-02-18 14:05:15 -0800141 "//aos/testing:googletest",
142 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400143)
144
145cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800146 name = "hybrid_state_feedback_loop_test",
147 srcs = [
148 "hybrid_state_feedback_loop_test.cc",
149 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800150 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800151 deps = [
152 ":hybrid_state_feedback_loop",
153 "//aos/testing:googletest",
154 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400155)
156
157cc_library(
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800158 name = "pose",
159 hdrs = ["pose.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800160 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800161 deps = [
162 "//aos/util:math",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700163 "@org_tuxfamily_eigen//:eigen",
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800164 ],
165)
166
167cc_test(
168 name = "pose_test",
169 srcs = ["pose_test.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800170 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul9f9676d2019-01-25 21:27:58 -0800171 deps = [
172 ":pose",
173 "//aos/testing:googletest",
174 ],
175)
176
177cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800178 name = "hall_effect_tracker",
179 hdrs = [
180 "hall_effect_tracker.h",
181 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800182 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800183 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700184 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800185 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400186)
187
James Kuszmauldac091f2022-03-22 09:35:06 -0700188flatbuffer_ts_library(
189 name = "control_loops_ts_fbs",
190 srcs = [
191 "control_loops.fbs",
192 ],
193)
194
James Kuszmaulf01da392023-12-14 11:22:14 -0800195static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700196 name = "control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800197 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700198 "control_loops.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800199 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400200)
201
Niko Sohmers76f47562023-12-20 20:59:06 -0800202flatbuffer_ts_library(
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800203 name = "can_talonfx_ts_fbs",
Niko Sohmers76f47562023-12-20 20:59:06 -0800204 srcs = [
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800205 "can_talonfx.fbs",
Niko Sohmers76f47562023-12-20 20:59:06 -0800206 ],
207)
208
James Kuszmaulf01da392023-12-14 11:22:14 -0800209static_flatbuffer(
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800210 name = "can_talonfx_fbs",
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700211 srcs = [
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800212 "can_talonfx.fbs",
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700213 ],
214)
215
Brian Silverman100534c2015-09-07 15:51:23 -0400216cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800217 name = "position_sensor_sim_test",
218 srcs = [
219 "position_sensor_sim_test.cc",
220 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800221 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800222 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700223 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800224 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -0700225 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800226 "//aos/testing:googletest",
227 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400228)
229
230cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800231 name = "position_sensor_sim",
232 testonly = True,
233 srcs = [
234 "position_sensor_sim.cc",
235 ],
236 hdrs = [
237 "position_sensor_sim.h",
238 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700239 linkopts = [
240 "-lm",
241 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800242 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800243 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700244 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800245 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800246 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800247 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400248)
249
250cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800251 name = "gaussian_noise",
252 srcs = [
253 "gaussian_noise.cc",
254 ],
255 hdrs = [
256 "gaussian_noise.h",
257 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800258 linkopts = [
259 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800260 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800261 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700262)
263
264cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800265 name = "coerce_goal",
266 srcs = [
267 "coerce_goal.cc",
268 ],
269 hdrs = [
270 "coerce_goal.h",
271 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 linkopts = select({
273 "@platforms//os:linux": ["-lm"],
274 "//conditions:default": [],
275 }),
Austin Schuha647d602018-02-18 14:05:15 -0800276 deps = [
James Kuszmaul61750662021-06-21 21:32:33 -0700277 "//frc971/control_loops:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700278 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800279 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400280)
281
Lee Mracek65686142020-01-10 22:21:39 -0500282cc_test(
283 name = "coerce_goal_test",
284 srcs = [
285 "coerce_goal_test.cc",
286 ],
287 linkopts = [
288 "-lm",
289 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800290 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500291 deps = [
292 ":coerce_goal",
Lee Mracek65686142020-01-10 22:21:39 -0500293 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700294 "//frc971/control_loops:polytope",
Lee Mracek65686142020-01-10 22:21:39 -0500295 "@org_tuxfamily_eigen//:eigen",
296 ],
297)
298
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800299cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800300 name = "state_feedback_loop",
301 hdrs = [
302 "state_feedback_loop.h",
303 ],
304 deps = [
John Park33858a32018-09-28 23:05:48 -0700305 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700306 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800307 ] + select({
308 "@platforms//os:linux": ["//aos/logging"],
309 "//conditions:default": [],
310 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400311)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500312
313cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800314 name = "hybrid_state_feedback_loop",
315 hdrs = [
316 "hybrid_state_feedback_loop.h",
317 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800318 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800319 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100320 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800321 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700322 "//aos:macros",
John Park33858a32018-09-28 23:05:48 -0700323 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700324 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700325 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800326 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500327)
Austin Schuhacd335a2017-01-01 16:20:54 -0800328
329cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800330 name = "simple_capped_state_feedback_loop",
331 hdrs = [
332 "simple_capped_state_feedback_loop.h",
333 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800334 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800335 deps = [
336 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700337 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800338 ],
339)
340
341cc_library(
342 name = "runge_kutta",
343 hdrs = [
344 "runge_kutta.h",
345 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800346 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800347 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700348 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800349 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800350)
351
352cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800353 name = "runge_kutta_test",
354 srcs = [
355 "runge_kutta_test.cc",
356 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800357 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800358 deps = [
359 ":runge_kutta",
360 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700361 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800362 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800363)
Austin Schuh473a5652017-02-05 01:30:42 -0800364
Austin Schuh173a1592018-12-19 16:20:54 +1100365cc_library(
366 name = "fixed_quadrature",
367 hdrs = [
368 "fixed_quadrature.h",
369 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800370 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha935a082023-02-20 21:45:54 -0800371 deps = [
372 "@org_tuxfamily_eigen//:eigen",
373 ],
Austin Schuh173a1592018-12-19 16:20:54 +1100374)
375
376cc_test(
377 name = "fixed_quadrature_test",
378 srcs = [
379 "fixed_quadrature_test.cc",
380 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800381 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100382 deps = [
383 ":fixed_quadrature",
384 "//aos/testing:googletest",
385 ],
386)
387
James Kuszmauldac091f2022-03-22 09:35:06 -0700388flatbuffer_ts_library(
389 name = "profiled_subsystem_ts_fbs",
390 srcs = [
391 "profiled_subsystem.fbs",
392 ],
393 deps = [
394 ":control_loops_ts_fbs",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800395 ":state_feedback_loop_ts_fbs",
James Kuszmauldac091f2022-03-22 09:35:06 -0700396 ],
397)
398
James Kuszmaulf01da392023-12-14 11:22:14 -0800399static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700400 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800401 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700402 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800403 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800404 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800405 deps = [
406 ":control_loops_fbs",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800407 ":state_feedback_loop_fbs",
James Kuszmaulf01da392023-12-14 11:22:14 -0800408 ],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700409)
410
Austin Schuh473a5652017-02-05 01:30:42 -0800411cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800412 name = "profiled_subsystem",
413 srcs = [
414 "profiled_subsystem.cc",
415 ],
416 hdrs = [
417 "profiled_subsystem.h",
418 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800419 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800420 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700421 ":control_loops_fbs",
422 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800423 ":simple_capped_state_feedback_loop",
424 ":state_feedback_loop",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800425 ":state_feedback_loop_converters",
426 "//aos:flatbuffer_merge",
John Park33858a32018-09-28 23:05:48 -0700427 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700428 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800429 "//frc971/zeroing",
James Kuszmaulec635d22023-08-12 18:39:24 -0700430 "//frc971/zeroing:pot_and_index",
Austin Schuha647d602018-02-18 14:05:15 -0800431 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800432)
Austin Schuha647d602018-02-18 14:05:15 -0800433
434cc_library(
435 name = "jacobian",
436 hdrs = [
437 "jacobian.h",
438 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800439 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800440 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700441 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800442 ],
443)
444
445cc_test(
446 name = "jacobian_test",
447 srcs = [
448 "jacobian_test.cc",
449 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800450 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800451 deps = [
452 ":jacobian",
453 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700454 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800455 ],
456)
457
James Kuszmaul59a5c612019-01-22 07:56:08 -0800458cc_test(
459 name = "c2d_test",
460 srcs = [
461 "c2d_test.cc",
462 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800463 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800464 visibility = ["//visibility:public"],
465 deps = [
466 ":c2d",
467 ":runge_kutta",
468 "//aos/testing:googletest",
469 ],
470)
471
Austin Schuh03785132018-02-19 18:29:06 -0800472cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100473 name = "c2d",
474 hdrs = [
475 "c2d.h",
476 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800477 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100478 visibility = ["//visibility:public"],
479 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700480 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700481 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100482 ],
483)
484
485cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800486 name = "dlqr",
487 hdrs = [
488 "dlqr.h",
489 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800490 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800491 visibility = ["//visibility:public"],
492 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700493 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800494 "@slycot_repo//:slicot",
495 ],
496)
Brian Silverman6470f442018-08-05 12:08:16 -0700497
498py_library(
499 name = "python_init",
500 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800501 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700502 visibility = ["//visibility:public"],
503 deps = ["//frc971:python_init"],
504)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800505
506cc_library(
507 name = "binomial",
508 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800509 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800510)
511
512cc_test(
513 name = "binomial_test",
514 srcs = [
515 "binomial_test.cc",
516 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800517 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800518 deps = [
519 ":binomial",
520 "//aos/testing:googletest",
521 ],
522)
Tyler Chatow12581562019-01-26 20:42:42 -0800523
524cc_library(
525 name = "capped_test_plant",
526 testonly = True,
527 srcs = [
528 "capped_test_plant.cc",
529 ],
530 hdrs = [
531 "capped_test_plant.h",
532 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800533 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800534 deps = [
535 ":state_feedback_loop",
536 "//aos/testing:googletest",
537 ],
538)
539
540cc_library(
541 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800542 hdrs = [
543 "static_zeroing_single_dof_profiled_subsystem.h",
544 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800545 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800546 deps = [
547 "//frc971/control_loops:profiled_subsystem",
548 ],
549)
550
551genrule(
552 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
553 outs = [
554 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
555 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800556 "static_zeroing_single_dof_profiled_subsystem_test_plant.json",
Tyler Chatow12581562019-01-26 20:42:42 -0800557 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
558 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800559 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.json",
Tyler Chatow12581562019-01-26 20:42:42 -0800560 ],
561 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800562 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800563 tools = [
564 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
565 ],
566)
567
568cc_library(
569 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
570 srcs = [
571 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
572 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
573 ],
574 hdrs = [
575 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
576 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
577 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800578 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800579 deps = [
580 ":state_feedback_loop",
581 ],
582)
583
James Kuszmaulf01da392023-12-14 11:22:14 -0800584static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700585 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700586 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700587 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700588 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700589 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800590 deps = [
591 ":control_loops_fbs",
592 ":profiled_subsystem_fbs",
593 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700594)
595
James Kuszmaulf01da392023-12-14 11:22:14 -0800596static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700597 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
598 srcs = [
599 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
600 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700601 target_compatible_with = ["@platforms//os:linux"],
602)
603
James Kuszmaulf01da392023-12-14 11:22:14 -0800604static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700605 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
606 srcs = [
607 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
608 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700609 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800610 deps = [
611 ":control_loops_fbs",
612 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700613)
614
James Kuszmaulf01da392023-12-14 11:22:14 -0800615static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700616 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
617 srcs = [
618 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
619 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700620 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800621 deps = [
622 ":control_loops_fbs",
623 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700624)
625
James Kuszmaulf01da392023-12-14 11:22:14 -0800626static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700627 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
628 srcs = [
629 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
630 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700631 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800632 deps = [
633 ":control_loops_fbs",
634 ":profiled_subsystem_fbs",
635 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700636)
637
James Kuszmaulf01da392023-12-14 11:22:14 -0800638static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700639 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
640 srcs = [
641 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
642 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800643 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800644 deps = [
645 ":control_loops_fbs",
646 ":profiled_subsystem_fbs",
647 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700648)
649
Tyler Chatow12581562019-01-26 20:42:42 -0800650cc_test(
651 name = "static_zeroing_single_dof_profiled_subsystem_test",
652 srcs = [
653 "static_zeroing_single_dof_profiled_subsystem_test.cc",
654 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700655 data = [
656 ":static_zeroing_single_dof_profiled_subsystem_test_config",
657 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800658 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800659 deps = [
660 ":capped_test_plant",
661 ":position_sensor_sim",
662 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700663 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
664 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800665 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700666 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
667 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
668 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
669 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800670 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700671 "//frc971/control_loops:control_loop_test",
James Kuszmaulec635d22023-08-12 18:39:24 -0700672 "//frc971/zeroing:absolute_and_absolute_encoder",
673 "//frc971/zeroing:absolute_encoder",
674 "//frc971/zeroing:pot_and_absolute_encoder",
Tyler Chatow12581562019-01-26 20:42:42 -0800675 ],
676)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700677
678aos_config(
679 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
680 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
681 flatbuffers = [
682 "//frc971/input:joystick_state_fbs",
683 "//frc971/input:robot_state_fbs",
684 "//aos/logging:log_message_fbs",
685 "//aos/events:event_loop_fbs",
686 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
687 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
688 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
689 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
690 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
691 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
692 ],
693 target_compatible_with = ["@platforms//os:linux"],
694)
James Kuszmauleeb98e92024-01-14 22:15:32 -0800695
696static_flatbuffer(
697 name = "state_feedback_loop_fbs",
698 srcs = ["state_feedback_loop.fbs"],
699 deps = ["//frc971/math:matrix_fbs"],
700)
701
702flatbuffer_ts_library(
703 name = "state_feedback_loop_ts_fbs",
704 srcs = ["state_feedback_loop.fbs"],
705 deps = ["//frc971/math:matrix_ts_fbs"],
706)
707
708cc_library(
709 name = "hybrid_state_feedback_loop_converters",
710 srcs = ["hybrid_state_feedback_loop_converters.h"],
711 deps = [
712 ":hybrid_state_feedback_loop",
713 ":state_feedback_loop_converters",
714 ":state_feedback_loop_fbs",
715 "//frc971/math:flatbuffers_matrix",
716 ],
717)
718
719cc_library(
720 name = "state_feedback_loop_converters",
721 srcs = ["state_feedback_loop_converters.h"],
722 deps = [
723 ":state_feedback_loop",
724 ":state_feedback_loop_fbs",
725 "//frc971/math:flatbuffers_matrix",
726 ],
727)