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