blob: a62b45fa9f152efba1db91113d9981844690ece7 [file] [log] [blame]
Austin Schuha9df9ad2021-06-16 14:49:39 -07001load("//aos:config.bzl", "aos_config")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
3load("@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
Alex Perrycb7da4b2019-08-28 19:35:56 -0700195flatbuffer_cc_library(
196 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
202cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800203 name = "position_sensor_sim_test",
204 srcs = [
205 "position_sensor_sim_test.cc",
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 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -0700211 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800212 "//aos/testing:googletest",
213 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400214)
215
216cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800217 name = "position_sensor_sim",
218 testonly = True,
219 srcs = [
220 "position_sensor_sim.cc",
221 ],
222 hdrs = [
223 "position_sensor_sim.h",
224 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700225 linkopts = [
226 "-lm",
227 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800228 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800229 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700230 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800231 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800232 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800233 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400234)
235
236cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800237 name = "gaussian_noise",
238 srcs = [
239 "gaussian_noise.cc",
240 ],
241 hdrs = [
242 "gaussian_noise.h",
243 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800244 linkopts = [
245 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800246 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800247 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700248)
249
250cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800251 name = "coerce_goal",
252 srcs = [
253 "coerce_goal.cc",
254 ],
255 hdrs = [
256 "coerce_goal.h",
257 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800258 linkopts = select({
259 "@platforms//os:linux": ["-lm"],
260 "//conditions:default": [],
261 }),
Austin Schuha647d602018-02-18 14:05:15 -0800262 deps = [
James Kuszmaul61750662021-06-21 21:32:33 -0700263 "//frc971/control_loops:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700264 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800265 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400266)
267
Lee Mracek65686142020-01-10 22:21:39 -0500268cc_test(
269 name = "coerce_goal_test",
270 srcs = [
271 "coerce_goal_test.cc",
272 ],
273 linkopts = [
274 "-lm",
275 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800276 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500277 deps = [
278 ":coerce_goal",
Lee Mracek65686142020-01-10 22:21:39 -0500279 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700280 "//frc971/control_loops:polytope",
Lee Mracek65686142020-01-10 22:21:39 -0500281 "@org_tuxfamily_eigen//:eigen",
282 ],
283)
284
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800285cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800286 name = "state_feedback_loop",
287 hdrs = [
288 "state_feedback_loop.h",
289 ],
290 deps = [
John Park33858a32018-09-28 23:05:48 -0700291 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700292 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800293 ] + select({
294 "@platforms//os:linux": ["//aos/logging"],
295 "//conditions:default": [],
296 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400297)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500298
299cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800300 name = "hybrid_state_feedback_loop",
301 hdrs = [
302 "hybrid_state_feedback_loop.h",
303 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800304 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800305 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100306 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800307 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700308 "//aos:macros",
John Park33858a32018-09-28 23:05:48 -0700309 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700310 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700311 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800312 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500313)
Austin Schuhacd335a2017-01-01 16:20:54 -0800314
315cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800316 name = "simple_capped_state_feedback_loop",
317 hdrs = [
318 "simple_capped_state_feedback_loop.h",
319 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800320 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800321 deps = [
322 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700323 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800324 ],
325)
326
327cc_library(
328 name = "runge_kutta",
329 hdrs = [
330 "runge_kutta.h",
331 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800332 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800333 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700334 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800335 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800336)
337
338cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800339 name = "runge_kutta_test",
340 srcs = [
341 "runge_kutta_test.cc",
342 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800343 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800344 deps = [
345 ":runge_kutta",
346 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700347 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800348 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800349)
Austin Schuh473a5652017-02-05 01:30:42 -0800350
Austin Schuh173a1592018-12-19 16:20:54 +1100351cc_library(
352 name = "fixed_quadrature",
353 hdrs = [
354 "fixed_quadrature.h",
355 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800356 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha935a082023-02-20 21:45:54 -0800357 deps = [
358 "@org_tuxfamily_eigen//:eigen",
359 ],
Austin Schuh173a1592018-12-19 16:20:54 +1100360)
361
362cc_test(
363 name = "fixed_quadrature_test",
364 srcs = [
365 "fixed_quadrature_test.cc",
366 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800367 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100368 deps = [
369 ":fixed_quadrature",
370 "//aos/testing:googletest",
371 ],
372)
373
James Kuszmauldac091f2022-03-22 09:35:06 -0700374flatbuffer_ts_library(
375 name = "profiled_subsystem_ts_fbs",
376 srcs = [
377 "profiled_subsystem.fbs",
378 ],
379 deps = [
380 ":control_loops_ts_fbs",
381 ],
382)
383
Alex Perrycb7da4b2019-08-28 19:35:56 -0700384flatbuffer_cc_library(
385 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800386 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700387 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800388 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700389 includes = [
390 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700391 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800392 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700393)
394
Austin Schuh473a5652017-02-05 01:30:42 -0800395cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800396 name = "profiled_subsystem",
397 srcs = [
398 "profiled_subsystem.cc",
399 ],
400 hdrs = [
401 "profiled_subsystem.h",
402 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800403 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800404 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700405 ":control_loops_fbs",
406 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800407 ":simple_capped_state_feedback_loop",
408 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700409 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700410 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800411 "//frc971/zeroing",
412 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800413)
Austin Schuha647d602018-02-18 14:05:15 -0800414
415cc_library(
416 name = "jacobian",
417 hdrs = [
418 "jacobian.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 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800423 ],
424)
425
426cc_test(
427 name = "jacobian_test",
428 srcs = [
429 "jacobian_test.cc",
430 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800431 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800432 deps = [
433 ":jacobian",
434 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700435 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800436 ],
437)
438
James Kuszmaul59a5c612019-01-22 07:56:08 -0800439cc_test(
440 name = "c2d_test",
441 srcs = [
442 "c2d_test.cc",
443 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800444 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800445 visibility = ["//visibility:public"],
446 deps = [
447 ":c2d",
448 ":runge_kutta",
449 "//aos/testing:googletest",
450 ],
451)
452
Austin Schuh03785132018-02-19 18:29:06 -0800453cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100454 name = "c2d",
455 hdrs = [
456 "c2d.h",
457 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800458 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100459 visibility = ["//visibility:public"],
460 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700461 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700462 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100463 ],
464)
465
466cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800467 name = "dlqr",
468 hdrs = [
469 "dlqr.h",
470 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800471 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800472 visibility = ["//visibility:public"],
473 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700474 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800475 "@slycot_repo//:slicot",
476 ],
477)
Brian Silverman6470f442018-08-05 12:08:16 -0700478
479py_library(
480 name = "python_init",
481 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800482 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700483 visibility = ["//visibility:public"],
484 deps = ["//frc971:python_init"],
485)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800486
487cc_library(
488 name = "binomial",
489 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800490 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800491)
492
493cc_test(
494 name = "binomial_test",
495 srcs = [
496 "binomial_test.cc",
497 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800498 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800499 deps = [
500 ":binomial",
501 "//aos/testing:googletest",
502 ],
503)
Tyler Chatow12581562019-01-26 20:42:42 -0800504
505cc_library(
506 name = "capped_test_plant",
507 testonly = True,
508 srcs = [
509 "capped_test_plant.cc",
510 ],
511 hdrs = [
512 "capped_test_plant.h",
513 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800514 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800515 deps = [
516 ":state_feedback_loop",
517 "//aos/testing:googletest",
518 ],
519)
520
521cc_library(
522 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800523 hdrs = [
524 "static_zeroing_single_dof_profiled_subsystem.h",
525 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800526 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800527 deps = [
528 "//frc971/control_loops:profiled_subsystem",
529 ],
530)
531
532genrule(
533 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
534 outs = [
535 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
536 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
537 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
538 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
539 ],
540 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800541 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800542 tools = [
543 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
544 ],
545)
546
547cc_library(
548 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
549 srcs = [
550 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
551 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
552 ],
553 hdrs = [
554 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
555 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
556 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800557 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800558 deps = [
559 ":state_feedback_loop",
560 ],
561)
562
Alex Perrycb7da4b2019-08-28 19:35:56 -0700563flatbuffer_cc_library(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700564 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700565 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700566 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700567 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700568 gen_reflections = 1,
569 includes = [
570 ":control_loops_fbs_includes",
571 ":profiled_subsystem_fbs_includes",
572 ],
573 target_compatible_with = ["@platforms//os:linux"],
574)
575
576flatbuffer_cc_library(
577 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
578 srcs = [
579 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
580 ],
581 gen_reflections = 1,
582 target_compatible_with = ["@platforms//os:linux"],
583)
584
585flatbuffer_cc_library(
586 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
587 srcs = [
588 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
589 ],
590 gen_reflections = 1,
591 includes = [
592 ":control_loops_fbs_includes",
593 ],
594 target_compatible_with = ["@platforms//os:linux"],
595)
596
597flatbuffer_cc_library(
598 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
599 srcs = [
600 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
601 ],
602 gen_reflections = 1,
603 includes = [
604 ":control_loops_fbs_includes",
605 ],
606 target_compatible_with = ["@platforms//os:linux"],
607)
608
609flatbuffer_cc_library(
610 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
611 srcs = [
612 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
613 ],
614 gen_reflections = 1,
615 includes = [
616 ":control_loops_fbs_includes",
617 ":profiled_subsystem_fbs_includes",
618 ],
619 target_compatible_with = ["@platforms//os:linux"],
620)
621
622flatbuffer_cc_library(
623 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
624 srcs = [
625 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
626 ],
627 gen_reflections = 1,
Alex Perrycb7da4b2019-08-28 19:35:56 -0700628 includes = [
629 ":control_loops_fbs_includes",
630 ":profiled_subsystem_fbs_includes",
631 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800632 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700633)
634
Tyler Chatow12581562019-01-26 20:42:42 -0800635cc_test(
636 name = "static_zeroing_single_dof_profiled_subsystem_test",
637 srcs = [
638 "static_zeroing_single_dof_profiled_subsystem_test.cc",
639 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700640 data = [
641 ":static_zeroing_single_dof_profiled_subsystem_test_config",
642 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800643 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800644 deps = [
645 ":capped_test_plant",
646 ":position_sensor_sim",
647 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700648 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
649 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800650 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700651 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
652 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
653 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
654 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800655 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700656 "//frc971/control_loops:control_loop_test",
Tyler Chatow12581562019-01-26 20:42:42 -0800657 ],
658)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700659
660aos_config(
661 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
662 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
663 flatbuffers = [
664 "//frc971/input:joystick_state_fbs",
665 "//frc971/input:robot_state_fbs",
666 "//aos/logging:log_message_fbs",
667 "//aos/events:event_loop_fbs",
668 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
669 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
670 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
671 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
672 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
673 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
674 ],
675 target_compatible_with = ["@platforms//os:linux"],
676)