blob: 37957ec9c15e8366e82f6ef4c5e0ef8585b992fa [file] [log] [blame]
Austin Schuha647d602018-02-18 14:05:15 -08001package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04002
Austin Schuha647d602018-02-18 14:05:15 -08003load("//aos/build:queues.bzl", "queue_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",
37 "//third_party/eigen",
38 ],
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 = [
56 ":queues",
57 ],
Brian Silverman100534c2015-09-07 15:51:23 -040058)
59
60queue_library(
Austin Schuha647d602018-02-18 14:05:15 -080061 name = "queues",
62 srcs = [
63 "control_loops.q",
64 ],
Brian Silverman100534c2015-09-07 15:51:23 -040065)
66
67cc_test(
Austin Schuha647d602018-02-18 14:05:15 -080068 name = "position_sensor_sim_test",
69 srcs = [
70 "position_sensor_sim_test.cc",
71 ],
72 deps = [
73 ":position_sensor_sim",
74 ":queues",
John Park33858a32018-09-28 23:05:48 -070075 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -080076 "//aos/testing:googletest",
77 ],
Brian Silverman100534c2015-09-07 15:51:23 -040078)
79
80cc_library(
Austin Schuha647d602018-02-18 14:05:15 -080081 name = "position_sensor_sim",
82 testonly = True,
83 srcs = [
84 "position_sensor_sim.cc",
85 ],
86 hdrs = [
87 "position_sensor_sim.h",
88 ],
Brian Silverman6470f442018-08-05 12:08:16 -070089 linkopts = [
90 "-lm",
91 ],
Austin Schuha647d602018-02-18 14:05:15 -080092 deps = [
93 ":gaussian_noise",
94 ":queues",
95 "//aos/testing:random_seed",
Philipp Schraderb3a057e2018-03-10 18:59:40 -080096 ],
Brian Silverman100534c2015-09-07 15:51:23 -040097)
98
99cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800100 name = "gaussian_noise",
101 srcs = [
102 "gaussian_noise.cc",
103 ],
104 hdrs = [
105 "gaussian_noise.h",
106 ],
Philipp Schraderb3a057e2018-03-10 18:59:40 -0800107 linkopts = [
108 "-lm",
Austin Schuha647d602018-02-18 14:05:15 -0800109 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400110)
111
112cc_library(
Austin Schuhbcce26a2018-03-26 23:41:24 -0700113 name = "coerce_goal_uc",
114 srcs = [
115 "coerce_goal.cc",
116 ],
117 hdrs = [
118 "coerce_goal.h",
119 ],
120 restricted_to = mcu_cpus,
121 deps = [
John Park33858a32018-09-28 23:05:48 -0700122 "//aos/controls:polytope_uc",
Austin Schuhbcce26a2018-03-26 23:41:24 -0700123 "//third_party/eigen",
124 ],
125)
126
127cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800128 name = "coerce_goal",
129 srcs = [
130 "coerce_goal.cc",
131 ],
132 hdrs = [
133 "coerce_goal.h",
134 ],
Brian Silverman6470f442018-08-05 12:08:16 -0700135 linkopts = [
136 "-lm",
137 ],
Austin Schuha647d602018-02-18 14:05:15 -0800138 deps = [
John Park33858a32018-09-28 23:05:48 -0700139 "//aos/controls:polytope",
Austin Schuha647d602018-02-18 14:05:15 -0800140 "//third_party/eigen",
141 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400142)
143
Brian Silverman6260c092018-01-14 15:21:36 -0800144# TODO(austin): Select isn't working right. We should be able to remove
145# logging conditionally with select and have CPU constraints work correctly.
146cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800147 name = "state_feedback_loop_uc",
148 hdrs = [
149 "state_feedback_loop.h",
150 ],
Brian Silverman1613b6e2018-09-03 19:10:37 -0700151 restricted_to = mcu_cpus,
Austin Schuha647d602018-02-18 14:05:15 -0800152 deps = [
John Park33858a32018-09-28 23:05:48 -0700153 "//aos:macros",
Austin Schuha647d602018-02-18 14:05:15 -0800154 "//third_party/eigen",
155 ],
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800156)
157
158cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800159 name = "state_feedback_loop",
160 hdrs = [
161 "state_feedback_loop.h",
162 ],
163 deps = [
John Park33858a32018-09-28 23:05:48 -0700164 "//aos:macros",
165 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800166 "//third_party/eigen",
167 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400168)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500169
170cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800171 name = "hybrid_state_feedback_loop",
172 hdrs = [
173 "hybrid_state_feedback_loop.h",
174 ],
175 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100176 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800177 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700178 "//aos:macros",
179 "//aos/controls:control_loop",
180 "//aos/logging",
Austin Schuha647d602018-02-18 14:05:15 -0800181 "//third_party/eigen",
182 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500183)
Austin Schuhacd335a2017-01-01 16:20:54 -0800184
185cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800186 name = "simple_capped_state_feedback_loop",
187 hdrs = [
188 "simple_capped_state_feedback_loop.h",
189 ],
190 deps = [
191 ":state_feedback_loop",
192 "//third_party/eigen",
193 ],
194)
195
196cc_library(
197 name = "runge_kutta",
198 hdrs = [
199 "runge_kutta.h",
200 ],
201 deps = [
202 "//third_party/eigen",
203 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800204)
205
206cc_test(
Austin Schuha647d602018-02-18 14:05:15 -0800207 name = "runge_kutta_test",
208 srcs = [
209 "runge_kutta_test.cc",
210 ],
211 deps = [
212 ":runge_kutta",
213 "//aos/testing:googletest",
214 "//third_party/eigen",
215 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800216)
Austin Schuh473a5652017-02-05 01:30:42 -0800217
Austin Schuh173a1592018-12-19 16:20:54 +1100218cc_library(
219 name = "fixed_quadrature",
220 hdrs = [
221 "fixed_quadrature.h",
222 ],
223)
224
225cc_test(
226 name = "fixed_quadrature_test",
227 srcs = [
228 "fixed_quadrature_test.cc",
229 ],
230 deps = [
231 ":fixed_quadrature",
232 "//aos/testing:googletest",
233 ],
234)
235
Austin Schuh3634ed32017-02-05 16:28:49 -0800236queue_library(
Austin Schuha647d602018-02-18 14:05:15 -0800237 name = "profiled_subsystem_queue",
238 srcs = [
239 "profiled_subsystem.q",
240 ],
241 deps = [
242 ":queues",
243 ],
Austin Schuh3634ed32017-02-05 16:28:49 -0800244)
245
Austin Schuh473a5652017-02-05 01:30:42 -0800246cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800247 name = "profiled_subsystem",
248 srcs = [
249 "profiled_subsystem.cc",
250 ],
251 hdrs = [
252 "profiled_subsystem.h",
253 ],
254 deps = [
255 ":profiled_subsystem_queue",
256 ":simple_capped_state_feedback_loop",
257 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700258 "//aos/controls:control_loop",
259 "//aos/util:trapezoid_profile",
Austin Schuha647d602018-02-18 14:05:15 -0800260 "//frc971/zeroing",
261 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800262)
Austin Schuha647d602018-02-18 14:05:15 -0800263
264cc_library(
265 name = "jacobian",
266 hdrs = [
267 "jacobian.h",
268 ],
269 deps = [
270 "//third_party/eigen",
271 ],
272)
273
274cc_test(
275 name = "jacobian_test",
276 srcs = [
277 "jacobian_test.cc",
278 ],
279 deps = [
280 ":jacobian",
281 "//aos/testing:googletest",
282 "//third_party/eigen",
283 ],
284)
285
James Kuszmaul59a5c612019-01-22 07:56:08 -0800286cc_test(
287 name = "c2d_test",
288 srcs = [
289 "c2d_test.cc",
290 ],
291 visibility = ["//visibility:public"],
292 deps = [
293 ":c2d",
294 ":runge_kutta",
295 "//aos/testing:googletest",
296 ],
297)
298
Austin Schuh03785132018-02-19 18:29:06 -0800299cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100300 name = "c2d",
301 hdrs = [
302 "c2d.h",
303 ],
304 visibility = ["//visibility:public"],
305 deps = [
306 "//third_party/eigen",
307 ],
308)
309
310cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800311 name = "dlqr",
312 hdrs = [
313 "dlqr.h",
314 ],
315 visibility = ["//visibility:public"],
316 deps = [
317 "//third_party/eigen",
318 "@slycot_repo//:slicot",
319 ],
320)
Brian Silverman6470f442018-08-05 12:08:16 -0700321
322py_library(
323 name = "python_init",
324 srcs = ["__init__.py"],
325 visibility = ["//visibility:public"],
326 deps = ["//frc971:python_init"],
327)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800328
329cc_library(
330 name = "binomial",
331 hdrs = ["binomial.h"],
332)
333
334cc_test(
335 name = "binomial_test",
336 srcs = [
337 "binomial_test.cc",
338 ],
339 deps = [
340 ":binomial",
341 "//aos/testing:googletest",
342 ],
343)
Tyler Chatow12581562019-01-26 20:42:42 -0800344
345cc_library(
346 name = "capped_test_plant",
347 testonly = True,
348 srcs = [
349 "capped_test_plant.cc",
350 ],
351 hdrs = [
352 "capped_test_plant.h",
353 ],
354 deps = [
355 ":state_feedback_loop",
356 "//aos/testing:googletest",
357 ],
358)
359
360cc_library(
361 name = "static_zeroing_single_dof_profiled_subsystem",
362 srcs = [
363 "static_zeroing_single_dof_profiled_subsystem.cc",
364 ],
365 hdrs = [
366 "static_zeroing_single_dof_profiled_subsystem.h",
367 ],
368 deps = [
369 "//frc971/control_loops:profiled_subsystem",
370 ],
371)
372
373genrule(
374 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
375 outs = [
376 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
377 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
378 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
379 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
380 ],
381 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
382 tools = [
383 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
384 ],
385)
386
387cc_library(
388 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
389 srcs = [
390 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
391 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
392 ],
393 hdrs = [
394 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
395 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
396 ],
397 deps = [
398 ":state_feedback_loop",
399 ],
400)
401
402cc_test(
403 name = "static_zeroing_single_dof_profiled_subsystem_test",
404 srcs = [
405 "static_zeroing_single_dof_profiled_subsystem_test.cc",
406 ],
407 deps = [
408 ":capped_test_plant",
409 ":position_sensor_sim",
410 ":static_zeroing_single_dof_profiled_subsystem",
411 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
412 "//aos/controls:control_loop_test",
413 "//aos/testing:googletest",
414 ],
415)