blob: 1945db983daf6e663ca320ba941b093b63eaf088 [file] [log] [blame]
Austin Schuha647d602018-02-18 14:05:15 -08001package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Brian Silverman100534c2015-09-07 15:51:23 -04004
5cc_library(
Austin Schuha647d602018-02-18 14:05:15 -08006 name = "team_number_test_environment",
7 testonly = True,
8 srcs = [
9 "team_number_test_environment.cc",
10 ],
11 hdrs = [
12 "team_number_test_environment.h",
13 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080014 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -080015 deps = [
John Park33858a32018-09-28 23:05:48 -070016 "//aos/network:team_number",
Austin Schuha647d602018-02-18 14:05:15 -080017 "//aos/testing:googletest",
18 ],
Brian Silverman100534c2015-09-07 15:51:23 -040019)
20
21cc_test(
Austin Schuha647d602018-02-18 14:05:15 -080022 name = "hybrid_state_feedback_loop_test",
23 srcs = [
24 "hybrid_state_feedback_loop_test.cc",
25 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080026 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -080027 deps = [
28 ":hybrid_state_feedback_loop",
29 "//aos/testing:googletest",
30 ],
Brian Silverman100534c2015-09-07 15:51:23 -040031)
32
33cc_library(
James Kuszmaul9f9676d2019-01-25 21:27:58 -080034 name = "pose",
35 hdrs = ["pose.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080036 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul9f9676d2019-01-25 21:27:58 -080037 deps = [
38 "//aos/util:math",
Alex Perrycb7da4b2019-08-28 19:35:56 -070039 "@org_tuxfamily_eigen//:eigen",
James Kuszmaul9f9676d2019-01-25 21:27:58 -080040 ],
41)
42
43cc_test(
44 name = "pose_test",
45 srcs = ["pose_test.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080046 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul9f9676d2019-01-25 21:27:58 -080047 deps = [
48 ":pose",
49 "//aos/testing:googletest",
50 ],
51)
52
53cc_library(
Austin Schuha647d602018-02-18 14:05:15 -080054 name = "hall_effect_tracker",
55 hdrs = [
56 "hall_effect_tracker.h",
57 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -080059 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080061 ],
Brian Silverman100534c2015-09-07 15:51:23 -040062)
63
Alex Perrycb7da4b2019-08-28 19:35:56 -070064flatbuffer_cc_library(
65 name = "control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080066 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070067 "control_loops.fbs",
Austin Schuha647d602018-02-18 14:05:15 -080068 ],
Brian Silverman100534c2015-09-07 15:51:23 -040069)
70
71cc_test(
Austin Schuha647d602018-02-18 14:05:15 -080072 name = "position_sensor_sim_test",
73 srcs = [
74 "position_sensor_sim_test.cc",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -080077 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070078 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080079 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -070080 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -080081 "//aos/testing:googletest",
82 ],
Brian Silverman100534c2015-09-07 15:51:23 -040083)
84
85cc_library(
Austin Schuha647d602018-02-18 14:05:15 -080086 name = "position_sensor_sim",
87 testonly = True,
88 srcs = [
89 "position_sensor_sim.cc",
90 ],
91 hdrs = [
92 "position_sensor_sim.h",
93 ],
Brian Silverman6470f442018-08-05 12:08:16 -070094 linkopts = [
95 "-lm",
96 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -080098 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070099 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800100 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -0800101 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800102 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400103)
104
105cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800106 name = "gaussian_noise",
107 srcs = [
108 "gaussian_noise.cc",
109 ],
110 hdrs = [
111 "gaussian_noise.h",
112 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800113 linkopts = [
114 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800115 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800116 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbcce26a2018-03-26 23:41:24 -0700117)
118
119cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800120 name = "coerce_goal",
121 srcs = [
122 "coerce_goal.cc",
123 ],
124 hdrs = [
125 "coerce_goal.h",
126 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800127 linkopts = select({
128 "@platforms//os:linux": ["-lm"],
129 "//conditions:default": [],
130 }),
Austin Schuha647d602018-02-18 14:05:15 -0800131 deps = [
John Park33858a32018-09-28 23:05:48 -0700132 "//aos/controls:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700133 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800134 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400135)
136
Lee Mracek65686142020-01-10 22:21:39 -0500137cc_test(
138 name = "coerce_goal_test",
139 srcs = [
140 "coerce_goal_test.cc",
141 ],
142 linkopts = [
143 "-lm",
144 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800145 target_compatible_with = ["@platforms//os:linux"],
Lee Mracek65686142020-01-10 22:21:39 -0500146 deps = [
147 ":coerce_goal",
148 "//aos/controls:polytope",
149 "//aos/testing:googletest",
150 "@org_tuxfamily_eigen//:eigen",
151 ],
152)
153
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800154cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800155 name = "state_feedback_loop",
156 hdrs = [
157 "state_feedback_loop.h",
158 ],
159 deps = [
John Park33858a32018-09-28 23:05:48 -0700160 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700161 "@org_tuxfamily_eigen//:eigen",
Philipp Schraderdada1072020-11-24 11:34:46 -0800162 ] + select({
163 "@platforms//os:linux": ["//aos/logging"],
164 "//conditions:default": [],
165 }),
Brian Silverman100534c2015-09-07 15:51:23 -0400166)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500167
168cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800169 name = "hybrid_state_feedback_loop",
170 hdrs = [
171 "hybrid_state_feedback_loop.h",
172 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800173 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800174 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100175 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800176 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700177 "//aos:macros",
178 "//aos/controls:control_loop",
179 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700180 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800181 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500182)
Austin Schuhacd335a2017-01-01 16:20:54 -0800183
184cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800185 name = "simple_capped_state_feedback_loop",
186 hdrs = [
187 "simple_capped_state_feedback_loop.h",
188 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800189 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800190 deps = [
191 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700192 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800193 ],
194)
195
196cc_library(
197 name = "runge_kutta",
198 hdrs = [
199 "runge_kutta.h",
200 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800201 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800202 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700203 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800204 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800205)
206
207cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800208 name = "runge_kutta_test",
209 srcs = [
210 "runge_kutta_test.cc",
211 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800212 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800213 deps = [
214 ":runge_kutta",
215 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700216 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800217 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800218)
Austin Schuh473a5652017-02-05 01:30:42 -0800219
Austin Schuh173a1592018-12-19 16:20:54 +1100220cc_library(
221 name = "fixed_quadrature",
222 hdrs = [
223 "fixed_quadrature.h",
224 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800225 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100226)
227
228cc_test(
229 name = "fixed_quadrature_test",
230 srcs = [
231 "fixed_quadrature_test.cc",
232 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800233 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh173a1592018-12-19 16:20:54 +1100234 deps = [
235 ":fixed_quadrature",
236 "//aos/testing:googletest",
237 ],
238)
239
Alex Perrycb7da4b2019-08-28 19:35:56 -0700240flatbuffer_cc_library(
241 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800242 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700243 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800244 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700245 includes = [
246 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700247 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800248 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9fe68f72019-08-10 19:32:03 -0700249)
250
Austin Schuh473a5652017-02-05 01:30:42 -0800251cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800252 name = "profiled_subsystem",
253 srcs = [
254 "profiled_subsystem.cc",
255 ],
256 hdrs = [
257 "profiled_subsystem.h",
258 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800259 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800260 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700261 ":control_loops_fbs",
262 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800263 ":simple_capped_state_feedback_loop",
264 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700265 "//aos/controls:control_loop",
266 "//aos/util:trapezoid_profile",
Austin Schuha647d602018-02-18 14:05:15 -0800267 "//frc971/zeroing",
268 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800269)
Austin Schuha647d602018-02-18 14:05:15 -0800270
271cc_library(
272 name = "jacobian",
273 hdrs = [
274 "jacobian.h",
275 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800276 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800277 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700278 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800279 ],
280)
281
282cc_test(
283 name = "jacobian_test",
284 srcs = [
285 "jacobian_test.cc",
286 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800287 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha647d602018-02-18 14:05:15 -0800288 deps = [
289 ":jacobian",
290 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700291 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800292 ],
293)
294
James Kuszmaul59a5c612019-01-22 07:56:08 -0800295cc_test(
296 name = "c2d_test",
297 srcs = [
298 "c2d_test.cc",
299 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800300 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul59a5c612019-01-22 07:56:08 -0800301 visibility = ["//visibility:public"],
302 deps = [
303 ":c2d",
304 ":runge_kutta",
305 "//aos/testing:googletest",
306 ],
307)
308
Austin Schuh03785132018-02-19 18:29:06 -0800309cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100310 name = "c2d",
311 hdrs = [
312 "c2d.h",
313 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800314 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh9b881ae2019-01-04 07:29:20 +1100315 visibility = ["//visibility:public"],
316 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700317 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700318 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100319 ],
320)
321
322cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800323 name = "dlqr",
324 hdrs = [
325 "dlqr.h",
326 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800327 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh03785132018-02-19 18:29:06 -0800328 visibility = ["//visibility:public"],
329 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700330 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800331 "@slycot_repo//:slicot",
332 ],
333)
Brian Silverman6470f442018-08-05 12:08:16 -0700334
335py_library(
336 name = "python_init",
337 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800338 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700339 visibility = ["//visibility:public"],
340 deps = ["//frc971:python_init"],
341)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800342
343cc_library(
344 name = "binomial",
345 hdrs = ["binomial.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800346 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800347)
348
349cc_test(
350 name = "binomial_test",
351 srcs = [
352 "binomial_test.cc",
353 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800354 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800355 deps = [
356 ":binomial",
357 "//aos/testing:googletest",
358 ],
359)
Tyler Chatow12581562019-01-26 20:42:42 -0800360
361cc_library(
362 name = "capped_test_plant",
363 testonly = True,
364 srcs = [
365 "capped_test_plant.cc",
366 ],
367 hdrs = [
368 "capped_test_plant.h",
369 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800370 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800371 deps = [
372 ":state_feedback_loop",
373 "//aos/testing:googletest",
374 ],
375)
376
377cc_library(
378 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800379 hdrs = [
380 "static_zeroing_single_dof_profiled_subsystem.h",
381 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800382 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800383 deps = [
384 "//frc971/control_loops:profiled_subsystem",
385 ],
386)
387
388genrule(
389 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
390 outs = [
391 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
392 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
393 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
394 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
395 ],
396 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
Philipp Schraderdada1072020-11-24 11:34:46 -0800397 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800398 tools = [
399 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
400 ],
401)
402
403cc_library(
404 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
405 srcs = [
406 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
407 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
408 ],
409 hdrs = [
410 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
411 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
412 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800413 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800414 deps = [
415 ":state_feedback_loop",
416 ],
417)
418
Alex Perrycb7da4b2019-08-28 19:35:56 -0700419flatbuffer_cc_library(
420 name = "static_zeroing_single_dof_profiled_subsystem_test_fbs",
421 srcs = [
422 "static_zeroing_single_dof_profiled_subsystem_test.fbs",
423 ],
424 includes = [
425 ":control_loops_fbs_includes",
426 ":profiled_subsystem_fbs_includes",
427 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800428 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700429)
430
Tyler Chatow12581562019-01-26 20:42:42 -0800431cc_test(
432 name = "static_zeroing_single_dof_profiled_subsystem_test",
433 srcs = [
434 "static_zeroing_single_dof_profiled_subsystem_test.cc",
435 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800436 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow12581562019-01-26 20:42:42 -0800437 deps = [
438 ":capped_test_plant",
439 ":position_sensor_sim",
440 ":static_zeroing_single_dof_profiled_subsystem",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700441 ":static_zeroing_single_dof_profiled_subsystem_test_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800442 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
443 "//aos/controls:control_loop_test",
444 "//aos/testing:googletest",
445 ],
446)