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