blob: 7d3b9156a8400cefe61769ed530e56e1a0789090 [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")
Austin Schuhbcce26a2018-03-26 23:41:24 -07004load("//tools:environments.bzl", "mcu_cpus")
Brian Silverman100534c2015-09-07 15:51:23 -04005
6cc_library(
Austin Schuha647d602018-02-18 14:05:15 -08007 name = "team_number_test_environment",
8 testonly = True,
9 srcs = [
10 "team_number_test_environment.cc",
11 ],
12 hdrs = [
13 "team_number_test_environment.h",
14 ],
15 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 ],
26 deps = [
27 ":hybrid_state_feedback_loop",
28 "//aos/testing:googletest",
29 ],
Brian Silverman100534c2015-09-07 15:51:23 -040030)
31
32cc_library(
James Kuszmaul9f9676d2019-01-25 21:27:58 -080033 name = "pose",
34 hdrs = ["pose.h"],
35 deps = [
36 "//aos/util:math",
Alex Perrycb7da4b2019-08-28 19:35:56 -070037 "@org_tuxfamily_eigen//:eigen",
James Kuszmaul9f9676d2019-01-25 21:27:58 -080038 ],
39)
40
41cc_test(
42 name = "pose_test",
43 srcs = ["pose_test.cc"],
44 deps = [
45 ":pose",
46 "//aos/testing:googletest",
47 ],
48)
49
50cc_library(
Austin Schuha647d602018-02-18 14:05:15 -080051 name = "hall_effect_tracker",
52 hdrs = [
53 "hall_effect_tracker.h",
54 ],
55 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070056 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080057 ],
Brian Silverman100534c2015-09-07 15:51:23 -040058)
59
Alex Perrycb7da4b2019-08-28 19:35:56 -070060flatbuffer_cc_library(
61 name = "control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080062 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070063 "control_loops.fbs",
Austin Schuha647d602018-02-18 14:05:15 -080064 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 compatible_with = mcu_cpus,
Brian Silverman100534c2015-09-07 15:51:23 -040066)
67
68cc_test(
Austin Schuha647d602018-02-18 14:05:15 -080069 name = "position_sensor_sim_test",
70 srcs = [
71 "position_sensor_sim_test.cc",
72 ],
73 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070074 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080075 ":position_sensor_sim",
John Park33858a32018-09-28 23:05:48 -070076 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -080077 "//aos/testing:googletest",
78 ],
Brian Silverman100534c2015-09-07 15:51:23 -040079)
80
81cc_library(
Austin Schuha647d602018-02-18 14:05:15 -080082 name = "position_sensor_sim",
83 testonly = True,
84 srcs = [
85 "position_sensor_sim.cc",
86 ],
87 hdrs = [
88 "position_sensor_sim.h",
89 ],
Brian Silverman6470f442018-08-05 12:08:16 -070090 linkopts = [
91 "-lm",
92 ],
Austin Schuha647d602018-02-18 14:05:15 -080093 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070094 ":control_loops_fbs",
Austin Schuha647d602018-02-18 14:05:15 -080095 ":gaussian_noise",
Austin Schuha647d602018-02-18 14:05:15 -080096 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -080097 ],
Brian Silverman100534c2015-09-07 15:51:23 -040098)
99
100cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800101 name = "gaussian_noise",
102 srcs = [
103 "gaussian_noise.cc",
104 ],
105 hdrs = [
106 "gaussian_noise.h",
107 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800108 linkopts = [
109 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800110 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400111)
112
113cc_library(
Austin Schuhbcce26a2018-03-26 23:41:24 -0700114 name = "coerce_goal_uc",
115 srcs = [
116 "coerce_goal.cc",
117 ],
118 hdrs = [
119 "coerce_goal.h",
120 ],
121 restricted_to = mcu_cpus,
122 deps = [
John Park33858a32018-09-28 23:05:48 -0700123 "//aos/controls:polytope_uc",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700124 "@org_tuxfamily_eigen//:eigen",
Austin Schuhbcce26a2018-03-26 23:41:24 -0700125 ],
126)
127
128cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800129 name = "coerce_goal",
130 srcs = [
131 "coerce_goal.cc",
132 ],
133 hdrs = [
134 "coerce_goal.h",
135 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700136 linkopts = [
137 "-lm",
138 ],
Austin Schuha647d602018-02-18 14:05:15 -0800139 deps = [
John Park33858a32018-09-28 23:05:48 -0700140 "//aos/controls:polytope",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700141 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800142 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400143)
144
Lee Mracek65686142020-01-10 22:21:39 -0500145cc_test(
146 name = "coerce_goal_test",
147 srcs = [
148 "coerce_goal_test.cc",
149 ],
150 linkopts = [
151 "-lm",
152 ],
153 deps = [
154 ":coerce_goal",
155 "//aos/controls:polytope",
156 "//aos/testing:googletest",
157 "@org_tuxfamily_eigen//:eigen",
158 ],
159)
160
Brian Silverman6260c092018-01-14 15:21:36 -0800161# TODO(austin): Select isn't working right. We should be able to remove
162# logging conditionally with select and have CPU constraints work correctly.
163cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800164 name = "state_feedback_loop_uc",
165 hdrs = [
166 "state_feedback_loop.h",
167 ],
Brian Silverman1613b6e2018-09-03 19:10:37 -0700168 restricted_to = mcu_cpus,
Austin Schuha647d602018-02-18 14:05:15 -0800169 deps = [
John Park33858a32018-09-28 23:05:48 -0700170 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700171 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800172 ],
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800173)
174
175cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800176 name = "state_feedback_loop",
177 hdrs = [
178 "state_feedback_loop.h",
179 ],
180 deps = [
John Park33858a32018-09-28 23:05:48 -0700181 "//aos:macros",
182 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700183 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800184 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400185)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500186
187cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800188 name = "hybrid_state_feedback_loop",
189 hdrs = [
190 "hybrid_state_feedback_loop.h",
191 ],
192 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100193 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800194 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700195 "//aos:macros",
196 "//aos/controls:control_loop",
197 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700198 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800199 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500200)
Austin Schuhacd335a2017-01-01 16:20:54 -0800201
202cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800203 name = "simple_capped_state_feedback_loop",
204 hdrs = [
205 "simple_capped_state_feedback_loop.h",
206 ],
207 deps = [
208 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700209 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800210 ],
211)
212
213cc_library(
214 name = "runge_kutta",
215 hdrs = [
216 "runge_kutta.h",
217 ],
218 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700219 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800220 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800221)
222
223cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800224 name = "runge_kutta_test",
225 srcs = [
226 "runge_kutta_test.cc",
227 ],
228 deps = [
229 ":runge_kutta",
230 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700231 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800232 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800233)
Austin Schuh473a5652017-02-05 01:30:42 -0800234
Austin Schuh173a1592018-12-19 16:20:54 +1100235cc_library(
236 name = "fixed_quadrature",
237 hdrs = [
238 "fixed_quadrature.h",
239 ],
240)
241
242cc_test(
243 name = "fixed_quadrature_test",
244 srcs = [
245 "fixed_quadrature_test.cc",
246 ],
247 deps = [
248 ":fixed_quadrature",
249 "//aos/testing:googletest",
250 ],
251)
252
Alex Perrycb7da4b2019-08-28 19:35:56 -0700253flatbuffer_cc_library(
254 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800255 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700256 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800257 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700258 includes = [
259 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700260 ],
261)
262
Austin Schuh473a5652017-02-05 01:30:42 -0800263cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800264 name = "profiled_subsystem",
265 srcs = [
266 "profiled_subsystem.cc",
267 ],
268 hdrs = [
269 "profiled_subsystem.h",
270 ],
271 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700272 ":control_loops_fbs",
273 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800274 ":simple_capped_state_feedback_loop",
275 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700276 "//aos/controls:control_loop",
277 "//aos/util:trapezoid_profile",
Austin Schuha647d602018-02-18 14:05:15 -0800278 "//frc971/zeroing",
279 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800280)
Austin Schuha647d602018-02-18 14:05:15 -0800281
282cc_library(
283 name = "jacobian",
284 hdrs = [
285 "jacobian.h",
286 ],
287 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700288 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800289 ],
290)
291
292cc_test(
293 name = "jacobian_test",
294 srcs = [
295 "jacobian_test.cc",
296 ],
297 deps = [
298 ":jacobian",
299 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700300 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800301 ],
302)
303
James Kuszmaul59a5c612019-01-22 07:56:08 -0800304cc_test(
305 name = "c2d_test",
306 srcs = [
307 "c2d_test.cc",
308 ],
309 visibility = ["//visibility:public"],
310 deps = [
311 ":c2d",
312 ":runge_kutta",
313 "//aos/testing:googletest",
314 ],
315)
316
Austin Schuh03785132018-02-19 18:29:06 -0800317cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100318 name = "c2d",
319 hdrs = [
320 "c2d.h",
321 ],
322 visibility = ["//visibility:public"],
323 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700324 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700325 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100326 ],
327)
328
329cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800330 name = "dlqr",
331 hdrs = [
332 "dlqr.h",
333 ],
334 visibility = ["//visibility:public"],
335 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700336 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800337 "@slycot_repo//:slicot",
338 ],
339)
Brian Silverman6470f442018-08-05 12:08:16 -0700340
341py_library(
342 name = "python_init",
343 srcs = ["__init__.py"],
344 visibility = ["//visibility:public"],
345 deps = ["//frc971:python_init"],
346)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800347
348cc_library(
349 name = "binomial",
350 hdrs = ["binomial.h"],
351)
352
353cc_test(
354 name = "binomial_test",
355 srcs = [
356 "binomial_test.cc",
357 ],
358 deps = [
359 ":binomial",
360 "//aos/testing:googletest",
361 ],
362)
Tyler Chatow12581562019-01-26 20:42:42 -0800363
364cc_library(
365 name = "capped_test_plant",
366 testonly = True,
367 srcs = [
368 "capped_test_plant.cc",
369 ],
370 hdrs = [
371 "capped_test_plant.h",
372 ],
373 deps = [
374 ":state_feedback_loop",
375 "//aos/testing:googletest",
376 ],
377)
378
379cc_library(
380 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800381 hdrs = [
382 "static_zeroing_single_dof_profiled_subsystem.h",
383 ],
384 deps = [
385 "//frc971/control_loops:profiled_subsystem",
386 ],
387)
388
389genrule(
390 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
391 outs = [
392 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
393 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
394 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
395 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
396 ],
397 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
398 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 ],
413 deps = [
414 ":state_feedback_loop",
415 ],
416)
417
Alex Perrycb7da4b2019-08-28 19:35:56 -0700418flatbuffer_cc_library(
419 name = "static_zeroing_single_dof_profiled_subsystem_test_fbs",
420 srcs = [
421 "static_zeroing_single_dof_profiled_subsystem_test.fbs",
422 ],
423 includes = [
424 ":control_loops_fbs_includes",
425 ":profiled_subsystem_fbs_includes",
426 ],
427)
428
Tyler Chatow12581562019-01-26 20:42:42 -0800429cc_test(
430 name = "static_zeroing_single_dof_profiled_subsystem_test",
431 srcs = [
432 "static_zeroing_single_dof_profiled_subsystem_test.cc",
433 ],
434 deps = [
435 ":capped_test_plant",
436 ":position_sensor_sim",
437 ":static_zeroing_single_dof_profiled_subsystem",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700438 ":static_zeroing_single_dof_profiled_subsystem_test_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800439 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
440 "//aos/controls:control_loop_test",
441 "//aos/testing:googletest",
442 ],
443)