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") |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 5 | |
| 6 | cc_binary( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 7 | name = "replay_drivetrain", |
| 8 | srcs = [ |
| 9 | "replay_drivetrain.cc", |
| 10 | ], |
| 11 | deps = [ |
| 12 | ":drivetrain_queue", |
John Park | 398c74a | 2018-10-20 21:17:39 -0700 | [diff] [blame] | 13 | "//aos:init", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 14 | "//aos/controls:replay_control_loop", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 15 | "//frc971/queues:gyro", |
| 16 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 17 | ) |
| 18 | |
| 19 | queue_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 20 | name = "drivetrain_queue", |
| 21 | srcs = [ |
| 22 | "drivetrain.q", |
| 23 | ], |
| 24 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 25 | "//aos/controls:control_loop_queues", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 26 | "//frc971/control_loops:queues", |
| 27 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 28 | ) |
| 29 | |
| 30 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 31 | name = "drivetrain_config", |
| 32 | hdrs = [ |
| 33 | "drivetrain_config.h", |
| 34 | ], |
| 35 | deps = [ |
| 36 | "//frc971:shifter_hall_effect", |
| 37 | "//frc971/control_loops:state_feedback_loop", |
| 38 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 39 | ) |
| 40 | |
| 41 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 42 | name = "gear", |
| 43 | hdrs = [ |
| 44 | "gear.h", |
| 45 | ], |
| 46 | compatible_with = mcu_cpus, |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 47 | ) |
| 48 | |
| 49 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 50 | name = "ssdrivetrain", |
| 51 | srcs = [ |
| 52 | "ssdrivetrain.cc", |
| 53 | ], |
| 54 | hdrs = [ |
| 55 | "ssdrivetrain.h", |
| 56 | ], |
| 57 | deps = [ |
| 58 | ":drivetrain_config", |
| 59 | ":drivetrain_queue", |
| 60 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 61 | "//aos:math", |
| 62 | "//aos/controls:control_loop", |
| 63 | "//aos/controls:polytope", |
| 64 | "//aos/logging:matrix_logging", |
| 65 | "//aos/logging:queue_logging", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 66 | "//aos/robot_state", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 67 | "//aos/util:log_interval", |
| 68 | "//aos/util:trapezoid_profile", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 69 | "//frc971:shifter_hall_effect", |
| 70 | "//frc971/control_loops:coerce_goal", |
| 71 | "//frc971/control_loops:state_feedback_loop", |
| 72 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 73 | ) |
| 74 | |
| 75 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 76 | name = "polydrivetrain", |
| 77 | srcs = [ |
| 78 | "polydrivetrain.cc", |
| 79 | ], |
| 80 | hdrs = [ |
| 81 | "polydrivetrain.h", |
| 82 | ], |
| 83 | deps = [ |
| 84 | ":drivetrain_config", |
| 85 | ":drivetrain_queue", |
| 86 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 87 | "//aos:math", |
| 88 | "//aos/controls:polytope", |
| 89 | "//aos/logging:matrix_logging", |
| 90 | "//aos/logging:queue_logging", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 91 | "//aos/robot_state", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 92 | "//aos/util:log_interval", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 93 | "//frc971/control_loops:coerce_goal", |
| 94 | "//frc971/control_loops:state_feedback_loop", |
| 95 | ], |
| 96 | ) |
| 97 | |
| 98 | cc_library( |
| 99 | name = "drivetrain_config_uc", |
| 100 | hdrs = [ |
| 101 | "drivetrain_config.h", |
| 102 | ], |
| 103 | restricted_to = mcu_cpus, |
| 104 | deps = [ |
| 105 | "//frc971:shifter_hall_effect", |
| 106 | "//frc971/control_loops:state_feedback_loop_uc", |
| 107 | ], |
| 108 | ) |
| 109 | |
| 110 | cc_library( |
| 111 | name = "polydrivetrain_uc", |
| 112 | srcs = [ |
| 113 | "drivetrain_uc.q.cc", |
| 114 | "polydrivetrain.cc", |
| 115 | ], |
| 116 | hdrs = [ |
| 117 | "drivetrain_uc.q.h", |
| 118 | "polydrivetrain.h", |
| 119 | ], |
| 120 | restricted_to = mcu_cpus, |
| 121 | deps = [ |
| 122 | ":drivetrain_config_uc", |
| 123 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 124 | "//aos:math", |
| 125 | "//aos/controls:polytope_uc", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 126 | "//frc971/control_loops:coerce_goal_uc", |
| 127 | "//frc971/control_loops:state_feedback_loop_uc", |
| 128 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 129 | ) |
| 130 | |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 131 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 132 | name = "genrule_down_estimator", |
| 133 | outs = [ |
| 134 | "down_estimator.h", |
| 135 | "down_estimator.cc", |
| 136 | ], |
| 137 | cmd = "$(location //frc971/control_loops/python:down_estimator) $(OUTS)", |
| 138 | tools = [ |
| 139 | "//frc971/control_loops/python:down_estimator", |
| 140 | ], |
| 141 | visibility = ["//visibility:private"], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 142 | ) |
| 143 | |
| 144 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 145 | name = "down_estimator", |
| 146 | srcs = [ |
| 147 | "down_estimator.cc", |
| 148 | ], |
| 149 | hdrs = [ |
| 150 | "down_estimator.h", |
| 151 | ], |
| 152 | deps = [ |
| 153 | "//frc971/control_loops:state_feedback_loop", |
| 154 | ], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 155 | ) |
| 156 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 157 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 158 | name = "drivetrain_lib", |
| 159 | srcs = [ |
| 160 | "drivetrain.cc", |
| 161 | ], |
| 162 | hdrs = [ |
| 163 | "drivetrain.h", |
| 164 | ], |
| 165 | deps = [ |
| 166 | ":down_estimator", |
| 167 | ":drivetrain_queue", |
| 168 | ":gear", |
| 169 | ":polydrivetrain", |
| 170 | ":ssdrivetrain", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 171 | "//aos/controls:control_loop", |
| 172 | "//aos/logging:matrix_logging", |
| 173 | "//aos/logging:queue_logging", |
| 174 | "//aos/util:log_interval", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 175 | "//frc971/queues:gyro", |
| 176 | "//frc971/wpilib:imu_queue", |
| 177 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 178 | ) |
| 179 | |
| 180 | cc_test( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 181 | name = "drivetrain_lib_test", |
| 182 | srcs = [ |
| 183 | "drivetrain_lib_test.cc", |
| 184 | ], |
| 185 | deps = [ |
| 186 | ":drivetrain_config", |
| 187 | ":drivetrain_lib", |
| 188 | ":drivetrain_queue", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 189 | "//aos:queues", |
| 190 | "//aos/controls:control_loop_test", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 191 | "//aos/testing:googletest", |
| 192 | "//frc971/control_loops:state_feedback_loop", |
| 193 | "//frc971/queues:gyro", |
| 194 | "//y2016:constants", |
| 195 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
| 196 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 197 | ) |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 198 | |
| 199 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 200 | name = "genrule_haptic_wheel", |
| 201 | outs = [ |
| 202 | "haptic_wheel.h", |
| 203 | "haptic_wheel.cc", |
| 204 | "integral_haptic_wheel.h", |
| 205 | "integral_haptic_wheel.cc", |
| 206 | "haptic_trigger.h", |
| 207 | "haptic_trigger.cc", |
| 208 | "integral_haptic_trigger.h", |
| 209 | "integral_haptic_trigger.cc", |
| 210 | ], |
| 211 | cmd = "$(location //frc971/control_loops/python:haptic_wheel) $(OUTS)", |
| 212 | compatible_with = mcu_cpus, |
| 213 | tools = [ |
| 214 | "//frc971/control_loops/python:haptic_wheel", |
| 215 | ], |
| 216 | visibility = ["//visibility:private"], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 217 | ) |
| 218 | |
| 219 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 220 | name = "haptic_input_uc", |
| 221 | srcs = [ |
| 222 | "haptic_trigger.cc", |
| 223 | "haptic_wheel.cc", |
| 224 | "integral_haptic_trigger.cc", |
| 225 | "integral_haptic_wheel.cc", |
| 226 | ], |
| 227 | hdrs = [ |
| 228 | "haptic_trigger.h", |
| 229 | "haptic_wheel.h", |
| 230 | "integral_haptic_trigger.h", |
| 231 | "integral_haptic_wheel.h", |
| 232 | ], |
| 233 | restricted_to = mcu_cpus, |
| 234 | deps = [ |
| 235 | "//frc971/control_loops:state_feedback_loop_uc", |
| 236 | ], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 237 | ) |
| 238 | |
| 239 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 240 | name = "haptic_wheel", |
| 241 | srcs = [ |
| 242 | "haptic_trigger.cc", |
| 243 | "haptic_wheel.cc", |
| 244 | "integral_haptic_trigger.cc", |
| 245 | "integral_haptic_wheel.cc", |
| 246 | ], |
| 247 | hdrs = [ |
| 248 | "haptic_trigger.h", |
| 249 | "haptic_wheel.h", |
| 250 | "integral_haptic_trigger.h", |
| 251 | "integral_haptic_wheel.h", |
| 252 | ], |
| 253 | deps = [ |
| 254 | "//frc971/control_loops:state_feedback_loop", |
| 255 | ], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 256 | ) |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 257 | |
| 258 | cc_library( |
| 259 | name = "spline", |
| 260 | srcs = ["spline.cc"], |
| 261 | hdrs = ["spline.h"], |
| 262 | deps = [ |
| 263 | "//third_party/eigen", |
| 264 | ], |
| 265 | ) |
| 266 | |
| 267 | cc_test( |
| 268 | name = "spline_test", |
| 269 | srcs = [ |
| 270 | "spline_test.cc", |
| 271 | ], |
| 272 | restricted_to = ["//tools:k8"], |
| 273 | deps = [ |
| 274 | ":spline", |
| 275 | "//aos/testing:googletest", |
| 276 | "//third_party/matplotlib-cpp", |
| 277 | "@com_github_gflags_gflags//:gflags", |
| 278 | ], |
| 279 | ) |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 280 | |
| 281 | cc_library( |
| 282 | name = "distance_spline", |
| 283 | srcs = ["distance_spline.cc"], |
| 284 | hdrs = ["distance_spline.h"], |
| 285 | deps = [ |
| 286 | ":spline", |
| 287 | "//frc971/control_loops:fixed_quadrature", |
| 288 | "//third_party/eigen", |
| 289 | ], |
| 290 | ) |
| 291 | |
| 292 | cc_test( |
| 293 | name = "distance_spline_test", |
| 294 | srcs = [ |
| 295 | "distance_spline_test.cc", |
| 296 | ], |
| 297 | restricted_to = ["//tools:k8"], |
| 298 | deps = [ |
| 299 | ":distance_spline", |
| 300 | "//aos/testing:googletest", |
| 301 | "//third_party/matplotlib-cpp", |
| 302 | "@com_github_gflags_gflags//:gflags", |
| 303 | ], |
| 304 | ) |