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