blob: ee53c4acf8efa76d547fb85169b3eb0e9ab4365c [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 Schuh173a1592018-12-19 16:20:54 +1100357)
358
359cc_test(
360 name = "fixed_quadrature_test",
361 srcs = [
362 "fixed_quadrature_test.cc",
363 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800364 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100365 deps = [
366 ":fixed_quadrature",
367 "//aos/testing:googletest",
368 ],
369)
370
James Kuszmauldac091f2022-03-22 09:35:06 -0700371flatbuffer_ts_library(
372 name = "profiled_subsystem_ts_fbs",
373 srcs = [
374 "profiled_subsystem.fbs",
375 ],
376 deps = [
377 ":control_loops_ts_fbs",
378 ],
379)
380
Alex Perrycb7da4b2019-08-28 19:35:56 -0700381flatbuffer_cc_library(
382 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800383 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700384 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800385 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700386 includes = [
387 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700388 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800389 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700390)
391
Austin Schuh473a5652017-02-05 01:30:42 -0800392cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800393 name = "profiled_subsystem",
394 srcs = [
395 "profiled_subsystem.cc",
396 ],
397 hdrs = [
398 "profiled_subsystem.h",
399 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800400 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800401 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700402 ":control_loops_fbs",
403 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800404 ":simple_capped_state_feedback_loop",
405 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700406 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700407 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800408 "//frc971/zeroing",
409 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800410)
Austin Schuha647d602018-02-18 14:05:15 -0800411
412cc_library(
413 name = "jacobian",
414 hdrs = [
415 "jacobian.h",
416 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800418 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700419 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800420 ],
421)
422
423cc_test(
424 name = "jacobian_test",
425 srcs = [
426 "jacobian_test.cc",
427 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800428 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800429 deps = [
430 ":jacobian",
431 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700432 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800433 ],
434)
435
James Kuszmaul59a5c612019-01-22 07:56:08 -0800436cc_test(
437 name = "c2d_test",
438 srcs = [
439 "c2d_test.cc",
440 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800441 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800442 visibility = ["//visibility:public"],
443 deps = [
444 ":c2d",
445 ":runge_kutta",
446 "//aos/testing:googletest",
447 ],
448)
449
Austin Schuh03785132018-02-19 18:29:06 -0800450cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100451 name = "c2d",
452 hdrs = [
453 "c2d.h",
454 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800455 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100456 visibility = ["//visibility:public"],
457 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700458 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700459 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100460 ],
461)
462
463cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800464 name = "dlqr",
465 hdrs = [
466 "dlqr.h",
467 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800468 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800469 visibility = ["//visibility:public"],
470 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700471 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800472 "@slycot_repo//:slicot",
473 ],
474)
Brian Silverman6470f442018-08-05 12:08:16 -0700475
476py_library(
477 name = "python_init",
478 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800479 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700480 visibility = ["//visibility:public"],
481 deps = ["//frc971:python_init"],
482)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800483
484cc_library(
485 name = "binomial",
486 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800487 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800488)
489
490cc_test(
491 name = "binomial_test",
492 srcs = [
493 "binomial_test.cc",
494 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800495 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800496 deps = [
497 ":binomial",
498 "//aos/testing:googletest",
499 ],
500)
Tyler Chatow12581562019-01-26 20:42:42 -0800501
502cc_library(
503 name = "capped_test_plant",
504 testonly = True,
505 srcs = [
506 "capped_test_plant.cc",
507 ],
508 hdrs = [
509 "capped_test_plant.h",
510 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800511 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800512 deps = [
513 ":state_feedback_loop",
514 "//aos/testing:googletest",
515 ],
516)
517
518cc_library(
519 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800520 hdrs = [
521 "static_zeroing_single_dof_profiled_subsystem.h",
522 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800523 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800524 deps = [
525 "//frc971/control_loops:profiled_subsystem",
526 ],
527)
528
529genrule(
530 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
531 outs = [
532 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
533 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
534 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
535 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
536 ],
537 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800538 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800539 tools = [
540 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
541 ],
542)
543
544cc_library(
545 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
546 srcs = [
547 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
548 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
549 ],
550 hdrs = [
551 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
552 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
553 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800554 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800555 deps = [
556 ":state_feedback_loop",
557 ],
558)
559
Alex Perrycb7da4b2019-08-28 19:35:56 -0700560flatbuffer_cc_library(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700561 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700562 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700563 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700564 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700565 gen_reflections = 1,
566 includes = [
567 ":control_loops_fbs_includes",
568 ":profiled_subsystem_fbs_includes",
569 ],
570 target_compatible_with = ["@platforms//os:linux"],
571)
572
573flatbuffer_cc_library(
574 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
575 srcs = [
576 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
577 ],
578 gen_reflections = 1,
579 target_compatible_with = ["@platforms//os:linux"],
580)
581
582flatbuffer_cc_library(
583 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
584 srcs = [
585 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
586 ],
587 gen_reflections = 1,
588 includes = [
589 ":control_loops_fbs_includes",
590 ],
591 target_compatible_with = ["@platforms//os:linux"],
592)
593
594flatbuffer_cc_library(
595 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
596 srcs = [
597 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
598 ],
599 gen_reflections = 1,
600 includes = [
601 ":control_loops_fbs_includes",
602 ],
603 target_compatible_with = ["@platforms//os:linux"],
604)
605
606flatbuffer_cc_library(
607 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
608 srcs = [
609 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
610 ],
611 gen_reflections = 1,
612 includes = [
613 ":control_loops_fbs_includes",
614 ":profiled_subsystem_fbs_includes",
615 ],
616 target_compatible_with = ["@platforms//os:linux"],
617)
618
619flatbuffer_cc_library(
620 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
621 srcs = [
622 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
623 ],
624 gen_reflections = 1,
Alex Perrycb7da4b2019-08-28 19:35:56 -0700625 includes = [
626 ":control_loops_fbs_includes",
627 ":profiled_subsystem_fbs_includes",
628 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800629 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700630)
631
Tyler Chatow12581562019-01-26 20:42:42 -0800632cc_test(
633 name = "static_zeroing_single_dof_profiled_subsystem_test",
634 srcs = [
635 "static_zeroing_single_dof_profiled_subsystem_test.cc",
636 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700637 data = [
638 ":static_zeroing_single_dof_profiled_subsystem_test_config",
639 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800640 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800641 deps = [
642 ":capped_test_plant",
643 ":position_sensor_sim",
644 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700645 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
646 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800647 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700648 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
649 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
650 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
651 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800652 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700653 "//frc971/control_loops:control_loop_test",
Tyler Chatow12581562019-01-26 20:42:42 -0800654 ],
655)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700656
657aos_config(
658 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
659 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
660 flatbuffers = [
661 "//frc971/input:joystick_state_fbs",
662 "//frc971/input:robot_state_fbs",
663 "//aos/logging:log_message_fbs",
664 "//aos/events:event_loop_fbs",
665 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
666 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
667 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
668 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
669 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
670 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
671 ],
672 target_compatible_with = ["@platforms//os:linux"],
673)