blob: 3d6c9307e08b1b55560a7e411d089b9274f0913d [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 Schuh9fe68f72019-08-10 19:32:03 -0700246queue_library(
247 name = "static_zeroing_single_dof_profiled_subsystem_test_queue",
248 srcs = [
249 "static_zeroing_single_dof_profiled_subsystem_test.q",
250 ],
251 deps = [
252 ":profiled_subsystem_queue",
253 ":queues",
254 ],
255)
256
Austin Schuh473a5652017-02-05 01:30:42 -0800257cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800258 name = "profiled_subsystem",
259 srcs = [
260 "profiled_subsystem.cc",
261 ],
262 hdrs = [
263 "profiled_subsystem.h",
264 ],
265 deps = [
266 ":profiled_subsystem_queue",
267 ":simple_capped_state_feedback_loop",
268 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700269 "//aos/controls:control_loop",
270 "//aos/util:trapezoid_profile",
Austin Schuha647d602018-02-18 14:05:15 -0800271 "//frc971/zeroing",
272 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800273)
Austin Schuha647d602018-02-18 14:05:15 -0800274
275cc_library(
276 name = "jacobian",
277 hdrs = [
278 "jacobian.h",
279 ],
280 deps = [
281 "//third_party/eigen",
282 ],
283)
284
285cc_test(
286 name = "jacobian_test",
287 srcs = [
288 "jacobian_test.cc",
289 ],
290 deps = [
291 ":jacobian",
292 "//aos/testing:googletest",
293 "//third_party/eigen",
294 ],
295)
296
James Kuszmaul59a5c612019-01-22 07:56:08 -0800297cc_test(
298 name = "c2d_test",
299 srcs = [
300 "c2d_test.cc",
301 ],
302 visibility = ["//visibility:public"],
303 deps = [
304 ":c2d",
305 ":runge_kutta",
306 "//aos/testing:googletest",
307 ],
308)
309
Austin Schuh03785132018-02-19 18:29:06 -0800310cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100311 name = "c2d",
312 hdrs = [
313 "c2d.h",
314 ],
315 visibility = ["//visibility:public"],
316 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700317 "//aos/time",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100318 "//third_party/eigen",
319 ],
320)
321
322cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800323 name = "dlqr",
324 hdrs = [
325 "dlqr.h",
326 ],
327 visibility = ["//visibility:public"],
328 deps = [
329 "//third_party/eigen",
330 "@slycot_repo//:slicot",
331 ],
332)
Brian Silverman6470f442018-08-05 12:08:16 -0700333
334py_library(
335 name = "python_init",
336 srcs = ["__init__.py"],
337 visibility = ["//visibility:public"],
338 deps = ["//frc971:python_init"],
339)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800340
341cc_library(
342 name = "binomial",
343 hdrs = ["binomial.h"],
344)
345
346cc_test(
347 name = "binomial_test",
348 srcs = [
349 "binomial_test.cc",
350 ],
351 deps = [
352 ":binomial",
353 "//aos/testing:googletest",
354 ],
355)
Tyler Chatow12581562019-01-26 20:42:42 -0800356
357cc_library(
358 name = "capped_test_plant",
359 testonly = True,
360 srcs = [
361 "capped_test_plant.cc",
362 ],
363 hdrs = [
364 "capped_test_plant.h",
365 ],
366 deps = [
367 ":state_feedback_loop",
368 "//aos/testing:googletest",
369 ],
370)
371
372cc_library(
373 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800374 hdrs = [
375 "static_zeroing_single_dof_profiled_subsystem.h",
376 ],
377 deps = [
378 "//frc971/control_loops:profiled_subsystem",
379 ],
380)
381
382genrule(
383 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
384 outs = [
385 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
386 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
387 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
388 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
389 ],
390 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
391 tools = [
392 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
393 ],
394)
395
396cc_library(
397 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
398 srcs = [
399 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
400 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
401 ],
402 hdrs = [
403 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
404 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
405 ],
406 deps = [
407 ":state_feedback_loop",
408 ],
409)
410
411cc_test(
412 name = "static_zeroing_single_dof_profiled_subsystem_test",
413 srcs = [
414 "static_zeroing_single_dof_profiled_subsystem_test.cc",
415 ],
416 deps = [
417 ":capped_test_plant",
418 ":position_sensor_sim",
419 ":static_zeroing_single_dof_profiled_subsystem",
420 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700421 ":static_zeroing_single_dof_profiled_subsystem_test_queue",
Tyler Chatow12581562019-01-26 20:42:42 -0800422 "//aos/controls:control_loop_test",
423 "//aos/testing:googletest",
424 ],
425)