blob: 773b6cb8857acea28b51ad2e5ea869c42e636a43 [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 = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700306 "//aos/time",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100307 "//third_party/eigen",
308 ],
309)
310
311cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800312 name = "dlqr",
313 hdrs = [
314 "dlqr.h",
315 ],
316 visibility = ["//visibility:public"],
317 deps = [
318 "//third_party/eigen",
319 "@slycot_repo//:slicot",
320 ],
321)
Brian Silverman6470f442018-08-05 12:08:16 -0700322
323py_library(
324 name = "python_init",
325 srcs = ["__init__.py"],
326 visibility = ["//visibility:public"],
327 deps = ["//frc971:python_init"],
328)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800329
330cc_library(
331 name = "binomial",
332 hdrs = ["binomial.h"],
333)
334
335cc_test(
336 name = "binomial_test",
337 srcs = [
338 "binomial_test.cc",
339 ],
340 deps = [
341 ":binomial",
342 "//aos/testing:googletest",
343 ],
344)
Tyler Chatow12581562019-01-26 20:42:42 -0800345
346cc_library(
347 name = "capped_test_plant",
348 testonly = True,
349 srcs = [
350 "capped_test_plant.cc",
351 ],
352 hdrs = [
353 "capped_test_plant.h",
354 ],
355 deps = [
356 ":state_feedback_loop",
357 "//aos/testing:googletest",
358 ],
359)
360
361cc_library(
362 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800363 hdrs = [
364 "static_zeroing_single_dof_profiled_subsystem.h",
365 ],
366 deps = [
367 "//frc971/control_loops:profiled_subsystem",
368 ],
369)
370
371genrule(
372 name = "genrule_static_zeroing_single_dof_profiled_subsystem_test",
373 outs = [
374 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
375 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
376 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
377 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
378 ],
379 cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)",
380 tools = [
381 "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test",
382 ],
383)
384
385cc_library(
386 name = "static_zeroing_single_dof_profiled_subsystem_test_plants",
387 srcs = [
388 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc",
389 "static_zeroing_single_dof_profiled_subsystem_test_plant.cc",
390 ],
391 hdrs = [
392 "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h",
393 "static_zeroing_single_dof_profiled_subsystem_test_plant.h",
394 ],
395 deps = [
396 ":state_feedback_loop",
397 ],
398)
399
400cc_test(
401 name = "static_zeroing_single_dof_profiled_subsystem_test",
402 srcs = [
403 "static_zeroing_single_dof_profiled_subsystem_test.cc",
404 ],
405 deps = [
406 ":capped_test_plant",
407 ":position_sensor_sim",
408 ":static_zeroing_single_dof_profiled_subsystem",
409 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
410 "//aos/controls:control_loop_test",
411 "//aos/testing:googletest",
412 ],
413)