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