blob: 31b245b51081ddd6a66b6952ff38ecdd69754c1b [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",
James Kuszmaulec635d22023-08-12 18:39:24 -0700419 "//frc971/zeroing:pot_and_index",
Austin Schuha647d602018-02-18 14:05:15 -0800420 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800421)
Austin Schuha647d602018-02-18 14:05:15 -0800422
423cc_library(
424 name = "jacobian",
425 hdrs = [
426 "jacobian.h",
427 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800428 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800429 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700430 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800431 ],
432)
433
434cc_test(
435 name = "jacobian_test",
436 srcs = [
437 "jacobian_test.cc",
438 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800439 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800440 deps = [
441 ":jacobian",
442 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700443 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800444 ],
445)
446
James Kuszmaul59a5c612019-01-22 07:56:08 -0800447cc_test(
448 name = "c2d_test",
449 srcs = [
450 "c2d_test.cc",
451 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800452 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800453 visibility = ["//visibility:public"],
454 deps = [
455 ":c2d",
456 ":runge_kutta",
457 "//aos/testing:googletest",
458 ],
459)
460
Austin Schuh03785132018-02-19 18:29:06 -0800461cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100462 name = "c2d",
463 hdrs = [
464 "c2d.h",
465 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800466 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100467 visibility = ["//visibility:public"],
468 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700469 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700470 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100471 ],
472)
473
474cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800475 name = "dlqr",
476 hdrs = [
477 "dlqr.h",
478 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800479 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800480 visibility = ["//visibility:public"],
481 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700482 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800483 "@slycot_repo//:slicot",
484 ],
485)
Brian Silverman6470f442018-08-05 12:08:16 -0700486
487py_library(
488 name = "python_init",
489 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800490 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700491 visibility = ["//visibility:public"],
492 deps = ["//frc971:python_init"],
493)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800494
495cc_library(
496 name = "binomial",
497 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800498 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800499)
500
501cc_test(
502 name = "binomial_test",
503 srcs = [
504 "binomial_test.cc",
505 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800506 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800507 deps = [
508 ":binomial",
509 "//aos/testing:googletest",
510 ],
511)
Tyler Chatow12581562019-01-26 20:42:42 -0800512
513cc_library(
514 name = "capped_test_plant",
515 testonly = True,
516 srcs = [
517 "capped_test_plant.cc",
518 ],
519 hdrs = [
520 "capped_test_plant.h",
521 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800522 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800523 deps = [
524 ":state_feedback_loop",
525 "//aos/testing:googletest",
526 ],
527)
528
529cc_library(
530 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800531 hdrs = [
532 "static_zeroing_single_dof_profiled_subsystem.h",
533 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800534 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800535 deps = [
536 "//frc971/control_loops:profiled_subsystem",
537 ],
538)
539
540genrule(
541 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
542 outs = [
543 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
544 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
545 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
546 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
547 ],
548 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800549 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800550 tools = [
551 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
552 ],
553)
554
555cc_library(
556 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
557 srcs = [
558 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
559 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
560 ],
561 hdrs = [
562 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
563 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
564 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800565 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800566 deps = [
567 ":state_feedback_loop",
568 ],
569)
570
Alex Perrycb7da4b2019-08-28 19:35:56 -0700571flatbuffer_cc_library(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700572 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700573 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700574 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700575 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700576 gen_reflections = 1,
577 includes = [
578 ":control_loops_fbs_includes",
579 ":profiled_subsystem_fbs_includes",
580 ],
581 target_compatible_with = ["@platforms//os:linux"],
582)
583
584flatbuffer_cc_library(
585 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
586 srcs = [
587 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
588 ],
589 gen_reflections = 1,
590 target_compatible_with = ["@platforms//os:linux"],
591)
592
593flatbuffer_cc_library(
594 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
595 srcs = [
596 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
597 ],
598 gen_reflections = 1,
599 includes = [
600 ":control_loops_fbs_includes",
601 ],
602 target_compatible_with = ["@platforms//os:linux"],
603)
604
605flatbuffer_cc_library(
606 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
607 srcs = [
608 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
609 ],
610 gen_reflections = 1,
611 includes = [
612 ":control_loops_fbs_includes",
613 ],
614 target_compatible_with = ["@platforms//os:linux"],
615)
616
617flatbuffer_cc_library(
618 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
619 srcs = [
620 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
621 ],
622 gen_reflections = 1,
623 includes = [
624 ":control_loops_fbs_includes",
625 ":profiled_subsystem_fbs_includes",
626 ],
627 target_compatible_with = ["@platforms//os:linux"],
628)
629
630flatbuffer_cc_library(
631 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
632 srcs = [
633 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
634 ],
635 gen_reflections = 1,
Alex Perrycb7da4b2019-08-28 19:35:56 -0700636 includes = [
637 ":control_loops_fbs_includes",
638 ":profiled_subsystem_fbs_includes",
639 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800640 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700641)
642
Tyler Chatow12581562019-01-26 20:42:42 -0800643cc_test(
644 name = "static_zeroing_single_dof_profiled_subsystem_test",
645 srcs = [
646 "static_zeroing_single_dof_profiled_subsystem_test.cc",
647 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700648 data = [
649 ":static_zeroing_single_dof_profiled_subsystem_test_config",
650 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800651 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800652 deps = [
653 ":capped_test_plant",
654 ":position_sensor_sim",
655 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700656 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
657 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800658 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700659 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
660 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
661 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
662 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800663 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700664 "//frc971/control_loops:control_loop_test",
James Kuszmaulec635d22023-08-12 18:39:24 -0700665 "//frc971/zeroing:absolute_and_absolute_encoder",
666 "//frc971/zeroing:absolute_encoder",
667 "//frc971/zeroing:pot_and_absolute_encoder",
Tyler Chatow12581562019-01-26 20:42:42 -0800668 ],
669)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700670
671aos_config(
672 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
673 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
674 flatbuffers = [
675 "//frc971/input:joystick_state_fbs",
676 "//frc971/input:robot_state_fbs",
677 "//aos/logging:log_message_fbs",
678 "//aos/events:event_loop_fbs",
679 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
680 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
681 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
682 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
683 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
684 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
685 ],
686 target_compatible_with = ["@platforms//os:linux"],
687)