blob: 3cdb6ab5eff116cc14ad7bbc7576a09d32511aa1 [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
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700202flatbuffer_cc_library(
203 name = "can_falcon_fbs",
204 srcs = [
205 "can_falcon.fbs",
206 ],
207)
208
Brian Silverman100534c2015-09-07 15:51:23 -0400209cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800210 name = "position_sensor_sim_test",
211 srcs = [
212 "position_sensor_sim_test.cc",
213 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800214 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800215 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700216 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800217 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -0700218 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800219 "//aos/testing:googletest",
220 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400221)
222
223cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800224 name = "position_sensor_sim",
225 testonly = True,
226 srcs = [
227 "position_sensor_sim.cc",
228 ],
229 hdrs = [
230 "position_sensor_sim.h",
231 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700232 linkopts = [
233 "-lm",
234 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800235 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800236 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700237 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800238 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800239 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800240 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400241)
242
243cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800244 name = "gaussian_noise",
245 srcs = [
246 "gaussian_noise.cc",
247 ],
248 hdrs = [
249 "gaussian_noise.h",
250 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800251 linkopts = [
252 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800253 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800254 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700255)
256
257cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800258 name = "coerce_goal",
259 srcs = [
260 "coerce_goal.cc",
261 ],
262 hdrs = [
263 "coerce_goal.h",
264 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800265 linkopts = select({
266 "@platforms//os:linux": ["-lm"],
267 "//conditions:default": [],
268 }),
Austin Schuha647d602018-02-18 14:05:15 -0800269 deps = [
James Kuszmaul61750662021-06-21 21:32:33 -0700270 "//frc971/control_loops:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700271 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800272 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400273)
274
Lee Mracek65686142020-01-10 22:21:39 -0500275cc_test(
276 name = "coerce_goal_test",
277 srcs = [
278 "coerce_goal_test.cc",
279 ],
280 linkopts = [
281 "-lm",
282 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800283 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500284 deps = [
285 ":coerce_goal",
Lee Mracek65686142020-01-10 22:21:39 -0500286 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700287 "//frc971/control_loops:polytope",
Lee Mracek65686142020-01-10 22:21:39 -0500288 "@org_tuxfamily_eigen//:eigen",
289 ],
290)
291
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800292cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800293 name = "state_feedback_loop",
294 hdrs = [
295 "state_feedback_loop.h",
296 ],
297 deps = [
John Park33858a32018-09-28 23:05:48 -0700298 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700299 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800300 ] + select({
301 "@platforms//os:linux": ["//aos/logging"],
302 "//conditions:default": [],
303 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400304)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500305
306cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800307 name = "hybrid_state_feedback_loop",
308 hdrs = [
309 "hybrid_state_feedback_loop.h",
310 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800311 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800312 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100313 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800314 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700315 "//aos:macros",
John Park33858a32018-09-28 23:05:48 -0700316 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700317 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700318 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800319 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500320)
Austin Schuhacd335a2017-01-01 16:20:54 -0800321
322cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800323 name = "simple_capped_state_feedback_loop",
324 hdrs = [
325 "simple_capped_state_feedback_loop.h",
326 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800327 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800328 deps = [
329 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700330 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800331 ],
332)
333
334cc_library(
335 name = "runge_kutta",
336 hdrs = [
337 "runge_kutta.h",
338 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800339 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800340 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700341 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800342 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800343)
344
345cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800346 name = "runge_kutta_test",
347 srcs = [
348 "runge_kutta_test.cc",
349 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800350 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800351 deps = [
352 ":runge_kutta",
353 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700354 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800355 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800356)
Austin Schuh473a5652017-02-05 01:30:42 -0800357
Austin Schuh173a1592018-12-19 16:20:54 +1100358cc_library(
359 name = "fixed_quadrature",
360 hdrs = [
361 "fixed_quadrature.h",
362 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800363 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha935a082023-02-20 21:45:54 -0800364 deps = [
365 "@org_tuxfamily_eigen//:eigen",
366 ],
Austin Schuh173a1592018-12-19 16:20:54 +1100367)
368
369cc_test(
370 name = "fixed_quadrature_test",
371 srcs = [
372 "fixed_quadrature_test.cc",
373 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800374 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100375 deps = [
376 ":fixed_quadrature",
377 "//aos/testing:googletest",
378 ],
379)
380
James Kuszmauldac091f2022-03-22 09:35:06 -0700381flatbuffer_ts_library(
382 name = "profiled_subsystem_ts_fbs",
383 srcs = [
384 "profiled_subsystem.fbs",
385 ],
386 deps = [
387 ":control_loops_ts_fbs",
388 ],
389)
390
Alex Perrycb7da4b2019-08-28 19:35:56 -0700391flatbuffer_cc_library(
392 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800393 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700394 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800395 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700396 includes = [
397 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700398 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800399 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700400)
401
Austin Schuh473a5652017-02-05 01:30:42 -0800402cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800403 name = "profiled_subsystem",
404 srcs = [
405 "profiled_subsystem.cc",
406 ],
407 hdrs = [
408 "profiled_subsystem.h",
409 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800410 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800411 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700412 ":control_loops_fbs",
413 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800414 ":simple_capped_state_feedback_loop",
415 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700416 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700417 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800418 "//frc971/zeroing",
419 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800420)
Austin Schuha647d602018-02-18 14:05:15 -0800421
422cc_library(
423 name = "jacobian",
424 hdrs = [
425 "jacobian.h",
426 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800427 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800428 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700429 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800430 ],
431)
432
433cc_test(
434 name = "jacobian_test",
435 srcs = [
436 "jacobian_test.cc",
437 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800438 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800439 deps = [
440 ":jacobian",
441 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700442 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800443 ],
444)
445
James Kuszmaul59a5c612019-01-22 07:56:08 -0800446cc_test(
447 name = "c2d_test",
448 srcs = [
449 "c2d_test.cc",
450 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800451 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800452 visibility = ["//visibility:public"],
453 deps = [
454 ":c2d",
455 ":runge_kutta",
456 "//aos/testing:googletest",
457 ],
458)
459
Austin Schuh03785132018-02-19 18:29:06 -0800460cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100461 name = "c2d",
462 hdrs = [
463 "c2d.h",
464 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800465 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100466 visibility = ["//visibility:public"],
467 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700468 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700469 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100470 ],
471)
472
473cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800474 name = "dlqr",
475 hdrs = [
476 "dlqr.h",
477 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800478 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800479 visibility = ["//visibility:public"],
480 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700481 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800482 "@slycot_repo//:slicot",
483 ],
484)
Brian Silverman6470f442018-08-05 12:08:16 -0700485
486py_library(
487 name = "python_init",
488 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800489 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700490 visibility = ["//visibility:public"],
491 deps = ["//frc971:python_init"],
492)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800493
494cc_library(
495 name = "binomial",
496 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800497 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800498)
499
500cc_test(
501 name = "binomial_test",
502 srcs = [
503 "binomial_test.cc",
504 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800505 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800506 deps = [
507 ":binomial",
508 "//aos/testing:googletest",
509 ],
510)
Tyler Chatow12581562019-01-26 20:42:42 -0800511
512cc_library(
513 name = "capped_test_plant",
514 testonly = True,
515 srcs = [
516 "capped_test_plant.cc",
517 ],
518 hdrs = [
519 "capped_test_plant.h",
520 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800521 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800522 deps = [
523 ":state_feedback_loop",
524 "//aos/testing:googletest",
525 ],
526)
527
528cc_library(
529 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800530 hdrs = [
531 "static_zeroing_single_dof_profiled_subsystem.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 "//frc971/control_loops:profiled_subsystem",
536 ],
537)
538
539genrule(
540 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
541 outs = [
542 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
543 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
544 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
545 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
546 ],
547 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800548 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800549 tools = [
550 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
551 ],
552)
553
554cc_library(
555 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
556 srcs = [
557 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
558 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
559 ],
560 hdrs = [
561 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
562 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
563 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800564 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800565 deps = [
566 ":state_feedback_loop",
567 ],
568)
569
Alex Perrycb7da4b2019-08-28 19:35:56 -0700570flatbuffer_cc_library(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700571 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700572 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700573 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700574 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700575 gen_reflections = 1,
576 includes = [
577 ":control_loops_fbs_includes",
578 ":profiled_subsystem_fbs_includes",
579 ],
580 target_compatible_with = ["@platforms//os:linux"],
581)
582
583flatbuffer_cc_library(
584 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
585 srcs = [
586 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
587 ],
588 gen_reflections = 1,
589 target_compatible_with = ["@platforms//os:linux"],
590)
591
592flatbuffer_cc_library(
593 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
594 srcs = [
595 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
596 ],
597 gen_reflections = 1,
598 includes = [
599 ":control_loops_fbs_includes",
600 ],
601 target_compatible_with = ["@platforms//os:linux"],
602)
603
604flatbuffer_cc_library(
605 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
606 srcs = [
607 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
608 ],
609 gen_reflections = 1,
610 includes = [
611 ":control_loops_fbs_includes",
612 ],
613 target_compatible_with = ["@platforms//os:linux"],
614)
615
616flatbuffer_cc_library(
617 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
618 srcs = [
619 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
620 ],
621 gen_reflections = 1,
622 includes = [
623 ":control_loops_fbs_includes",
624 ":profiled_subsystem_fbs_includes",
625 ],
626 target_compatible_with = ["@platforms//os:linux"],
627)
628
629flatbuffer_cc_library(
630 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
631 srcs = [
632 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
633 ],
634 gen_reflections = 1,
Alex Perrycb7da4b2019-08-28 19:35:56 -0700635 includes = [
636 ":control_loops_fbs_includes",
637 ":profiled_subsystem_fbs_includes",
638 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800639 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700640)
641
Tyler Chatow12581562019-01-26 20:42:42 -0800642cc_test(
643 name = "static_zeroing_single_dof_profiled_subsystem_test",
644 srcs = [
645 "static_zeroing_single_dof_profiled_subsystem_test.cc",
646 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700647 data = [
648 ":static_zeroing_single_dof_profiled_subsystem_test_config",
649 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800650 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800651 deps = [
652 ":capped_test_plant",
653 ":position_sensor_sim",
654 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700655 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
656 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800657 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700658 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
659 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
660 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
661 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800662 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700663 "//frc971/control_loops:control_loop_test",
Tyler Chatow12581562019-01-26 20:42:42 -0800664 ],
665)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700666
667aos_config(
668 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
669 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
670 flatbuffers = [
671 "//frc971/input:joystick_state_fbs",
672 "//frc971/input:robot_state_fbs",
673 "//aos/logging:log_message_fbs",
674 "//aos/events:event_loop_fbs",
675 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
676 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
677 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
678 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
679 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
680 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
681 ],
682 target_compatible_with = ["@platforms//os:linux"],
683)