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