blob: c03a964d8a40e193970f5d3bf327aa4815108ba2 [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
Niko Sohmers76f47562023-12-20 20:59:06 -0800202flatbuffer_ts_library(
203 name = "can_falcon_ts_fbs",
204 srcs = [
205 "can_falcon.fbs",
206 ],
207)
208
Maxwell Hendersonca1d18f2023-07-26 21:06:14 -0700209flatbuffer_cc_library(
210 name = "can_falcon_fbs",
211 srcs = [
212 "can_falcon.fbs",
213 ],
214)
215
Brian Silverman100534c2015-09-07 15:51:23 -0400216cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800217 name = "position_sensor_sim_test",
218 srcs = [
219 "position_sensor_sim_test.cc",
220 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800221 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800222 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700223 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800224 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -0700225 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800226 "//aos/testing:googletest",
227 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400228)
229
230cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800231 name = "position_sensor_sim",
232 testonly = True,
233 srcs = [
234 "position_sensor_sim.cc",
235 ],
236 hdrs = [
237 "position_sensor_sim.h",
238 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700239 linkopts = [
240 "-lm",
241 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800242 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800243 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700244 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800245 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800246 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800247 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400248)
249
250cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800251 name = "gaussian_noise",
252 srcs = [
253 "gaussian_noise.cc",
254 ],
255 hdrs = [
256 "gaussian_noise.h",
257 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800258 linkopts = [
259 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800260 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800261 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700262)
263
264cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800265 name = "coerce_goal",
266 srcs = [
267 "coerce_goal.cc",
268 ],
269 hdrs = [
270 "coerce_goal.h",
271 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 linkopts = select({
273 "@platforms//os:linux": ["-lm"],
274 "//conditions:default": [],
275 }),
Austin Schuha647d602018-02-18 14:05:15 -0800276 deps = [
James Kuszmaul61750662021-06-21 21:32:33 -0700277 "//frc971/control_loops:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700278 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800279 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400280)
281
Lee Mracek65686142020-01-10 22:21:39 -0500282cc_test(
283 name = "coerce_goal_test",
284 srcs = [
285 "coerce_goal_test.cc",
286 ],
287 linkopts = [
288 "-lm",
289 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800290 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500291 deps = [
292 ":coerce_goal",
Lee Mracek65686142020-01-10 22:21:39 -0500293 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700294 "//frc971/control_loops:polytope",
Lee Mracek65686142020-01-10 22:21:39 -0500295 "@org_tuxfamily_eigen//:eigen",
296 ],
297)
298
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800299cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800300 name = "state_feedback_loop",
301 hdrs = [
302 "state_feedback_loop.h",
303 ],
304 deps = [
John Park33858a32018-09-28 23:05:48 -0700305 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700306 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800307 ] + select({
308 "@platforms//os:linux": ["//aos/logging"],
309 "//conditions:default": [],
310 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400311)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500312
313cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800314 name = "hybrid_state_feedback_loop",
315 hdrs = [
316 "hybrid_state_feedback_loop.h",
317 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800318 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800319 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100320 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800321 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700322 "//aos:macros",
John Park33858a32018-09-28 23:05:48 -0700323 "//aos/logging",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700324 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700325 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800326 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500327)
Austin Schuhacd335a2017-01-01 16:20:54 -0800328
329cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800330 name = "simple_capped_state_feedback_loop",
331 hdrs = [
332 "simple_capped_state_feedback_loop.h",
333 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800334 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800335 deps = [
336 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700337 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800338 ],
339)
340
341cc_library(
342 name = "runge_kutta",
343 hdrs = [
344 "runge_kutta.h",
345 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800346 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800347 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700348 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800349 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800350)
351
352cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800353 name = "runge_kutta_test",
354 srcs = [
355 "runge_kutta_test.cc",
356 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800357 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800358 deps = [
359 ":runge_kutta",
360 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700361 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800362 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800363)
Austin Schuh473a5652017-02-05 01:30:42 -0800364
Austin Schuh173a1592018-12-19 16:20:54 +1100365cc_library(
366 name = "fixed_quadrature",
367 hdrs = [
368 "fixed_quadrature.h",
369 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800370 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha935a082023-02-20 21:45:54 -0800371 deps = [
372 "@org_tuxfamily_eigen//:eigen",
373 ],
Austin Schuh173a1592018-12-19 16:20:54 +1100374)
375
376cc_test(
377 name = "fixed_quadrature_test",
378 srcs = [
379 "fixed_quadrature_test.cc",
380 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800381 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100382 deps = [
383 ":fixed_quadrature",
384 "//aos/testing:googletest",
385 ],
386)
387
James Kuszmauldac091f2022-03-22 09:35:06 -0700388flatbuffer_ts_library(
389 name = "profiled_subsystem_ts_fbs",
390 srcs = [
391 "profiled_subsystem.fbs",
392 ],
393 deps = [
394 ":control_loops_ts_fbs",
395 ],
396)
397
Alex Perrycb7da4b2019-08-28 19:35:56 -0700398flatbuffer_cc_library(
399 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800400 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700401 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800402 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700403 includes = [
404 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700405 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800406 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700407)
408
Austin Schuh473a5652017-02-05 01:30:42 -0800409cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800410 name = "profiled_subsystem",
411 srcs = [
412 "profiled_subsystem.cc",
413 ],
414 hdrs = [
415 "profiled_subsystem.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 ":control_loops_fbs",
420 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800421 ":simple_capped_state_feedback_loop",
422 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700423 "//aos/util:trapezoid_profile",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700424 "//frc971/control_loops:control_loop",
Austin Schuha647d602018-02-18 14:05:15 -0800425 "//frc971/zeroing",
James Kuszmaulec635d22023-08-12 18:39:24 -0700426 "//frc971/zeroing:pot_and_index",
Austin Schuha647d602018-02-18 14:05:15 -0800427 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800428)
Austin Schuha647d602018-02-18 14:05:15 -0800429
430cc_library(
431 name = "jacobian",
432 hdrs = [
433 "jacobian.h",
434 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800435 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800436 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700437 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800438 ],
439)
440
441cc_test(
442 name = "jacobian_test",
443 srcs = [
444 "jacobian_test.cc",
445 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800446 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800447 deps = [
448 ":jacobian",
449 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700450 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800451 ],
452)
453
James Kuszmaul59a5c612019-01-22 07:56:08 -0800454cc_test(
455 name = "c2d_test",
456 srcs = [
457 "c2d_test.cc",
458 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800459 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800460 visibility = ["//visibility:public"],
461 deps = [
462 ":c2d",
463 ":runge_kutta",
464 "//aos/testing:googletest",
465 ],
466)
467
Austin Schuh03785132018-02-19 18:29:06 -0800468cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100469 name = "c2d",
470 hdrs = [
471 "c2d.h",
472 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800473 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100474 visibility = ["//visibility:public"],
475 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700476 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700477 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100478 ],
479)
480
481cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800482 name = "dlqr",
483 hdrs = [
484 "dlqr.h",
485 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800486 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800487 visibility = ["//visibility:public"],
488 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700489 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800490 "@slycot_repo//:slicot",
491 ],
492)
Brian Silverman6470f442018-08-05 12:08:16 -0700493
494py_library(
495 name = "python_init",
496 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800497 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700498 visibility = ["//visibility:public"],
499 deps = ["//frc971:python_init"],
500)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800501
502cc_library(
503 name = "binomial",
504 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800505 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800506)
507
508cc_test(
509 name = "binomial_test",
510 srcs = [
511 "binomial_test.cc",
512 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800513 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800514 deps = [
515 ":binomial",
516 "//aos/testing:googletest",
517 ],
518)
Tyler Chatow12581562019-01-26 20:42:42 -0800519
520cc_library(
521 name = "capped_test_plant",
522 testonly = True,
523 srcs = [
524 "capped_test_plant.cc",
525 ],
526 hdrs = [
527 "capped_test_plant.h",
528 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800529 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800530 deps = [
531 ":state_feedback_loop",
532 "//aos/testing:googletest",
533 ],
534)
535
536cc_library(
537 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800538 hdrs = [
539 "static_zeroing_single_dof_profiled_subsystem.h",
540 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800541 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800542 deps = [
543 "//frc971/control_loops:profiled_subsystem",
544 ],
545)
546
547genrule(
548 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
549 outs = [
550 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
551 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
552 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
553 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
554 ],
555 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800556 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800557 tools = [
558 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
559 ],
560)
561
562cc_library(
563 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
564 srcs = [
565 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
566 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
567 ],
568 hdrs = [
569 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
570 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
571 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800572 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800573 deps = [
574 ":state_feedback_loop",
575 ],
576)
577
Alex Perrycb7da4b2019-08-28 19:35:56 -0700578flatbuffer_cc_library(
Austin Schuha9df9ad2021-06-16 14:49:39 -0700579 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700580 srcs = [
Austin Schuha9df9ad2021-06-16 14:49:39 -0700581 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700582 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700583 gen_reflections = 1,
584 includes = [
585 ":control_loops_fbs_includes",
586 ":profiled_subsystem_fbs_includes",
587 ],
588 target_compatible_with = ["@platforms//os:linux"],
589)
590
591flatbuffer_cc_library(
592 name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
593 srcs = [
594 "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
595 ],
596 gen_reflections = 1,
597 target_compatible_with = ["@platforms//os:linux"],
598)
599
600flatbuffer_cc_library(
601 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
602 srcs = [
603 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
604 ],
605 gen_reflections = 1,
606 includes = [
607 ":control_loops_fbs_includes",
608 ],
609 target_compatible_with = ["@platforms//os:linux"],
610)
611
612flatbuffer_cc_library(
613 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
614 srcs = [
615 "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
616 ],
617 gen_reflections = 1,
618 includes = [
619 ":control_loops_fbs_includes",
620 ],
621 target_compatible_with = ["@platforms//os:linux"],
622)
623
624flatbuffer_cc_library(
625 name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
626 srcs = [
627 "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
628 ],
629 gen_reflections = 1,
630 includes = [
631 ":control_loops_fbs_includes",
632 ":profiled_subsystem_fbs_includes",
633 ],
634 target_compatible_with = ["@platforms//os:linux"],
635)
636
637flatbuffer_cc_library(
638 name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
639 srcs = [
640 "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
641 ],
642 gen_reflections = 1,
Alex Perrycb7da4b2019-08-28 19:35:56 -0700643 includes = [
644 ":control_loops_fbs_includes",
645 ":profiled_subsystem_fbs_includes",
646 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800647 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700648)
649
Tyler Chatow12581562019-01-26 20:42:42 -0800650cc_test(
651 name = "static_zeroing_single_dof_profiled_subsystem_test",
652 srcs = [
653 "static_zeroing_single_dof_profiled_subsystem_test.cc",
654 ],
Austin Schuha9df9ad2021-06-16 14:49:39 -0700655 data = [
656 ":static_zeroing_single_dof_profiled_subsystem_test_config",
657 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800658 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800659 deps = [
660 ":capped_test_plant",
661 ":position_sensor_sim",
662 ":static_zeroing_single_dof_profiled_subsystem",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700663 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
664 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800665 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuha9df9ad2021-06-16 14:49:39 -0700666 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
667 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
668 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
669 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800670 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700671 "//frc971/control_loops:control_loop_test",
James Kuszmaulec635d22023-08-12 18:39:24 -0700672 "//frc971/zeroing:absolute_and_absolute_encoder",
673 "//frc971/zeroing:absolute_encoder",
674 "//frc971/zeroing:pot_and_absolute_encoder",
Tyler Chatow12581562019-01-26 20:42:42 -0800675 ],
676)
Austin Schuha9df9ad2021-06-16 14:49:39 -0700677
678aos_config(
679 name = "static_zeroing_single_dof_profiled_subsystem_test_config",
680 src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json",
681 flatbuffers = [
682 "//frc971/input:joystick_state_fbs",
683 "//frc971/input:robot_state_fbs",
684 "//aos/logging:log_message_fbs",
685 "//aos/events:event_loop_fbs",
686 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
687 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
688 ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
689 ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
690 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
691 ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
692 ],
693 target_compatible_with = ["@platforms//os:linux"],
694)