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