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