blob: 9986fefa11ce65032bc199ab5cde6cb59b8ae470 [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(
Niko Sohmers4a5bef82023-12-30 15:16:16 -0800179 name = "encoder_fault_detector",
180 srcs = ["encoder_fault_detector.cc"],
181 hdrs = ["encoder_fault_detector.h"],
182 target_compatible_with = ["@platforms//os:linux"],
183 deps = [
184 ":encoder_fault_status_fbs",
185 "//aos/containers:sized_array",
186 "//aos/time",
187 "//frc971/control_loops:can_talonfx_fbs",
188 ],
189)
190
191cc_test(
192 name = "encoder_fault_detector_test",
193 srcs = ["encoder_fault_detector_test.cc"],
194 target_compatible_with = ["@platforms//os:linux"],
195 deps = [
196 ":encoder_fault_detector",
197 "//aos:json_to_flatbuffer",
198 "//aos/testing:googletest",
199 ],
200)
201
202cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800203 name = "hall_effect_tracker",
204 hdrs = [
205 "hall_effect_tracker.h",
206 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800207 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800208 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700209 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800210 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400211)
212
James Kuszmauldac091f2022-03-22 09:35:06 -0700213flatbuffer_ts_library(
214 name = "control_loops_ts_fbs",
215 srcs = [
216 "control_loops.fbs",
217 ],
218)
219
James Kuszmaulf01da392023-12-14 11:22:14 -0800220static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700221 name = "control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800222 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700223 "control_loops.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800224 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400225)
226
Niko Sohmers76f47562023-12-20 20:59:06 -0800227flatbuffer_ts_library(
Niko Sohmers4a5bef82023-12-30 15:16:16 -0800228 name = "encoder_fault_status_ts_fbs",
229 srcs = [
230 "encoder_fault_status.fbs",
231 ],
232)
233
234static_flatbuffer(
235 name = "encoder_fault_status_fbs",
236 srcs = [
237 "encoder_fault_status.fbs",
238 ],
239)
240
241flatbuffer_ts_library(
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800242 name = "can_talonfx_ts_fbs",
Niko Sohmers76f47562023-12-20 20:59:06 -0800243 srcs = [
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800244 "can_talonfx.fbs",
Niko Sohmers76f47562023-12-20 20:59:06 -0800245 ],
246)
247
James Kuszmaulf01da392023-12-14 11:22:14 -0800248static_flatbuffer(
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800249 name = "can_talonfx_fbs",
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700250 srcs = [
Maxwell Henderson10ed5c32024-01-09 12:40:54 -0800251 "can_talonfx.fbs",
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700252 ],
253)
254
Brian Silverman100534c2015-09-07 15:51:23 -0400255cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800256 name = "position_sensor_sim_test",
257 srcs = [
258 "position_sensor_sim_test.cc",
259 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800260 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800261 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700262 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800263 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -0700264 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800265 "//aos/testing:googletest",
266 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400267)
268
269cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800270 name = "position_sensor_sim",
271 testonly = True,
272 srcs = [
273 "position_sensor_sim.cc",
274 ],
275 hdrs = [
276 "position_sensor_sim.h",
277 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700278 linkopts = [
279 "-lm",
280 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800281 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800282 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700283 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800284 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800285 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800286 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400287)
288
289cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800290 name = "gaussian_noise",
291 srcs = [
292 "gaussian_noise.cc",
293 ],
294 hdrs = [
295 "gaussian_noise.h",
296 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800297 linkopts = [
298 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800299 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800300 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700301)
302
303cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800304 name = "coerce_goal",
305 srcs = [
306 "coerce_goal.cc",
307 ],
308 hdrs = [
309 "coerce_goal.h",
310 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800311 linkopts = select({
312 "@platforms//os:linux": ["-lm"],
313 "//conditions:default": [],
314 }),
Austin Schuha647d602018-02-18 14:05:15 -0800315 deps = [
James Kuszmaul61750662021-06-21 21:32:33 -0700316 "//frc971/control_loops:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700317 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800318 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400319)
320
Lee Mracek65686142020-01-10 22:21:39 -0500321cc_test(
322 name = "coerce_goal_test",
323 srcs = [
324 "coerce_goal_test.cc",
325 ],
326 linkopts = [
327 "-lm",
328 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800329 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500330 deps = [
331 ":coerce_goal",
Lee Mracek65686142020-01-10 22:21:39 -0500332 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700333 "//frc971/control_loops:polytope",
Lee Mracek65686142020-01-10 22:21:39 -0500334 "@org_tuxfamily_eigen//:eigen",
335 ],
336)
337
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800338cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800339 name = "state_feedback_loop",
340 hdrs = [
341 "state_feedback_loop.h",
342 ],
343 deps = [
John Park33858a32018-09-28 23:05:48 -0700344 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700345 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800346 ] + select({
347 "@platforms//os:linux": ["//aos/logging"],
348 "//conditions:default": [],
349 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400350)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500351
352cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800353 name = "hybrid_state_feedback_loop",
354 hdrs = [
355 "hybrid_state_feedback_loop.h",
356 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800357 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800358 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100359 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800360 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700361 "//aos:macros",
John Park33858a32018-09-28 23:05:48 -0700362 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700363 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700364 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800365 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500366)
Austin Schuhacd335a2017-01-01 16:20:54 -0800367
368cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800369 name = "simple_capped_state_feedback_loop",
370 hdrs = [
371 "simple_capped_state_feedback_loop.h",
372 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800373 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800374 deps = [
375 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700376 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800377 ],
378)
379
380cc_library(
381 name = "runge_kutta",
382 hdrs = [
383 "runge_kutta.h",
384 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800385 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800386 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700387 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800388 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800389)
390
391cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800392 name = "runge_kutta_test",
393 srcs = [
394 "runge_kutta_test.cc",
395 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800396 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800397 deps = [
398 ":runge_kutta",
399 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700400 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800401 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800402)
Austin Schuh473a5652017-02-05 01:30:42 -0800403
Austin Schuh173a1592018-12-19 16:20:54 +1100404cc_library(
405 name = "fixed_quadrature",
406 hdrs = [
407 "fixed_quadrature.h",
408 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800409 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha935a082023-02-20 21:45:54 -0800410 deps = [
411 "@org_tuxfamily_eigen//:eigen",
412 ],
Austin Schuh173a1592018-12-19 16:20:54 +1100413)
414
415cc_test(
416 name = "fixed_quadrature_test",
417 srcs = [
418 "fixed_quadrature_test.cc",
419 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800420 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100421 deps = [
422 ":fixed_quadrature",
423 "//aos/testing:googletest",
424 ],
425)
426
James Kuszmauldac091f2022-03-22 09:35:06 -0700427flatbuffer_ts_library(
428 name = "profiled_subsystem_ts_fbs",
429 srcs = [
430 "profiled_subsystem.fbs",
431 ],
432 deps = [
433 ":control_loops_ts_fbs",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800434 ":state_feedback_loop_ts_fbs",
James Kuszmauldac091f2022-03-22 09:35:06 -0700435 ],
436)
437
James Kuszmaulf01da392023-12-14 11:22:14 -0800438static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700439 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800440 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700441 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800442 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800443 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800444 deps = [
445 ":control_loops_fbs",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800446 ":state_feedback_loop_fbs",
James Kuszmaulf01da392023-12-14 11:22:14 -0800447 ],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700448)
449
Austin Schuh473a5652017-02-05 01:30:42 -0800450cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800451 name = "profiled_subsystem",
452 srcs = [
453 "profiled_subsystem.cc",
454 ],
455 hdrs = [
456 "profiled_subsystem.h",
457 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800458 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800459 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700460 ":control_loops_fbs",
461 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800462 ":simple_capped_state_feedback_loop",
463 ":state_feedback_loop",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800464 ":state_feedback_loop_converters",
465 "//aos:flatbuffer_merge",
John Park33858a32018-09-28 23:05:48 -0700466 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700467 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800468 "//frc971/zeroing",
James Kuszmaulec635d22023-08-12 18:39:24 -0700469 "//frc971/zeroing:pot_and_index",
Austin Schuha647d602018-02-18 14:05:15 -0800470 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800471)
Austin Schuha647d602018-02-18 14:05:15 -0800472
473cc_library(
474 name = "jacobian",
475 hdrs = [
476 "jacobian.h",
477 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800478 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800479 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700480 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800481 ],
482)
483
484cc_test(
485 name = "jacobian_test",
486 srcs = [
487 "jacobian_test.cc",
488 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800489 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800490 deps = [
491 ":jacobian",
492 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700493 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800494 ],
495)
496
James Kuszmaul59a5c612019-01-22 07:56:08 -0800497cc_test(
498 name = "c2d_test",
499 srcs = [
500 "c2d_test.cc",
501 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800502 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800503 visibility = ["//visibility:public"],
504 deps = [
505 ":c2d",
506 ":runge_kutta",
507 "//aos/testing:googletest",
508 ],
509)
510
Austin Schuh03785132018-02-19 18:29:06 -0800511cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100512 name = "c2d",
513 hdrs = [
514 "c2d.h",
515 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800516 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100517 visibility = ["//visibility:public"],
518 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700519 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700520 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100521 ],
522)
523
524cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800525 name = "dlqr",
526 hdrs = [
527 "dlqr.h",
528 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800529 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800530 visibility = ["//visibility:public"],
531 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700532 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800533 "@slycot_repo//:slicot",
534 ],
535)
Brian Silverman6470f442018-08-05 12:08:16 -0700536
537py_library(
538 name = "python_init",
539 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800540 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700541 visibility = ["//visibility:public"],
542 deps = ["//frc971:python_init"],
543)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800544
545cc_library(
546 name = "binomial",
547 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800548 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800549)
550
551cc_test(
552 name = "binomial_test",
553 srcs = [
554 "binomial_test.cc",
555 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800556 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800557 deps = [
558 ":binomial",
559 "//aos/testing:googletest",
560 ],
561)
Tyler Chatow12581562019-01-26 20:42:42 -0800562
563cc_library(
564 name = "capped_test_plant",
565 testonly = True,
566 srcs = [
567 "capped_test_plant.cc",
568 ],
569 hdrs = [
570 "capped_test_plant.h",
571 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800572 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800573 deps = [
574 ":state_feedback_loop",
575 "//aos/testing:googletest",
576 ],
577)
578
579cc_library(
580 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800581 hdrs = [
582 "static_zeroing_single_dof_profiled_subsystem.h",
583 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800584 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800585 deps = [
586 "//frc971/control_loops:profiled_subsystem",
587 ],
588)
589
590genrule(
591 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
592 outs = [
593 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
594 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800595 "static_zeroing_single_dof_profiled_subsystem_test_plant.json",
Tyler Chatow12581562019-01-26 20:42:42 -0800596 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
597 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
James Kuszmauleeb98e92024-01-14 22:15:32 -0800598 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.json",
Tyler Chatow12581562019-01-26 20:42:42 -0800599 ],
600 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800601 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800602 tools = [
603 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
604 ],
605)
606
607cc_library(
608 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
609 srcs = [
610 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
611 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
612 ],
613 hdrs = [
614 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
615 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
616 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800617 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800618 deps = [
619 ":state_feedback_loop",
620 ],
621)
622
James Kuszmaulf01da392023-12-14 11:22:14 -0800623static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700624 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700625 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700626 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700627 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700628 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800629 deps = [
630 ":control_loops_fbs",
631 ":profiled_subsystem_fbs",
632 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700633)
634
James Kuszmaulf01da392023-12-14 11:22:14 -0800635static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700636 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
637 srcs = [
638 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
639 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700640 target_compatible_with = ["@platforms//os:linux"],
641)
642
James Kuszmaulf01da392023-12-14 11:22:14 -0800643static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700644 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
645 srcs = [
646 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
647 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700648 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800649 deps = [
650 ":control_loops_fbs",
651 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700652)
653
James Kuszmaulf01da392023-12-14 11:22:14 -0800654static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700655 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
656 srcs = [
657 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
658 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700659 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800660 deps = [
661 ":control_loops_fbs",
662 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700663)
664
James Kuszmaulf01da392023-12-14 11:22:14 -0800665static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700666 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
667 srcs = [
668 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
669 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700670 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800671 deps = [
672 ":control_loops_fbs",
673 ":profiled_subsystem_fbs",
674 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700675)
676
James Kuszmaulf01da392023-12-14 11:22:14 -0800677static_flatbuffer(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700678 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
679 srcs = [
680 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
681 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800682 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800683 deps = [
684 ":control_loops_fbs",
685 ":profiled_subsystem_fbs",
686 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700687)
688
Tyler Chatow12581562019-01-26 20:42:42 -0800689cc_test(
690 name = "static_zeroing_single_dof_profiled_subsystem_test",
691 srcs = [
692 "static_zeroing_single_dof_profiled_subsystem_test.cc",
693 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700694 data = [
695 ":static_zeroing_single_dof_profiled_subsystem_test_config",
696 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800697 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800698 deps = [
699 ":capped_test_plant",
700 ":position_sensor_sim",
701 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700702 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
703 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800704 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700705 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
706 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
707 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
708 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800709 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700710 "//frc971/control_loops:control_loop_test",
James Kuszmaulec635d22023-08-12 18:39:24 -0700711 "//frc971/zeroing:absolute_and_absolute_encoder",
712 "//frc971/zeroing:absolute_encoder",
713 "//frc971/zeroing:pot_and_absolute_encoder",
Tyler Chatow12581562019-01-26 20:42:42 -0800714 ],
715)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700716
717aos_config(
718 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
719 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
720 flatbuffers = [
721 "//frc971/input:joystick_state_fbs",
722 "//frc971/input:robot_state_fbs",
723 "//aos/logging:log_message_fbs",
724 "//aos/events:event_loop_fbs",
725 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
726 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
727 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
728 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
729 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
730 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
731 ],
732 target_compatible_with = ["@platforms//os:linux"],
733)
James Kuszmauleeb98e92024-01-14 22:15:32 -0800734
735static_flatbuffer(
736 name = "state_feedback_loop_fbs",
737 srcs = ["state_feedback_loop.fbs"],
738 deps = ["//frc971/math:matrix_fbs"],
739)
740
741flatbuffer_ts_library(
742 name = "state_feedback_loop_ts_fbs",
743 srcs = ["state_feedback_loop.fbs"],
744 deps = ["//frc971/math:matrix_ts_fbs"],
745)
746
747cc_library(
748 name = "hybrid_state_feedback_loop_converters",
749 srcs = ["hybrid_state_feedback_loop_converters.h"],
750 deps = [
751 ":hybrid_state_feedback_loop",
752 ":state_feedback_loop_converters",
753 ":state_feedback_loop_fbs",
754 "//frc971/math:flatbuffers_matrix",
755 ],
756)
757
758cc_library(
759 name = "state_feedback_loop_converters",
760 srcs = ["state_feedback_loop_converters.h"],
761 deps = [
762 ":state_feedback_loop",
763 ":state_feedback_loop_fbs",
764 "//frc971/math:flatbuffers_matrix",
765 ],
766)