Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 1 | load("//aos:config.bzl", "aos_config") |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 2 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library") |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 3 | |
Philipp Schrader | cc016b3 | 2021-12-30 08:59:58 -0800 | [diff] [blame] | 4 | package(default_visibility = ["//visibility:public"]) |
| 5 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 6 | cc_library( |
James Kuszmaul | 6175066 | 2021-06-21 21:32:33 -0700 | [diff] [blame] | 7 | name = "control_loop_test", |
| 8 | testonly = True, |
| 9 | srcs = [ |
| 10 | "control_loop_test.cc", |
| 11 | ], |
| 12 | hdrs = [ |
| 13 | "control_loop_test.h", |
| 14 | ], |
| 15 | target_compatible_with = ["@platforms//os:linux"], |
| 16 | deps = [ |
| 17 | "//aos:flatbuffers", |
| 18 | "//aos:json_to_flatbuffer", |
| 19 | "//aos/events:simulated_event_loop", |
| 20 | "//aos/testing:googletest", |
| 21 | "//aos/testing:test_logging", |
| 22 | "//aos/time", |
| 23 | "//frc971/input:joystick_state_fbs", |
| 24 | "//frc971/input:robot_state_fbs", |
| 25 | ], |
| 26 | ) |
| 27 | |
| 28 | cc_library( |
| 29 | name = "polytope", |
| 30 | hdrs = [ |
| 31 | "polytope.h", |
| 32 | ], |
| 33 | deps = [ |
| 34 | "@org_tuxfamily_eigen//:eigen", |
| 35 | ] + select({ |
| 36 | "@platforms//os:linux": [ |
| 37 | "//aos/logging", |
| 38 | "//third_party/cddlib", |
| 39 | "@com_github_google_glog//:glog", |
| 40 | ], |
| 41 | "//conditions:default": [], |
| 42 | }), |
| 43 | ) |
| 44 | |
| 45 | cc_test( |
| 46 | name = "polytope_test", |
| 47 | srcs = [ |
| 48 | "polytope_test.cc", |
| 49 | ], |
| 50 | target_compatible_with = ["@platforms//os:linux"], |
| 51 | deps = [ |
| 52 | ":polytope", |
| 53 | "//aos/testing:googletest", |
| 54 | "//aos/testing:test_logging", |
| 55 | "@org_tuxfamily_eigen//:eigen", |
| 56 | ], |
| 57 | ) |
| 58 | |
| 59 | cc_library( |
| 60 | name = "control_loop", |
| 61 | srcs = [ |
| 62 | "control_loop.cc", |
| 63 | "control_loop-tmpl.h", |
| 64 | ], |
| 65 | hdrs = [ |
| 66 | "control_loop.h", |
| 67 | ], |
| 68 | target_compatible_with = ["@platforms//os:linux"], |
| 69 | deps = [ |
| 70 | "//aos/events:event_loop", |
| 71 | "//aos/events:shm_event_loop", |
| 72 | "//aos/logging", |
| 73 | "//aos/time", |
| 74 | "//aos/util:log_interval", |
| 75 | "//frc971/input:joystick_state_fbs", |
| 76 | "//frc971/input:robot_state_fbs", |
| 77 | ], |
| 78 | ) |
| 79 | |
| 80 | cc_library( |
| 81 | name = "quaternion_utils", |
| 82 | srcs = [ |
| 83 | "quaternion_utils.cc", |
| 84 | ], |
| 85 | hdrs = [ |
| 86 | "quaternion_utils.h", |
| 87 | ], |
| 88 | target_compatible_with = ["@platforms//os:linux"], |
| 89 | deps = [ |
| 90 | "@com_github_google_glog//:glog", |
| 91 | "@org_tuxfamily_eigen//:eigen", |
| 92 | ], |
| 93 | ) |
| 94 | |
| 95 | cc_test( |
| 96 | name = "quarternion_utils_test", |
| 97 | srcs = [ |
| 98 | "quaternion_utils_test.cc", |
| 99 | ], |
| 100 | target_compatible_with = ["@platforms//os:linux"], |
| 101 | deps = [ |
milind-u | e53bf55 | 2021-12-11 14:42:00 -0800 | [diff] [blame] | 102 | ":jacobian", |
James Kuszmaul | 6175066 | 2021-06-21 21:32:33 -0700 | [diff] [blame] | 103 | ":quaternion_utils", |
milind-u | e53bf55 | 2021-12-11 14:42:00 -0800 | [diff] [blame] | 104 | ":runge_kutta", |
James Kuszmaul | 6175066 | 2021-06-21 21:32:33 -0700 | [diff] [blame] | 105 | "//aos/testing:googletest", |
| 106 | "//aos/testing:random_seed", |
| 107 | "@com_github_google_glog//:glog", |
| 108 | "@org_tuxfamily_eigen//:eigen", |
| 109 | ], |
| 110 | ) |
| 111 | |
| 112 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 113 | name = "team_number_test_environment", |
| 114 | testonly = True, |
| 115 | srcs = [ |
| 116 | "team_number_test_environment.cc", |
| 117 | ], |
| 118 | hdrs = [ |
| 119 | "team_number_test_environment.h", |
| 120 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 121 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 122 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 123 | "//aos/network:team_number", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 124 | "//aos/testing:googletest", |
| 125 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 126 | ) |
| 127 | |
| 128 | cc_test( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 129 | name = "hybrid_state_feedback_loop_test", |
| 130 | srcs = [ |
| 131 | "hybrid_state_feedback_loop_test.cc", |
| 132 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 133 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 134 | deps = [ |
| 135 | ":hybrid_state_feedback_loop", |
| 136 | "//aos/testing:googletest", |
| 137 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 138 | ) |
| 139 | |
| 140 | cc_library( |
James Kuszmaul | 9f9676d | 2019-01-25 21:27:58 -0800 | [diff] [blame] | 141 | name = "pose", |
| 142 | hdrs = ["pose.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 143 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 9f9676d | 2019-01-25 21:27:58 -0800 | [diff] [blame] | 144 | deps = [ |
| 145 | "//aos/util:math", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 146 | "@org_tuxfamily_eigen//:eigen", |
James Kuszmaul | 9f9676d | 2019-01-25 21:27:58 -0800 | [diff] [blame] | 147 | ], |
| 148 | ) |
| 149 | |
| 150 | cc_test( |
| 151 | name = "pose_test", |
| 152 | srcs = ["pose_test.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 153 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 9f9676d | 2019-01-25 21:27:58 -0800 | [diff] [blame] | 154 | deps = [ |
| 155 | ":pose", |
| 156 | "//aos/testing:googletest", |
| 157 | ], |
| 158 | ) |
| 159 | |
| 160 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 161 | name = "hall_effect_tracker", |
| 162 | hdrs = [ |
| 163 | "hall_effect_tracker.h", |
| 164 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 165 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 166 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 167 | ":control_loops_fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 168 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 169 | ) |
| 170 | |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 171 | flatbuffer_ts_library( |
| 172 | name = "control_loops_ts_fbs", |
| 173 | srcs = [ |
| 174 | "control_loops.fbs", |
| 175 | ], |
| 176 | ) |
| 177 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 178 | flatbuffer_cc_library( |
| 179 | name = "control_loops_fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 180 | srcs = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 181 | "control_loops.fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 182 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 183 | ) |
| 184 | |
| 185 | cc_test( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 186 | name = "position_sensor_sim_test", |
| 187 | srcs = [ |
| 188 | "position_sensor_sim_test.cc", |
| 189 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 190 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 191 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 192 | ":control_loops_fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 193 | ":position_sensor_sim", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 194 | "//aos/logging", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 195 | "//aos/testing:googletest", |
| 196 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 197 | ) |
| 198 | |
| 199 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 200 | name = "position_sensor_sim", |
| 201 | testonly = True, |
| 202 | srcs = [ |
| 203 | "position_sensor_sim.cc", |
| 204 | ], |
| 205 | hdrs = [ |
| 206 | "position_sensor_sim.h", |
| 207 | ], |
Brian Silverman | 6470f44 | 2018-08-05 12:08:16 -0700 | [diff] [blame] | 208 | linkopts = [ |
| 209 | "-lm", |
| 210 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 211 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 212 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 213 | ":control_loops_fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 214 | ":gaussian_noise", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 215 | "//aos/testing:random_seed", |
Philipp Schrader | b3a057e | 2018-03-10 18:59:40 -0800 | [diff] [blame] | 216 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 217 | ) |
| 218 | |
| 219 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 220 | name = "gaussian_noise", |
| 221 | srcs = [ |
| 222 | "gaussian_noise.cc", |
| 223 | ], |
| 224 | hdrs = [ |
| 225 | "gaussian_noise.h", |
| 226 | ], |
Philipp Schrader | b3a057e | 2018-03-10 18:59:40 -0800 | [diff] [blame] | 227 | linkopts = [ |
| 228 | "-lm", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 229 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 230 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 231 | ) |
| 232 | |
| 233 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 234 | name = "coerce_goal", |
| 235 | srcs = [ |
| 236 | "coerce_goal.cc", |
| 237 | ], |
| 238 | hdrs = [ |
| 239 | "coerce_goal.h", |
| 240 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 241 | linkopts = select({ |
| 242 | "@platforms//os:linux": ["-lm"], |
| 243 | "//conditions:default": [], |
| 244 | }), |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 245 | deps = [ |
James Kuszmaul | 6175066 | 2021-06-21 21:32:33 -0700 | [diff] [blame] | 246 | "//frc971/control_loops:polytope", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 247 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 248 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 249 | ) |
| 250 | |
Lee Mracek | 6568614 | 2020-01-10 22:21:39 -0500 | [diff] [blame] | 251 | cc_test( |
| 252 | name = "coerce_goal_test", |
| 253 | srcs = [ |
| 254 | "coerce_goal_test.cc", |
| 255 | ], |
| 256 | linkopts = [ |
| 257 | "-lm", |
| 258 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 259 | target_compatible_with = ["@platforms//os:linux"], |
Lee Mracek | 6568614 | 2020-01-10 22:21:39 -0500 | [diff] [blame] | 260 | deps = [ |
| 261 | ":coerce_goal", |
Lee Mracek | 6568614 | 2020-01-10 22:21:39 -0500 | [diff] [blame] | 262 | "//aos/testing:googletest", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 263 | "//frc971/control_loops:polytope", |
Lee Mracek | 6568614 | 2020-01-10 22:21:39 -0500 | [diff] [blame] | 264 | "@org_tuxfamily_eigen//:eigen", |
| 265 | ], |
| 266 | ) |
| 267 | |
Austin Schuh | 4cc4fe2 | 2017-11-23 19:13:09 -0800 | [diff] [blame] | 268 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 269 | name = "state_feedback_loop", |
| 270 | hdrs = [ |
| 271 | "state_feedback_loop.h", |
| 272 | ], |
| 273 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 274 | "//aos:macros", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 275 | "@org_tuxfamily_eigen//:eigen", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 276 | ] + select({ |
| 277 | "@platforms//os:linux": ["//aos/logging"], |
| 278 | "//conditions:default": [], |
| 279 | }), |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 280 | ) |
Brian Silverman | 2b1957a | 2016-02-14 20:29:57 -0500 | [diff] [blame] | 281 | |
| 282 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 283 | name = "hybrid_state_feedback_loop", |
| 284 | hdrs = [ |
| 285 | "hybrid_state_feedback_loop.h", |
| 286 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 287 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 288 | deps = [ |
Austin Schuh | 9b881ae | 2019-01-04 07:29:20 +1100 | [diff] [blame] | 289 | ":c2d", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 290 | ":state_feedback_loop", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 291 | "//aos:macros", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 292 | "//aos/logging", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 293 | "//frc971/control_loops:control_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 294 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 295 | ], |
Brian Silverman | 2b1957a | 2016-02-14 20:29:57 -0500 | [diff] [blame] | 296 | ) |
Austin Schuh | acd335a | 2017-01-01 16:20:54 -0800 | [diff] [blame] | 297 | |
| 298 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 299 | name = "simple_capped_state_feedback_loop", |
| 300 | hdrs = [ |
| 301 | "simple_capped_state_feedback_loop.h", |
| 302 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 303 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 304 | deps = [ |
| 305 | ":state_feedback_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 306 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 307 | ], |
| 308 | ) |
| 309 | |
| 310 | cc_library( |
| 311 | name = "runge_kutta", |
| 312 | hdrs = [ |
| 313 | "runge_kutta.h", |
| 314 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 315 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 316 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 317 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 318 | ], |
Austin Schuh | acd335a | 2017-01-01 16:20:54 -0800 | [diff] [blame] | 319 | ) |
| 320 | |
| 321 | cc_test( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 322 | name = "runge_kutta_test", |
| 323 | srcs = [ |
| 324 | "runge_kutta_test.cc", |
| 325 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 326 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 327 | deps = [ |
| 328 | ":runge_kutta", |
| 329 | "//aos/testing:googletest", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 330 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 331 | ], |
Austin Schuh | acd335a | 2017-01-01 16:20:54 -0800 | [diff] [blame] | 332 | ) |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 333 | |
Austin Schuh | 173a159 | 2018-12-19 16:20:54 +1100 | [diff] [blame] | 334 | cc_library( |
| 335 | name = "fixed_quadrature", |
| 336 | hdrs = [ |
| 337 | "fixed_quadrature.h", |
| 338 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 339 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 173a159 | 2018-12-19 16:20:54 +1100 | [diff] [blame] | 340 | ) |
| 341 | |
| 342 | cc_test( |
| 343 | name = "fixed_quadrature_test", |
| 344 | srcs = [ |
| 345 | "fixed_quadrature_test.cc", |
| 346 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 347 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 173a159 | 2018-12-19 16:20:54 +1100 | [diff] [blame] | 348 | deps = [ |
| 349 | ":fixed_quadrature", |
| 350 | "//aos/testing:googletest", |
| 351 | ], |
| 352 | ) |
| 353 | |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 354 | flatbuffer_ts_library( |
| 355 | name = "profiled_subsystem_ts_fbs", |
| 356 | srcs = [ |
| 357 | "profiled_subsystem.fbs", |
| 358 | ], |
| 359 | deps = [ |
| 360 | ":control_loops_ts_fbs", |
| 361 | ], |
| 362 | ) |
| 363 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 364 | flatbuffer_cc_library( |
| 365 | name = "profiled_subsystem_fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 366 | srcs = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 367 | "profiled_subsystem.fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 368 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 369 | includes = [ |
| 370 | ":control_loops_fbs_includes", |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 371 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 372 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 373 | ) |
| 374 | |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 375 | cc_library( |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 376 | name = "profiled_subsystem", |
| 377 | srcs = [ |
| 378 | "profiled_subsystem.cc", |
| 379 | ], |
| 380 | hdrs = [ |
| 381 | "profiled_subsystem.h", |
| 382 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 383 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 384 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 385 | ":control_loops_fbs", |
| 386 | ":profiled_subsystem_fbs", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 387 | ":simple_capped_state_feedback_loop", |
| 388 | ":state_feedback_loop", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 389 | "//aos/util:trapezoid_profile", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 390 | "//frc971/control_loops:control_loop", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 391 | "//frc971/zeroing", |
| 392 | ], |
Austin Schuh | 473a565 | 2017-02-05 01:30:42 -0800 | [diff] [blame] | 393 | ) |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 394 | |
| 395 | cc_library( |
| 396 | name = "jacobian", |
| 397 | hdrs = [ |
| 398 | "jacobian.h", |
| 399 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 400 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 401 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 402 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 403 | ], |
| 404 | ) |
| 405 | |
| 406 | cc_test( |
| 407 | name = "jacobian_test", |
| 408 | srcs = [ |
| 409 | "jacobian_test.cc", |
| 410 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 411 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 412 | deps = [ |
| 413 | ":jacobian", |
| 414 | "//aos/testing:googletest", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 415 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | a647d60 | 2018-02-18 14:05:15 -0800 | [diff] [blame] | 416 | ], |
| 417 | ) |
| 418 | |
James Kuszmaul | 59a5c61 | 2019-01-22 07:56:08 -0800 | [diff] [blame] | 419 | cc_test( |
| 420 | name = "c2d_test", |
| 421 | srcs = [ |
| 422 | "c2d_test.cc", |
| 423 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 424 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 59a5c61 | 2019-01-22 07:56:08 -0800 | [diff] [blame] | 425 | visibility = ["//visibility:public"], |
| 426 | deps = [ |
| 427 | ":c2d", |
| 428 | ":runge_kutta", |
| 429 | "//aos/testing:googletest", |
| 430 | ], |
| 431 | ) |
| 432 | |
Austin Schuh | 0378513 | 2018-02-19 18:29:06 -0800 | [diff] [blame] | 433 | cc_library( |
Austin Schuh | 9b881ae | 2019-01-04 07:29:20 +1100 | [diff] [blame] | 434 | name = "c2d", |
| 435 | hdrs = [ |
| 436 | "c2d.h", |
| 437 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 438 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 9b881ae | 2019-01-04 07:29:20 +1100 | [diff] [blame] | 439 | visibility = ["//visibility:public"], |
| 440 | deps = [ |
James Kuszmaul | 651fc3f | 2019-05-15 21:14:25 -0700 | [diff] [blame] | 441 | "//aos/time", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 442 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | 9b881ae | 2019-01-04 07:29:20 +1100 | [diff] [blame] | 443 | ], |
| 444 | ) |
| 445 | |
| 446 | cc_library( |
Austin Schuh | 0378513 | 2018-02-19 18:29:06 -0800 | [diff] [blame] | 447 | name = "dlqr", |
| 448 | hdrs = [ |
| 449 | "dlqr.h", |
| 450 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 451 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 0378513 | 2018-02-19 18:29:06 -0800 | [diff] [blame] | 452 | visibility = ["//visibility:public"], |
| 453 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 454 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | 0378513 | 2018-02-19 18:29:06 -0800 | [diff] [blame] | 455 | "@slycot_repo//:slicot", |
| 456 | ], |
| 457 | ) |
Brian Silverman | 6470f44 | 2018-08-05 12:08:16 -0700 | [diff] [blame] | 458 | |
| 459 | py_library( |
| 460 | name = "python_init", |
| 461 | srcs = ["__init__.py"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 462 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 6470f44 | 2018-08-05 12:08:16 -0700 | [diff] [blame] | 463 | visibility = ["//visibility:public"], |
| 464 | deps = ["//frc971:python_init"], |
| 465 | ) |
Austin Schuh | e6e7ea5 | 2019-01-13 17:26:36 -0800 | [diff] [blame] | 466 | |
| 467 | cc_library( |
| 468 | name = "binomial", |
| 469 | hdrs = ["binomial.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 470 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e6e7ea5 | 2019-01-13 17:26:36 -0800 | [diff] [blame] | 471 | ) |
| 472 | |
| 473 | cc_test( |
| 474 | name = "binomial_test", |
| 475 | srcs = [ |
| 476 | "binomial_test.cc", |
| 477 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 478 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e6e7ea5 | 2019-01-13 17:26:36 -0800 | [diff] [blame] | 479 | deps = [ |
| 480 | ":binomial", |
| 481 | "//aos/testing:googletest", |
| 482 | ], |
| 483 | ) |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 484 | |
| 485 | cc_library( |
| 486 | name = "capped_test_plant", |
| 487 | testonly = True, |
| 488 | srcs = [ |
| 489 | "capped_test_plant.cc", |
| 490 | ], |
| 491 | hdrs = [ |
| 492 | "capped_test_plant.h", |
| 493 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 494 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 495 | deps = [ |
| 496 | ":state_feedback_loop", |
| 497 | "//aos/testing:googletest", |
| 498 | ], |
| 499 | ) |
| 500 | |
| 501 | cc_library( |
| 502 | name = "static_zeroing_single_dof_profiled_subsystem", |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 503 | hdrs = [ |
| 504 | "static_zeroing_single_dof_profiled_subsystem.h", |
| 505 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 506 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 507 | deps = [ |
| 508 | "//frc971/control_loops:profiled_subsystem", |
| 509 | ], |
| 510 | ) |
| 511 | |
| 512 | genrule( |
| 513 | name = "genrule_static_zeroing_single_dof_profiled_subsystem_test", |
| 514 | outs = [ |
| 515 | "static_zeroing_single_dof_profiled_subsystem_test_plant.h", |
| 516 | "static_zeroing_single_dof_profiled_subsystem_test_plant.cc", |
| 517 | "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h", |
| 518 | "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc", |
| 519 | ], |
| 520 | cmd = "$(location //frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test) $(OUTS)", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 521 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 522 | tools = [ |
| 523 | "//frc971/control_loops/python:static_zeroing_single_dof_profiled_subsystem_test", |
| 524 | ], |
| 525 | ) |
| 526 | |
| 527 | cc_library( |
| 528 | name = "static_zeroing_single_dof_profiled_subsystem_test_plants", |
| 529 | srcs = [ |
| 530 | "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.cc", |
| 531 | "static_zeroing_single_dof_profiled_subsystem_test_plant.cc", |
| 532 | ], |
| 533 | hdrs = [ |
| 534 | "static_zeroing_single_dof_profiled_subsystem_test_integral_plant.h", |
| 535 | "static_zeroing_single_dof_profiled_subsystem_test_plant.h", |
| 536 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 537 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 538 | deps = [ |
| 539 | ":state_feedback_loop", |
| 540 | ], |
| 541 | ) |
| 542 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 543 | flatbuffer_cc_library( |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 544 | name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 545 | srcs = [ |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 546 | "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 547 | ], |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 548 | gen_reflections = 1, |
| 549 | includes = [ |
| 550 | ":control_loops_fbs_includes", |
| 551 | ":profiled_subsystem_fbs_includes", |
| 552 | ], |
| 553 | target_compatible_with = ["@platforms//os:linux"], |
| 554 | ) |
| 555 | |
| 556 | flatbuffer_cc_library( |
| 557 | name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs", |
| 558 | srcs = [ |
| 559 | "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs", |
| 560 | ], |
| 561 | gen_reflections = 1, |
| 562 | target_compatible_with = ["@platforms//os:linux"], |
| 563 | ) |
| 564 | |
| 565 | flatbuffer_cc_library( |
| 566 | name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs", |
| 567 | srcs = [ |
| 568 | "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs", |
| 569 | ], |
| 570 | gen_reflections = 1, |
| 571 | includes = [ |
| 572 | ":control_loops_fbs_includes", |
| 573 | ], |
| 574 | target_compatible_with = ["@platforms//os:linux"], |
| 575 | ) |
| 576 | |
| 577 | flatbuffer_cc_library( |
| 578 | name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs", |
| 579 | srcs = [ |
| 580 | "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs", |
| 581 | ], |
| 582 | gen_reflections = 1, |
| 583 | includes = [ |
| 584 | ":control_loops_fbs_includes", |
| 585 | ], |
| 586 | target_compatible_with = ["@platforms//os:linux"], |
| 587 | ) |
| 588 | |
| 589 | flatbuffer_cc_library( |
| 590 | name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs", |
| 591 | srcs = [ |
| 592 | "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs", |
| 593 | ], |
| 594 | gen_reflections = 1, |
| 595 | includes = [ |
| 596 | ":control_loops_fbs_includes", |
| 597 | ":profiled_subsystem_fbs_includes", |
| 598 | ], |
| 599 | target_compatible_with = ["@platforms//os:linux"], |
| 600 | ) |
| 601 | |
| 602 | flatbuffer_cc_library( |
| 603 | name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs", |
| 604 | srcs = [ |
| 605 | "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs", |
| 606 | ], |
| 607 | gen_reflections = 1, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 608 | includes = [ |
| 609 | ":control_loops_fbs_includes", |
| 610 | ":profiled_subsystem_fbs_includes", |
| 611 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 612 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 613 | ) |
| 614 | |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 615 | cc_test( |
| 616 | name = "static_zeroing_single_dof_profiled_subsystem_test", |
| 617 | srcs = [ |
| 618 | "static_zeroing_single_dof_profiled_subsystem_test.cc", |
| 619 | ], |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 620 | data = [ |
| 621 | ":static_zeroing_single_dof_profiled_subsystem_test_config", |
| 622 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 623 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 624 | deps = [ |
| 625 | ":capped_test_plant", |
| 626 | ":position_sensor_sim", |
| 627 | ":static_zeroing_single_dof_profiled_subsystem", |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 628 | ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs", |
| 629 | ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs", |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 630 | ":static_zeroing_single_dof_profiled_subsystem_test_plants", |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 631 | ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs", |
| 632 | ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs", |
| 633 | ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs", |
| 634 | ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs", |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 635 | "//aos/testing:googletest", |
Austin Schuh | 0a3c9d4 | 2021-07-15 22:36:24 -0700 | [diff] [blame] | 636 | "//frc971/control_loops:control_loop_test", |
Tyler Chatow | 1258156 | 2019-01-26 20:42:42 -0800 | [diff] [blame] | 637 | ], |
| 638 | ) |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 639 | |
| 640 | aos_config( |
| 641 | name = "static_zeroing_single_dof_profiled_subsystem_test_config", |
| 642 | src = "static_zeroing_single_dof_profiled_subsystem_test_config_source.json", |
| 643 | flatbuffers = [ |
| 644 | "//frc971/input:joystick_state_fbs", |
| 645 | "//frc971/input:robot_state_fbs", |
| 646 | "//aos/logging:log_message_fbs", |
| 647 | "//aos/events:event_loop_fbs", |
| 648 | ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs", |
| 649 | ":static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs", |
| 650 | ":static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs", |
| 651 | ":static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs", |
| 652 | ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs", |
| 653 | ":static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs", |
| 654 | ], |
| 655 | target_compatible_with = ["@platforms//os:linux"], |
| 656 | ) |