Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 2 | |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 3 | load("//aos/build:queues.bzl", "queue_library") |
| 4 | load("//tools:environments.bzl", "mcu_cpus") |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 5 | load("//tools/build_rules:select.bzl", "cpu_select", "compiler_select") |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 6 | |
| 7 | cc_binary( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 8 | name = "replay_drivetrain", |
| 9 | srcs = [ |
| 10 | "replay_drivetrain.cc", |
| 11 | ], |
| 12 | deps = [ |
| 13 | ":drivetrain_queue", |
John Park | 398c74a | 2018-10-20 21:17:39 -0700 | [diff] [blame] | 14 | "//aos:init", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 15 | "//aos/controls:replay_control_loop", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 16 | "//frc971/queues:gyro", |
| 17 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 18 | ) |
| 19 | |
| 20 | queue_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 21 | name = "drivetrain_queue", |
| 22 | srcs = [ |
| 23 | "drivetrain.q", |
| 24 | ], |
| 25 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 26 | "//aos/controls:control_loop_queues", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 27 | "//frc971/control_loops:queues", |
| 28 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 29 | ) |
| 30 | |
| 31 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 32 | name = "drivetrain_config", |
| 33 | hdrs = [ |
| 34 | "drivetrain_config.h", |
| 35 | ], |
| 36 | deps = [ |
| 37 | "//frc971:shifter_hall_effect", |
Austin Schuh | a062edb | 2019-01-03 13:17:13 -0800 | [diff] [blame] | 38 | "//frc971/control_loops:hybrid_state_feedback_loop", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 39 | "//frc971/control_loops:state_feedback_loop", |
| 40 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 41 | ) |
| 42 | |
| 43 | cc_library( |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 44 | name = "hybrid_ekf", |
| 45 | hdrs = ["hybrid_ekf.h"], |
| 46 | deps = [ |
| 47 | ":drivetrain_config", |
| 48 | "//aos/containers:priority_queue", |
James Kuszmaul | fedc461 | 2019-03-10 11:24:51 -0700 | [diff] [blame] | 49 | "//aos/util:math", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 50 | "//frc971/control_loops:c2d", |
| 51 | "//frc971/control_loops:runge_kutta", |
| 52 | "//third_party/eigen", |
| 53 | ], |
| 54 | ) |
| 55 | |
| 56 | cc_test( |
| 57 | name = "hybrid_ekf_test", |
| 58 | srcs = ["hybrid_ekf_test.cc"], |
| 59 | deps = [ |
| 60 | ":drivetrain_test_lib", |
| 61 | ":hybrid_ekf", |
| 62 | ":trajectory", |
| 63 | "//aos/testing:googletest", |
| 64 | "//aos/testing:random_seed", |
| 65 | "//aos/testing:test_shm", |
| 66 | ], |
| 67 | ) |
| 68 | |
James Kuszmaul | ef428a0 | 2019-03-02 22:19:41 -0800 | [diff] [blame] | 69 | queue_library( |
| 70 | name = "localizer_queue", |
| 71 | srcs = [ |
| 72 | "localizer.q", |
| 73 | ], |
| 74 | ) |
| 75 | |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 76 | cc_library( |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 77 | name = "localizer", |
| 78 | hdrs = ["localizer.h"], |
| 79 | deps = [ |
| 80 | ":drivetrain_config", |
| 81 | ":hybrid_ekf", |
James Kuszmaul | 5bc6fc9 | 2019-03-01 21:50:06 -0800 | [diff] [blame] | 82 | "//frc971/control_loops:pose", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 83 | ], |
| 84 | ) |
| 85 | |
| 86 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 87 | name = "gear", |
| 88 | hdrs = [ |
| 89 | "gear.h", |
| 90 | ], |
| 91 | compatible_with = mcu_cpus, |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 92 | ) |
| 93 | |
| 94 | cc_library( |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 95 | name = "splinedrivetrain", |
| 96 | srcs = [ |
| 97 | "splinedrivetrain.cc", |
| 98 | ], |
| 99 | hdrs = [ |
| 100 | "splinedrivetrain.h", |
| 101 | ], |
| 102 | deps = [ |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 103 | ":distance_spline", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 104 | ":drivetrain_config", |
| 105 | ":drivetrain_queue", |
| 106 | ":spline", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 107 | ":trajectory", |
Alex Perry | 1ec3452 | 2019-02-17 22:44:10 -0800 | [diff] [blame] | 108 | "//aos:init", |
James Kuszmaul | c73bb22 | 2019-04-07 12:15:35 -0700 | [diff] [blame] | 109 | "//aos/util:math", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 110 | ], |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 111 | ) |
| 112 | |
| 113 | cc_library( |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 114 | name = "line_follow_drivetrain", |
| 115 | srcs = [ |
| 116 | "line_follow_drivetrain.cc", |
| 117 | ], |
| 118 | hdrs = [ |
| 119 | "line_follow_drivetrain.h", |
| 120 | ], |
| 121 | deps = [ |
| 122 | ":drivetrain_config", |
| 123 | ":drivetrain_queue", |
James Kuszmaul | 5bc6fc9 | 2019-03-01 21:50:06 -0800 | [diff] [blame] | 124 | ":localizer", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 125 | "//aos:math", |
| 126 | "//aos/util:math", |
| 127 | "//frc971/control_loops:c2d", |
| 128 | "//frc971/control_loops:dlqr", |
| 129 | "//frc971/control_loops:pose", |
| 130 | "//third_party/eigen", |
| 131 | ], |
| 132 | ) |
| 133 | |
| 134 | cc_test( |
| 135 | name = "line_follow_drivetrain_test", |
| 136 | srcs = ["line_follow_drivetrain_test.cc"], |
| 137 | linkstatic = True, |
| 138 | restricted_to = ["//tools:k8"], |
| 139 | deps = [ |
| 140 | ":drivetrain_config", |
| 141 | ":drivetrain_test_lib", |
| 142 | ":line_follow_drivetrain", |
| 143 | ":trajectory", |
| 144 | "//aos/testing:googletest", |
| 145 | "//aos/testing:test_shm", |
| 146 | "//third_party/matplotlib-cpp", |
| 147 | "@com_github_gflags_gflags//:gflags", |
| 148 | ], |
| 149 | ) |
| 150 | |
| 151 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 152 | name = "ssdrivetrain", |
| 153 | srcs = [ |
| 154 | "ssdrivetrain.cc", |
| 155 | ], |
| 156 | hdrs = [ |
| 157 | "ssdrivetrain.h", |
| 158 | ], |
| 159 | deps = [ |
| 160 | ":drivetrain_config", |
| 161 | ":drivetrain_queue", |
| 162 | ":gear", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 163 | ":localizer", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 164 | "//aos:math", |
| 165 | "//aos/controls:control_loop", |
| 166 | "//aos/controls:polytope", |
| 167 | "//aos/logging:matrix_logging", |
| 168 | "//aos/logging:queue_logging", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 169 | "//aos/robot_state", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 170 | "//aos/util:log_interval", |
| 171 | "//aos/util:trapezoid_profile", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 172 | "//frc971:shifter_hall_effect", |
| 173 | "//frc971/control_loops:coerce_goal", |
| 174 | "//frc971/control_loops:state_feedback_loop", |
| 175 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 176 | ) |
| 177 | |
| 178 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 179 | name = "polydrivetrain", |
| 180 | srcs = [ |
| 181 | "polydrivetrain.cc", |
| 182 | ], |
| 183 | hdrs = [ |
| 184 | "polydrivetrain.h", |
| 185 | ], |
| 186 | deps = [ |
| 187 | ":drivetrain_config", |
| 188 | ":drivetrain_queue", |
| 189 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 190 | "//aos:math", |
| 191 | "//aos/controls:polytope", |
| 192 | "//aos/logging:matrix_logging", |
| 193 | "//aos/logging:queue_logging", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 194 | "//aos/robot_state", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 195 | "//aos/util:log_interval", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 196 | "//frc971/control_loops:coerce_goal", |
| 197 | "//frc971/control_loops:state_feedback_loop", |
| 198 | ], |
| 199 | ) |
| 200 | |
| 201 | cc_library( |
| 202 | name = "drivetrain_config_uc", |
| 203 | hdrs = [ |
| 204 | "drivetrain_config.h", |
| 205 | ], |
| 206 | restricted_to = mcu_cpus, |
| 207 | deps = [ |
| 208 | "//frc971:shifter_hall_effect", |
| 209 | "//frc971/control_loops:state_feedback_loop_uc", |
| 210 | ], |
| 211 | ) |
| 212 | |
| 213 | cc_library( |
| 214 | name = "polydrivetrain_uc", |
| 215 | srcs = [ |
| 216 | "drivetrain_uc.q.cc", |
| 217 | "polydrivetrain.cc", |
| 218 | ], |
| 219 | hdrs = [ |
| 220 | "drivetrain_uc.q.h", |
| 221 | "polydrivetrain.h", |
| 222 | ], |
| 223 | restricted_to = mcu_cpus, |
| 224 | deps = [ |
| 225 | ":drivetrain_config_uc", |
| 226 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 227 | "//aos:math", |
| 228 | "//aos/controls:polytope_uc", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 229 | "//frc971/control_loops:coerce_goal_uc", |
| 230 | "//frc971/control_loops:state_feedback_loop_uc", |
| 231 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 232 | ) |
| 233 | |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 234 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 235 | name = "genrule_down_estimator", |
| 236 | outs = [ |
| 237 | "down_estimator.h", |
| 238 | "down_estimator.cc", |
| 239 | ], |
| 240 | cmd = "$(location //frc971/control_loops/python:down_estimator) $(OUTS)", |
| 241 | tools = [ |
| 242 | "//frc971/control_loops/python:down_estimator", |
| 243 | ], |
| 244 | visibility = ["//visibility:private"], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 245 | ) |
| 246 | |
| 247 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 248 | name = "down_estimator", |
| 249 | srcs = [ |
| 250 | "down_estimator.cc", |
| 251 | ], |
| 252 | hdrs = [ |
| 253 | "down_estimator.h", |
| 254 | ], |
| 255 | deps = [ |
| 256 | "//frc971/control_loops:state_feedback_loop", |
| 257 | ], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 258 | ) |
| 259 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 260 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 261 | name = "drivetrain_lib", |
| 262 | srcs = [ |
| 263 | "drivetrain.cc", |
| 264 | ], |
| 265 | hdrs = [ |
| 266 | "drivetrain.h", |
| 267 | ], |
| 268 | deps = [ |
| 269 | ":down_estimator", |
| 270 | ":drivetrain_queue", |
| 271 | ":gear", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 272 | ":line_follow_drivetrain", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 273 | ":localizer", |
James Kuszmaul | ef428a0 | 2019-03-02 22:19:41 -0800 | [diff] [blame] | 274 | ":localizer_queue", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 275 | ":polydrivetrain", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 276 | ":splinedrivetrain", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 277 | ":ssdrivetrain", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 278 | "//aos/controls:control_loop", |
| 279 | "//aos/logging:matrix_logging", |
| 280 | "//aos/logging:queue_logging", |
| 281 | "//aos/util:log_interval", |
Austin Schuh | 3a37846 | 2019-01-04 21:48:04 -0800 | [diff] [blame] | 282 | "//frc971/control_loops:runge_kutta", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 283 | "//frc971/queues:gyro", |
| 284 | "//frc971/wpilib:imu_queue", |
| 285 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 286 | ) |
| 287 | |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 288 | cc_library( |
| 289 | name = "drivetrain_test_lib", |
| 290 | testonly = True, |
| 291 | srcs = ["drivetrain_test_lib.cc"], |
| 292 | hdrs = ["drivetrain_test_lib.h"], |
| 293 | deps = [ |
| 294 | ":drivetrain_config", |
| 295 | ":drivetrain_queue", |
| 296 | ":trajectory", |
Austin Schuh | df6cbb1 | 2019-02-02 13:46:52 -0800 | [diff] [blame] | 297 | "//aos/events:event-loop", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 298 | "//aos/testing:googletest", |
| 299 | "//frc971/control_loops:state_feedback_loop", |
| 300 | "//frc971/queues:gyro", |
| 301 | "//y2016:constants", |
| 302 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
| 303 | ], |
| 304 | ) |
| 305 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 306 | cc_test( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 307 | name = "drivetrain_lib_test", |
| 308 | srcs = [ |
| 309 | "drivetrain_lib_test.cc", |
| 310 | ], |
Alex Perry | 04300d6 | 2019-02-17 14:37:04 -0800 | [diff] [blame] | 311 | defines = |
| 312 | cpu_select({ |
| 313 | "amd64": [ |
| 314 | "SUPPORT_PLOT=1", |
| 315 | ], |
| 316 | "arm": [], |
| 317 | }), |
| 318 | linkstatic = True, |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 319 | deps = [ |
| 320 | ":drivetrain_config", |
| 321 | ":drivetrain_lib", |
James Kuszmaul | ef428a0 | 2019-03-02 22:19:41 -0800 | [diff] [blame] | 322 | ":localizer_queue", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 323 | ":drivetrain_queue", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 324 | ":drivetrain_test_lib", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 325 | "//aos:queues", |
| 326 | "//aos/controls:control_loop_test", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 327 | "//aos/testing:googletest", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 328 | "//frc971/queues:gyro", |
Alex Perry | 04300d6 | 2019-02-17 14:37:04 -0800 | [diff] [blame] | 329 | ] + cpu_select({ |
| 330 | "amd64": [ |
| 331 | "//third_party/matplotlib-cpp", |
| 332 | ], |
| 333 | "arm": [], |
| 334 | }), |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 335 | ) |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 336 | |
| 337 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 338 | name = "genrule_haptic_wheel", |
| 339 | outs = [ |
| 340 | "haptic_wheel.h", |
| 341 | "haptic_wheel.cc", |
| 342 | "integral_haptic_wheel.h", |
| 343 | "integral_haptic_wheel.cc", |
| 344 | "haptic_trigger.h", |
| 345 | "haptic_trigger.cc", |
| 346 | "integral_haptic_trigger.h", |
| 347 | "integral_haptic_trigger.cc", |
| 348 | ], |
| 349 | cmd = "$(location //frc971/control_loops/python:haptic_wheel) $(OUTS)", |
| 350 | compatible_with = mcu_cpus, |
| 351 | tools = [ |
| 352 | "//frc971/control_loops/python:haptic_wheel", |
| 353 | ], |
| 354 | visibility = ["//visibility:private"], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 355 | ) |
| 356 | |
| 357 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 358 | name = "haptic_input_uc", |
| 359 | srcs = [ |
| 360 | "haptic_trigger.cc", |
| 361 | "haptic_wheel.cc", |
| 362 | "integral_haptic_trigger.cc", |
| 363 | "integral_haptic_wheel.cc", |
| 364 | ], |
| 365 | hdrs = [ |
| 366 | "haptic_trigger.h", |
| 367 | "haptic_wheel.h", |
| 368 | "integral_haptic_trigger.h", |
| 369 | "integral_haptic_wheel.h", |
| 370 | ], |
| 371 | restricted_to = mcu_cpus, |
| 372 | deps = [ |
| 373 | "//frc971/control_loops:state_feedback_loop_uc", |
| 374 | ], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 375 | ) |
| 376 | |
| 377 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 378 | name = "haptic_wheel", |
| 379 | srcs = [ |
| 380 | "haptic_trigger.cc", |
| 381 | "haptic_wheel.cc", |
| 382 | "integral_haptic_trigger.cc", |
| 383 | "integral_haptic_wheel.cc", |
| 384 | ], |
| 385 | hdrs = [ |
| 386 | "haptic_trigger.h", |
| 387 | "haptic_wheel.h", |
| 388 | "integral_haptic_trigger.h", |
| 389 | "integral_haptic_wheel.h", |
| 390 | ], |
| 391 | deps = [ |
| 392 | "//frc971/control_loops:state_feedback_loop", |
| 393 | ], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 394 | ) |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 395 | |
| 396 | cc_library( |
| 397 | name = "spline", |
| 398 | srcs = ["spline.cc"], |
| 399 | hdrs = ["spline.h"], |
| 400 | deps = [ |
Austin Schuh | f49b4e3 | 2019-01-13 17:26:58 -0800 | [diff] [blame] | 401 | "//frc971/control_loops:binomial", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 402 | "//third_party/eigen", |
| 403 | ], |
| 404 | ) |
| 405 | |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 406 | cc_binary( |
| 407 | name = "spline.so", |
| 408 | srcs = ["libspline.cc"], |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 409 | linkshared = True, |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 410 | deps = [ |
| 411 | ":distance_spline", |
| 412 | ":spline", |
Alex Perry | 0603b54 | 2019-01-25 20:29:51 -0800 | [diff] [blame] | 413 | ":trajectory", |
| 414 | "//aos/logging:implementations", |
| 415 | "//aos/network:team_number", |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 416 | "//third_party/eigen", |
Alex Perry | 0603b54 | 2019-01-25 20:29:51 -0800 | [diff] [blame] | 417 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 418 | ], |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 419 | ) |
| 420 | |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 421 | cc_test( |
| 422 | name = "spline_test", |
| 423 | srcs = [ |
| 424 | "spline_test.cc", |
| 425 | ], |
| 426 | restricted_to = ["//tools:k8"], |
| 427 | deps = [ |
| 428 | ":spline", |
| 429 | "//aos/testing:googletest", |
| 430 | "//third_party/matplotlib-cpp", |
| 431 | "@com_github_gflags_gflags//:gflags", |
| 432 | ], |
| 433 | ) |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 434 | |
| 435 | cc_library( |
| 436 | name = "distance_spline", |
| 437 | srcs = ["distance_spline.cc"], |
| 438 | hdrs = ["distance_spline.h"], |
| 439 | deps = [ |
| 440 | ":spline", |
Austin Schuh | a6e7b21 | 2019-01-20 13:53:01 -0800 | [diff] [blame] | 441 | "//aos/logging", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 442 | "//frc971/control_loops:fixed_quadrature", |
| 443 | "//third_party/eigen", |
| 444 | ], |
| 445 | ) |
| 446 | |
| 447 | cc_test( |
| 448 | name = "distance_spline_test", |
| 449 | srcs = [ |
| 450 | "distance_spline_test.cc", |
| 451 | ], |
Austin Schuh | 9b0b643 | 2019-01-13 21:15:17 -0800 | [diff] [blame] | 452 | defines = |
| 453 | cpu_select({ |
| 454 | "amd64": [ |
| 455 | "SUPPORT_PLOT=1", |
| 456 | ], |
| 457 | "arm": [], |
| 458 | }), |
| 459 | linkstatic = True, |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 460 | deps = [ |
| 461 | ":distance_spline", |
| 462 | "//aos/testing:googletest", |
Austin Schuh | a6e7b21 | 2019-01-20 13:53:01 -0800 | [diff] [blame] | 463 | "//aos/testing:test_shm", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 464 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | 9b0b643 | 2019-01-13 21:15:17 -0800 | [diff] [blame] | 465 | ] + cpu_select({ |
| 466 | "amd64": [ |
| 467 | "//third_party/matplotlib-cpp", |
| 468 | ], |
| 469 | "arm": [], |
| 470 | }), |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 471 | ) |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 472 | |
| 473 | cc_library( |
| 474 | name = "trajectory", |
| 475 | srcs = ["trajectory.cc"], |
| 476 | hdrs = ["trajectory.h"], |
| 477 | deps = [ |
| 478 | ":distance_spline", |
| 479 | ":drivetrain_config", |
| 480 | "//aos/logging:matrix_logging", |
| 481 | "//frc971/control_loops:c2d", |
| 482 | "//frc971/control_loops:dlqr", |
| 483 | "//frc971/control_loops:hybrid_state_feedback_loop", |
| 484 | "//frc971/control_loops:runge_kutta", |
| 485 | "//frc971/control_loops:state_feedback_loop", |
| 486 | "//third_party/eigen", |
| 487 | ], |
| 488 | ) |
| 489 | |
| 490 | cc_binary( |
| 491 | name = "trajectory_plot", |
| 492 | srcs = [ |
| 493 | "trajectory_plot.cc", |
| 494 | ], |
| 495 | restricted_to = ["//tools:k8"], |
| 496 | deps = [ |
| 497 | ":distance_spline", |
| 498 | ":trajectory", |
| 499 | "//aos/logging:implementations", |
| 500 | "//aos/logging:matrix_logging", |
| 501 | "//aos/network:team_number", |
| 502 | "//third_party/eigen", |
| 503 | "//third_party/matplotlib-cpp", |
Austin Schuh | 1104318 | 2019-03-23 22:29:12 -0700 | [diff] [blame] | 504 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 505 | "@com_github_gflags_gflags//:gflags", |
| 506 | ], |
| 507 | ) |
| 508 | |
| 509 | cc_test( |
| 510 | name = "trajectory_test", |
| 511 | srcs = [ |
| 512 | "trajectory_test.cc", |
| 513 | ], |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 514 | defines = |
| 515 | cpu_select({ |
| 516 | "amd64": [ |
| 517 | "SUPPORT_PLOT=1", |
| 518 | ], |
| 519 | "arm": [], |
| 520 | }), |
| 521 | linkstatic = True, |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 522 | deps = [ |
| 523 | ":trajectory", |
| 524 | "//aos/testing:googletest", |
| 525 | "//aos/testing:test_shm", |
| 526 | "//y2016:constants", |
| 527 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 528 | ] + cpu_select({ |
| 529 | "amd64": [ |
| 530 | "//third_party/matplotlib-cpp", |
| 531 | ], |
| 532 | "arm": [], |
| 533 | }), |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 534 | ) |