blob: 17613ab5e08ac150fbae411cb9db167d34cf99f9 [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
Brian Silverman6260c092018-01-14 15:21:36 -0800145# TODO(austin): Select isn't working right. We should be able to remove
146# logging conditionally with select and have CPU constraints work correctly.
147cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800148 name = "state_feedback_loop_uc",
149 hdrs = [
150 "state_feedback_loop.h",
151 ],
Brian Silverman1613b6e2018-09-03 19:10:37 -0700152 restricted_to = mcu_cpus,
Austin Schuha647d602018-02-18 14:05:15 -0800153 deps = [
John Park33858a32018-09-28 23:05:48 -0700154 "//aos:macros",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700155 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800156 ],
Austin Schuh4cc4fe22017-11-23 19:13:09 -0800157)
158
159cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800160 name = "state_feedback_loop",
161 hdrs = [
162 "state_feedback_loop.h",
163 ],
164 deps = [
John Park33858a32018-09-28 23:05:48 -0700165 "//aos:macros",
166 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700167 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800168 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400169)
Brian Silverman2b1957a2016-02-14 20:29:57 -0500170
171cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800172 name = "hybrid_state_feedback_loop",
173 hdrs = [
174 "hybrid_state_feedback_loop.h",
175 ],
176 deps = [
Austin Schuh9b881ae2019-01-04 07:29:20 +1100177 ":c2d",
Austin Schuha647d602018-02-18 14:05:15 -0800178 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700179 "//aos:macros",
180 "//aos/controls:control_loop",
181 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700182 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800183 ],
Brian Silverman2b1957a2016-02-14 20:29:57 -0500184)
Austin Schuhacd335a2017-01-01 16:20:54 -0800185
186cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800187 name = "simple_capped_state_feedback_loop",
188 hdrs = [
189 "simple_capped_state_feedback_loop.h",
190 ],
191 deps = [
192 ":state_feedback_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700193 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800194 ],
195)
196
197cc_library(
198 name = "runge_kutta",
199 hdrs = [
200 "runge_kutta.h",
201 ],
202 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 ],
212 deps = [
213 ":runge_kutta",
214 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700215 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800216 ],
Austin Schuhacd335a2017-01-01 16:20:54 -0800217)
Austin Schuh473a5652017-02-05 01:30:42 -0800218
Austin Schuh173a1592018-12-19 16:20:54 +1100219cc_library(
220 name = "fixed_quadrature",
221 hdrs = [
222 "fixed_quadrature.h",
223 ],
224)
225
226cc_test(
227 name = "fixed_quadrature_test",
228 srcs = [
229 "fixed_quadrature_test.cc",
230 ],
231 deps = [
232 ":fixed_quadrature",
233 "//aos/testing:googletest",
234 ],
235)
236
Alex Perrycb7da4b2019-08-28 19:35:56 -0700237flatbuffer_cc_library(
238 name = "profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800239 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700240 "profiled_subsystem.fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800241 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700242 includes = [
243 ":control_loops_fbs_includes",
Austin Schuh9fe68f72019-08-10 19:32:03 -0700244 ],
245)
246
Austin Schuh473a5652017-02-05 01:30:42 -0800247cc_library(
Austin Schuha647d602018-02-18 14:05:15 -0800248 name = "profiled_subsystem",
249 srcs = [
250 "profiled_subsystem.cc",
251 ],
252 hdrs = [
253 "profiled_subsystem.h",
254 ],
255 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700256 ":control_loops_fbs",
257 ":profiled_subsystem_fbs",
Austin Schuha647d602018-02-18 14:05:15 -0800258 ":simple_capped_state_feedback_loop",
259 ":state_feedback_loop",
John Park33858a32018-09-28 23:05:48 -0700260 "//aos/controls:control_loop",
261 "//aos/util:trapezoid_profile",
Austin Schuha647d602018-02-18 14:05:15 -0800262 "//frc971/zeroing",
263 ],
Austin Schuh473a5652017-02-05 01:30:42 -0800264)
Austin Schuha647d602018-02-18 14:05:15 -0800265
266cc_library(
267 name = "jacobian",
268 hdrs = [
269 "jacobian.h",
270 ],
271 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700272 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800273 ],
274)
275
276cc_test(
277 name = "jacobian_test",
278 srcs = [
279 "jacobian_test.cc",
280 ],
281 deps = [
282 ":jacobian",
283 "//aos/testing:googletest",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700284 "@org_tuxfamily_eigen//:eigen",
Austin Schuha647d602018-02-18 14:05:15 -0800285 ],
286)
287
James Kuszmaul59a5c612019-01-22 07:56:08 -0800288cc_test(
289 name = "c2d_test",
290 srcs = [
291 "c2d_test.cc",
292 ],
293 visibility = ["//visibility:public"],
294 deps = [
295 ":c2d",
296 ":runge_kutta",
297 "//aos/testing:googletest",
298 ],
299)
300
Austin Schuh03785132018-02-19 18:29:06 -0800301cc_library(
Austin Schuh9b881ae2019-01-04 07:29:20 +1100302 name = "c2d",
303 hdrs = [
304 "c2d.h",
305 ],
306 visibility = ["//visibility:public"],
307 deps = [
James Kuszmaul651fc3f2019-05-15 21:14:25 -0700308 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700309 "@org_tuxfamily_eigen//:eigen",
Austin Schuh9b881ae2019-01-04 07:29:20 +1100310 ],
311)
312
313cc_library(
Austin Schuh03785132018-02-19 18:29:06 -0800314 name = "dlqr",
315 hdrs = [
316 "dlqr.h",
317 ],
318 visibility = ["//visibility:public"],
319 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700320 "@org_tuxfamily_eigen//:eigen",
Austin Schuh03785132018-02-19 18:29:06 -0800321 "@slycot_repo//:slicot",
322 ],
323)
Brian Silverman6470f442018-08-05 12:08:16 -0700324
325py_library(
326 name = "python_init",
327 srcs = ["__init__.py"],
328 visibility = ["//visibility:public"],
329 deps = ["//frc971:python_init"],
330)
Austin Schuhe6e7ea52019-01-13 17:26:36 -0800331
332cc_library(
333 name = "binomial",
334 hdrs = ["binomial.h"],
335)
336
337cc_test(
338 name = "binomial_test",
339 srcs = [
340 "binomial_test.cc",
341 ],
342 deps = [
343 ":binomial",
344 "//aos/testing:googletest",
345 ],
346)
Tyler Chatow12581562019-01-26 20:42:42 -0800347
348cc_library(
349 name = "capped_test_plant",
350 testonly = True,
351 srcs = [
352 "capped_test_plant.cc",
353 ],
354 hdrs = [
355 "capped_test_plant.h",
356 ],
357 deps = [
358 ":state_feedback_loop",
359 "//aos/testing:googletest",
360 ],
361)
362
363cc_library(
364 name = "static_zeroing_single_dof_profiled_subsystem",
Tyler Chatow12581562019-01-26 20:42:42 -0800365 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
Alex Perrycb7da4b2019-08-28 19:35:56 -0700402flatbuffer_cc_library(
403 name = "static_zeroing_single_dof_profiled_subsystem_test_fbs",
404 srcs = [
405 "static_zeroing_single_dof_profiled_subsystem_test.fbs",
406 ],
407 includes = [
408 ":control_loops_fbs_includes",
409 ":profiled_subsystem_fbs_includes",
410 ],
411)
412
Tyler Chatow12581562019-01-26 20:42:42 -0800413cc_test(
414 name = "static_zeroing_single_dof_profiled_subsystem_test",
415 srcs = [
416 "static_zeroing_single_dof_profiled_subsystem_test.cc",
417 ],
418 deps = [
419 ":capped_test_plant",
420 ":position_sensor_sim",
421 ":static_zeroing_single_dof_profiled_subsystem",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700422 ":static_zeroing_single_dof_profiled_subsystem_test_fbs",
Tyler Chatow12581562019-01-26 20:42:42 -0800423 ":static_zeroing_single_dof_profiled_subsystem_test_plants",
424 "//aos/controls:control_loop_test",
425 "//aos/testing:googletest",
426 ],
427)