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 | |
Alex Perry | 2124ae8 | 2020-03-07 14:19:06 -0800 | [diff] [blame] | 3 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library") |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 4 | load("//aos:config.bzl", "aos_config") |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 5 | load("//tools/build_rules:select.bzl", "cpu_select") |
James Kuszmaul | c4ae11c | 2020-12-26 16:26:58 -0800 | [diff] [blame^] | 6 | load("@npm_bazel_typescript//:defs.bzl", "ts_library") |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 7 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 8 | flatbuffer_cc_library( |
| 9 | name = "drivetrain_goal_fbs", |
| 10 | srcs = ["drivetrain_goal.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 11 | gen_reflections = 1, |
| 12 | includes = ["//frc971/control_loops:control_loops_fbs_includes"], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 13 | ) |
| 14 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 15 | flatbuffer_cc_library( |
| 16 | name = "drivetrain_output_fbs", |
| 17 | srcs = ["drivetrain_output.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 18 | gen_reflections = 1, |
| 19 | ) |
| 20 | |
| 21 | flatbuffer_cc_library( |
| 22 | name = "drivetrain_position_fbs", |
| 23 | srcs = ["drivetrain_position.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 24 | gen_reflections = 1, |
| 25 | ) |
| 26 | |
| 27 | flatbuffer_cc_library( |
| 28 | name = "drivetrain_status_fbs", |
| 29 | srcs = ["drivetrain_status.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 30 | gen_reflections = 1, |
| 31 | includes = ["//frc971/control_loops:control_loops_fbs_includes"], |
| 32 | ) |
| 33 | |
Alex Perry | 2124ae8 | 2020-03-07 14:19:06 -0800 | [diff] [blame] | 34 | flatbuffer_ts_library( |
| 35 | name = "drivetrain_status_ts_fbs", |
| 36 | srcs = ["drivetrain_status.fbs"], |
| 37 | includes = ["//frc971/control_loops:control_loops_fbs_includes"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 38 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | 2124ae8 | 2020-03-07 14:19:06 -0800 | [diff] [blame] | 39 | ) |
| 40 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 41 | genrule( |
| 42 | name = "drivetrain_goal_float_fbs_generated", |
| 43 | srcs = ["drivetrain_goal.fbs"], |
| 44 | outs = ["drivetrain_goal_float.fbs"], |
| 45 | cmd = "cat $(SRCS) | sed 's/double/float/g' > $(OUTS)", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 46 | ) |
| 47 | |
| 48 | genrule( |
| 49 | name = "drivetrain_position_float_fbs_generated", |
| 50 | srcs = ["drivetrain_position.fbs"], |
| 51 | outs = ["drivetrain_position_float.fbs"], |
| 52 | cmd = "cat $(SRCS) | sed 's/double/float/g' > $(OUTS)", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 53 | ) |
| 54 | |
| 55 | genrule( |
| 56 | name = "drivetrain_output_float_fbs_generated", |
| 57 | srcs = ["drivetrain_output.fbs"], |
| 58 | outs = ["drivetrain_output_float.fbs"], |
| 59 | cmd = "cat $(SRCS) | sed 's/double/float/g' > $(OUTS)", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 60 | ) |
| 61 | |
| 62 | genrule( |
| 63 | name = "drivetrain_status_float_fbs_generated", |
| 64 | srcs = ["drivetrain_status.fbs"], |
| 65 | outs = ["drivetrain_status_float.fbs"], |
| 66 | cmd = "cat $(SRCS) | sed 's/double/float/g' > $(OUTS)", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 67 | ) |
| 68 | |
| 69 | flatbuffer_cc_library( |
| 70 | name = "drivetrain_goal_float_fbs", |
| 71 | srcs = ["drivetrain_goal_float.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 72 | gen_reflections = 1, |
| 73 | includes = ["//frc971/control_loops:control_loops_fbs_includes"], |
| 74 | ) |
| 75 | |
| 76 | flatbuffer_cc_library( |
| 77 | name = "drivetrain_output_float_fbs", |
| 78 | srcs = ["drivetrain_output_float.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 79 | gen_reflections = 1, |
| 80 | ) |
| 81 | |
| 82 | flatbuffer_cc_library( |
| 83 | name = "drivetrain_position_float_fbs", |
| 84 | srcs = ["drivetrain_position_float.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 85 | gen_reflections = 1, |
| 86 | ) |
| 87 | |
| 88 | flatbuffer_cc_library( |
| 89 | name = "drivetrain_status_float_fbs", |
| 90 | srcs = ["drivetrain_status_float.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 91 | gen_reflections = 1, |
| 92 | includes = ["//frc971/control_loops:control_loops_fbs_includes"], |
| 93 | ) |
| 94 | |
| 95 | aos_config( |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 96 | name = "simulation_channels", |
| 97 | src = "drivetrain_simulation_channels.json", |
| 98 | flatbuffers = [ |
| 99 | ":drivetrain_status_fbs", |
| 100 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 101 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 102 | visibility = ["//visibility:public"], |
| 103 | ) |
| 104 | |
| 105 | aos_config( |
| 106 | name = "simulation_config", |
| 107 | src = "drivetrain_simulation_config.json", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 108 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 109 | visibility = ["//visibility:public"], |
| 110 | deps = [ |
| 111 | ":config", |
| 112 | ":simulation_channels", |
| 113 | ], |
| 114 | ) |
| 115 | |
| 116 | aos_config( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 117 | name = "config", |
| 118 | src = "drivetrain_config.json", |
| 119 | flatbuffers = [ |
| 120 | ":drivetrain_goal_fbs", |
| 121 | ":drivetrain_output_fbs", |
| 122 | ":drivetrain_status_fbs", |
| 123 | ":drivetrain_position_fbs", |
| 124 | ":localizer_fbs", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 125 | "//frc971/queues:gyro_fbs", |
| 126 | "//frc971/queues:gyro_uid_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 127 | "//frc971/wpilib:imu_fbs", |
Austin Schuh | ac17fba | 2020-03-28 15:55:33 -0700 | [diff] [blame] | 128 | "//frc971/wpilib:imu_batch_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 129 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 130 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 131 | visibility = ["//visibility:public"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 132 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 133 | "//aos/robot_state:config", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 134 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 135 | ) |
| 136 | |
| 137 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 138 | name = "drivetrain_config", |
| 139 | hdrs = [ |
| 140 | "drivetrain_config.h", |
| 141 | ], |
| 142 | deps = [ |
| 143 | "//frc971:shifter_hall_effect", |
| 144 | "//frc971/control_loops:state_feedback_loop", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 145 | ] + select({ |
| 146 | "@platforms//os:linux": ["//frc971/control_loops:hybrid_state_feedback_loop"], |
| 147 | "//conditions:default": [], |
| 148 | }), |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 149 | ) |
| 150 | |
| 151 | cc_library( |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 152 | name = "hybrid_ekf", |
| 153 | hdrs = ["hybrid_ekf.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 154 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 155 | deps = [ |
| 156 | ":drivetrain_config", |
James Kuszmaul | 3c5b4d3 | 2020-02-11 17:22:14 -0800 | [diff] [blame] | 157 | "//aos:math", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 158 | "//aos/containers:priority_queue", |
James Kuszmaul | fedc461 | 2019-03-10 11:24:51 -0700 | [diff] [blame] | 159 | "//aos/util:math", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 160 | "//frc971/control_loops:c2d", |
| 161 | "//frc971/control_loops:runge_kutta", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 162 | "@org_tuxfamily_eigen//:eigen", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 163 | ], |
| 164 | ) |
| 165 | |
| 166 | cc_test( |
| 167 | name = "hybrid_ekf_test", |
| 168 | srcs = ["hybrid_ekf_test.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 169 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 170 | deps = [ |
| 171 | ":drivetrain_test_lib", |
| 172 | ":hybrid_ekf", |
| 173 | ":trajectory", |
| 174 | "//aos/testing:googletest", |
| 175 | "//aos/testing:random_seed", |
| 176 | "//aos/testing:test_shm", |
| 177 | ], |
| 178 | ) |
| 179 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 180 | flatbuffer_cc_library( |
| 181 | name = "localizer_fbs", |
| 182 | srcs = ["localizer.fbs"], |
| 183 | gen_reflections = 1, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 184 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | ef428a0 | 2019-03-02 22:19:41 -0800 | [diff] [blame] | 185 | ) |
| 186 | |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 187 | cc_library( |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 188 | name = "localizer", |
| 189 | hdrs = ["localizer.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 190 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 191 | deps = [ |
| 192 | ":drivetrain_config", |
James Kuszmaul | 3c5b4d3 | 2020-02-11 17:22:14 -0800 | [diff] [blame] | 193 | ":drivetrain_status_fbs", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 194 | ":hybrid_ekf", |
James Kuszmaul | 5398fae | 2020-02-17 16:44:03 -0800 | [diff] [blame] | 195 | "//frc971/control_loops:control_loops_fbs", |
James Kuszmaul | 5bc6fc9 | 2019-03-01 21:50:06 -0800 | [diff] [blame] | 196 | "//frc971/control_loops:pose", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 197 | ], |
| 198 | ) |
| 199 | |
| 200 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 201 | name = "gear", |
| 202 | hdrs = [ |
| 203 | "gear.h", |
| 204 | ], |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 205 | ) |
| 206 | |
| 207 | cc_library( |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 208 | name = "splinedrivetrain", |
| 209 | srcs = [ |
| 210 | "splinedrivetrain.cc", |
| 211 | ], |
| 212 | hdrs = [ |
| 213 | "splinedrivetrain.h", |
| 214 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 215 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 216 | deps = [ |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 217 | ":distance_spline", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 218 | ":drivetrain_config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 219 | ":drivetrain_goal_fbs", |
| 220 | ":drivetrain_output_fbs", |
| 221 | ":drivetrain_status_fbs", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 222 | ":spline", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 223 | ":trajectory", |
Austin Schuh | 3d9ccd7 | 2020-08-01 15:42:40 -0700 | [diff] [blame] | 224 | "//aos:condition", |
Alex Perry | 1ec3452 | 2019-02-17 22:44:10 -0800 | [diff] [blame] | 225 | "//aos:init", |
James Kuszmaul | c73bb22 | 2019-04-07 12:15:35 -0700 | [diff] [blame] | 226 | "//aos/util:math", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 227 | "//frc971/control_loops:control_loops_fbs", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 228 | ], |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 229 | ) |
| 230 | |
| 231 | cc_library( |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 232 | name = "line_follow_drivetrain", |
| 233 | srcs = [ |
| 234 | "line_follow_drivetrain.cc", |
| 235 | ], |
| 236 | hdrs = [ |
| 237 | "line_follow_drivetrain.h", |
| 238 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 239 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 240 | deps = [ |
| 241 | ":drivetrain_config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 242 | ":drivetrain_goal_fbs", |
| 243 | ":drivetrain_output_fbs", |
| 244 | ":drivetrain_status_fbs", |
James Kuszmaul | 5bc6fc9 | 2019-03-01 21:50:06 -0800 | [diff] [blame] | 245 | ":localizer", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 246 | "//aos:math", |
| 247 | "//aos/util:math", |
| 248 | "//frc971/control_loops:c2d", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 249 | "//frc971/control_loops:control_loops_fbs", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 250 | "//frc971/control_loops:dlqr", |
| 251 | "//frc971/control_loops:pose", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 252 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 253 | "//y2019/control_loops/superstructure:superstructure_goal_fbs", |
| 254 | "@org_tuxfamily_eigen//:eigen", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 255 | ], |
| 256 | ) |
| 257 | |
| 258 | cc_test( |
| 259 | name = "line_follow_drivetrain_test", |
| 260 | srcs = ["line_follow_drivetrain_test.cc"], |
| 261 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 262 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 263 | deps = [ |
| 264 | ":drivetrain_config", |
| 265 | ":drivetrain_test_lib", |
| 266 | ":line_follow_drivetrain", |
| 267 | ":trajectory", |
| 268 | "//aos/testing:googletest", |
| 269 | "//aos/testing:test_shm", |
| 270 | "//third_party/matplotlib-cpp", |
| 271 | "@com_github_gflags_gflags//:gflags", |
| 272 | ], |
| 273 | ) |
| 274 | |
| 275 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 276 | name = "ssdrivetrain", |
| 277 | srcs = [ |
| 278 | "ssdrivetrain.cc", |
| 279 | ], |
| 280 | hdrs = [ |
| 281 | "ssdrivetrain.h", |
| 282 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 283 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 284 | deps = [ |
| 285 | ":drivetrain_config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 286 | ":drivetrain_goal_fbs", |
| 287 | ":drivetrain_output_fbs", |
| 288 | ":drivetrain_status_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 289 | ":gear", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 290 | ":localizer", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 291 | "//aos:math", |
| 292 | "//aos/controls:control_loop", |
| 293 | "//aos/controls:polytope", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 294 | "//aos/robot_state:robot_state_fbs", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 295 | "//aos/util:log_interval", |
| 296 | "//aos/util:trapezoid_profile", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 297 | "//frc971:shifter_hall_effect", |
| 298 | "//frc971/control_loops:coerce_goal", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 299 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 300 | "//frc971/control_loops:state_feedback_loop", |
| 301 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 302 | ) |
| 303 | |
| 304 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 305 | name = "polydrivetrain", |
| 306 | srcs = [ |
| 307 | "polydrivetrain.cc", |
| 308 | ], |
| 309 | hdrs = [ |
| 310 | "polydrivetrain.h", |
| 311 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 312 | copts = select({ |
| 313 | "@platforms//os:none": ["-Wno-type-limits"], |
| 314 | "//conditions:default": [], |
| 315 | }), |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 316 | deps = [ |
| 317 | ":drivetrain_config", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 318 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 319 | "//aos:math", |
| 320 | "//aos/controls:polytope", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 321 | "//frc971/control_loops:coerce_goal", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 322 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 323 | "//frc971/control_loops:state_feedback_loop", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 324 | ] + select({ |
| 325 | "@platforms//os:linux": [ |
| 326 | ":drivetrain_goal_fbs", |
| 327 | ":drivetrain_output_fbs", |
| 328 | ":drivetrain_position_fbs", |
| 329 | ":drivetrain_status_fbs", |
| 330 | "//aos/robot_state:robot_state_fbs", |
| 331 | "//aos/util:log_interval", |
| 332 | ], |
| 333 | "@platforms//os:none": [ |
| 334 | ":drivetrain_goal_float_fbs", |
| 335 | ":drivetrain_output_float_fbs", |
| 336 | ":drivetrain_position_float_fbs", |
| 337 | ":drivetrain_status_float_fbs", |
| 338 | ], |
| 339 | }), |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 340 | ) |
| 341 | |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 342 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 343 | name = "genrule_down_estimator", |
| 344 | outs = [ |
| 345 | "down_estimator.h", |
| 346 | "down_estimator.cc", |
| 347 | ], |
| 348 | cmd = "$(location //frc971/control_loops/python:down_estimator) $(OUTS)", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 349 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 350 | tools = [ |
| 351 | "//frc971/control_loops/python:down_estimator", |
| 352 | ], |
| 353 | visibility = ["//visibility:private"], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 354 | ) |
| 355 | |
| 356 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 357 | name = "down_estimator", |
| 358 | srcs = [ |
| 359 | "down_estimator.cc", |
| 360 | ], |
| 361 | hdrs = [ |
| 362 | "down_estimator.h", |
| 363 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 364 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 365 | deps = [ |
| 366 | "//frc971/control_loops:state_feedback_loop", |
| 367 | ], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 368 | ) |
| 369 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 370 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 371 | name = "drivetrain_lib", |
| 372 | srcs = [ |
| 373 | "drivetrain.cc", |
| 374 | ], |
| 375 | hdrs = [ |
| 376 | "drivetrain.h", |
| 377 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 378 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 379 | deps = [ |
| 380 | ":down_estimator", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 381 | ":drivetrain_goal_fbs", |
| 382 | ":drivetrain_output_fbs", |
| 383 | ":drivetrain_position_fbs", |
| 384 | ":drivetrain_status_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 385 | ":gear", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 386 | ":improved_down_estimator", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 387 | ":line_follow_drivetrain", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 388 | ":localizer", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 389 | ":localizer_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 390 | ":polydrivetrain", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 391 | ":splinedrivetrain", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 392 | ":ssdrivetrain", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 393 | "//aos/controls:control_loop", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 394 | "//aos/util:log_interval", |
Austin Schuh | 3a37846 | 2019-01-04 21:48:04 -0800 | [diff] [blame] | 395 | "//frc971/control_loops:runge_kutta", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 396 | "//frc971/queues:gyro_fbs", |
Austin Schuh | ac17fba | 2020-03-28 15:55:33 -0700 | [diff] [blame] | 397 | "//frc971/wpilib:imu_batch_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 398 | "//frc971/wpilib:imu_fbs", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 399 | "//frc971/zeroing:imu_zeroer", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 400 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 401 | ) |
| 402 | |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 403 | cc_library( |
| 404 | name = "drivetrain_test_lib", |
| 405 | testonly = True, |
| 406 | srcs = ["drivetrain_test_lib.cc"], |
| 407 | hdrs = ["drivetrain_test_lib.h"], |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 408 | defines = |
| 409 | cpu_select({ |
| 410 | "amd64": [ |
| 411 | "SUPPORT_PLOT=1", |
| 412 | ], |
| 413 | "arm": [], |
| 414 | }), |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 415 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 416 | deps = [ |
| 417 | ":drivetrain_config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 418 | ":drivetrain_goal_fbs", |
| 419 | ":drivetrain_output_fbs", |
| 420 | ":drivetrain_position_fbs", |
| 421 | ":drivetrain_status_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 422 | ":trajectory", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 423 | "//aos/events:event_loop", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 424 | "//aos/testing:googletest", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 425 | "//frc971/control_loops:control_loops_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 426 | "//frc971/control_loops:state_feedback_loop", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 427 | "//frc971/queues:gyro_fbs", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 428 | "//frc971/wpilib:imu_fbs", |
Austin Schuh | ac17fba | 2020-03-28 15:55:33 -0700 | [diff] [blame] | 429 | "//frc971/wpilib:imu_batch_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 430 | "//y2016:constants", |
| 431 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 432 | ] + cpu_select({ |
| 433 | "amd64": [ |
| 434 | "//third_party/matplotlib-cpp", |
| 435 | ], |
| 436 | "arm": [], |
| 437 | }), |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 438 | ) |
| 439 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 440 | cc_test( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 441 | name = "drivetrain_lib_test", |
| 442 | srcs = [ |
| 443 | "drivetrain_lib_test.cc", |
| 444 | ], |
Austin Schuh | 14d7d3d | 2020-09-10 18:14:36 -0700 | [diff] [blame] | 445 | data = [":simulation_config"], |
Alex Perry | 04300d6 | 2019-02-17 14:37:04 -0800 | [diff] [blame] | 446 | defines = |
| 447 | cpu_select({ |
| 448 | "amd64": [ |
| 449 | "SUPPORT_PLOT=1", |
| 450 | ], |
| 451 | "arm": [], |
| 452 | }), |
| 453 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 454 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 455 | deps = [ |
| 456 | ":drivetrain_config", |
| 457 | ":drivetrain_lib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 458 | ":localizer_fbs", |
| 459 | ":drivetrain_goal_fbs", |
| 460 | ":drivetrain_status_fbs", |
| 461 | ":drivetrain_position_fbs", |
| 462 | ":drivetrain_output_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 463 | ":drivetrain_test_lib", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 464 | "//aos/controls:control_loop_test", |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 465 | "//aos/events/logging:logger", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 466 | "//aos/testing:googletest", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 467 | "//frc971/queues:gyro_fbs", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 468 | "//frc971/wpilib:imu_fbs", |
Alex Perry | 04300d6 | 2019-02-17 14:37:04 -0800 | [diff] [blame] | 469 | ] + cpu_select({ |
| 470 | "amd64": [ |
| 471 | "//third_party/matplotlib-cpp", |
| 472 | ], |
| 473 | "arm": [], |
| 474 | }), |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 475 | ) |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 476 | |
| 477 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 478 | name = "genrule_haptic_wheel", |
| 479 | outs = [ |
| 480 | "haptic_wheel.h", |
| 481 | "haptic_wheel.cc", |
| 482 | "integral_haptic_wheel.h", |
| 483 | "integral_haptic_wheel.cc", |
| 484 | "haptic_trigger.h", |
| 485 | "haptic_trigger.cc", |
| 486 | "integral_haptic_trigger.h", |
| 487 | "integral_haptic_trigger.cc", |
| 488 | ], |
| 489 | cmd = "$(location //frc971/control_loops/python:haptic_wheel) $(OUTS)", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 490 | tools = [ |
| 491 | "//frc971/control_loops/python:haptic_wheel", |
| 492 | ], |
| 493 | visibility = ["//visibility:private"], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 494 | ) |
| 495 | |
| 496 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 497 | name = "haptic_wheel", |
| 498 | srcs = [ |
| 499 | "haptic_trigger.cc", |
| 500 | "haptic_wheel.cc", |
| 501 | "integral_haptic_trigger.cc", |
| 502 | "integral_haptic_wheel.cc", |
| 503 | ], |
| 504 | hdrs = [ |
| 505 | "haptic_trigger.h", |
| 506 | "haptic_wheel.h", |
| 507 | "integral_haptic_trigger.h", |
| 508 | "integral_haptic_wheel.h", |
| 509 | ], |
| 510 | deps = [ |
| 511 | "//frc971/control_loops:state_feedback_loop", |
| 512 | ], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 513 | ) |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 514 | |
| 515 | cc_library( |
| 516 | name = "spline", |
| 517 | srcs = ["spline.cc"], |
| 518 | hdrs = ["spline.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 519 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 520 | deps = [ |
Austin Schuh | f49b4e3 | 2019-01-13 17:26:58 -0800 | [diff] [blame] | 521 | "//frc971/control_loops:binomial", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 522 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 523 | ], |
| 524 | ) |
| 525 | |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 526 | cc_binary( |
| 527 | name = "spline.so", |
| 528 | srcs = ["libspline.cc"], |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 529 | linkshared = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 530 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 531 | deps = [ |
| 532 | ":distance_spline", |
| 533 | ":spline", |
Alex Perry | 0603b54 | 2019-01-25 20:29:51 -0800 | [diff] [blame] | 534 | ":trajectory", |
| 535 | "//aos/logging:implementations", |
| 536 | "//aos/network:team_number", |
James Kuszmaul | 8aa37cb | 2020-03-01 10:27:58 -0800 | [diff] [blame] | 537 | "//y2020/control_loops/drivetrain:drivetrain_base", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 538 | "@org_tuxfamily_eigen//:eigen", |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 539 | ], |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 540 | ) |
| 541 | |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 542 | cc_test( |
| 543 | name = "spline_test", |
| 544 | srcs = [ |
| 545 | "spline_test.cc", |
| 546 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 547 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 548 | deps = [ |
| 549 | ":spline", |
| 550 | "//aos/testing:googletest", |
| 551 | "//third_party/matplotlib-cpp", |
| 552 | "@com_github_gflags_gflags//:gflags", |
| 553 | ], |
| 554 | ) |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 555 | |
| 556 | cc_library( |
| 557 | name = "distance_spline", |
| 558 | srcs = ["distance_spline.cc"], |
| 559 | hdrs = ["distance_spline.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 560 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 561 | deps = [ |
| 562 | ":spline", |
Austin Schuh | a6e7b21 | 2019-01-20 13:53:01 -0800 | [diff] [blame] | 563 | "//aos/logging", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 564 | "//frc971/control_loops:fixed_quadrature", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 565 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 566 | ], |
| 567 | ) |
| 568 | |
| 569 | cc_test( |
| 570 | name = "distance_spline_test", |
| 571 | srcs = [ |
| 572 | "distance_spline_test.cc", |
| 573 | ], |
Austin Schuh | 9b0b643 | 2019-01-13 21:15:17 -0800 | [diff] [blame] | 574 | defines = |
| 575 | cpu_select({ |
| 576 | "amd64": [ |
| 577 | "SUPPORT_PLOT=1", |
| 578 | ], |
| 579 | "arm": [], |
| 580 | }), |
| 581 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 582 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 583 | deps = [ |
| 584 | ":distance_spline", |
| 585 | "//aos/testing:googletest", |
Austin Schuh | a6e7b21 | 2019-01-20 13:53:01 -0800 | [diff] [blame] | 586 | "//aos/testing:test_shm", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 587 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | 9b0b643 | 2019-01-13 21:15:17 -0800 | [diff] [blame] | 588 | ] + cpu_select({ |
| 589 | "amd64": [ |
| 590 | "//third_party/matplotlib-cpp", |
| 591 | ], |
| 592 | "arm": [], |
| 593 | }), |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 594 | ) |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 595 | |
| 596 | cc_library( |
| 597 | name = "trajectory", |
| 598 | srcs = ["trajectory.cc"], |
| 599 | hdrs = ["trajectory.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 600 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 601 | deps = [ |
| 602 | ":distance_spline", |
| 603 | ":drivetrain_config", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 604 | "//frc971/control_loops:c2d", |
| 605 | "//frc971/control_loops:dlqr", |
| 606 | "//frc971/control_loops:hybrid_state_feedback_loop", |
| 607 | "//frc971/control_loops:runge_kutta", |
| 608 | "//frc971/control_loops:state_feedback_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 609 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 610 | ], |
| 611 | ) |
| 612 | |
| 613 | cc_binary( |
| 614 | name = "trajectory_plot", |
| 615 | srcs = [ |
| 616 | "trajectory_plot.cc", |
| 617 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 618 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 619 | deps = [ |
| 620 | ":distance_spline", |
| 621 | ":trajectory", |
| 622 | "//aos/logging:implementations", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 623 | "//aos/network:team_number", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 624 | "//third_party/matplotlib-cpp", |
Austin Schuh | 1104318 | 2019-03-23 22:29:12 -0700 | [diff] [blame] | 625 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 626 | "@com_github_gflags_gflags//:gflags", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 627 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 628 | ], |
| 629 | ) |
| 630 | |
| 631 | cc_test( |
| 632 | name = "trajectory_test", |
| 633 | srcs = [ |
| 634 | "trajectory_test.cc", |
| 635 | ], |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 636 | defines = |
| 637 | cpu_select({ |
| 638 | "amd64": [ |
| 639 | "SUPPORT_PLOT=1", |
| 640 | ], |
| 641 | "arm": [], |
| 642 | }), |
| 643 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 644 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 645 | deps = [ |
| 646 | ":trajectory", |
James Kuszmaul | ea314d9 | 2019-02-18 19:45:06 -0800 | [diff] [blame] | 647 | ":drivetrain_test_lib", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 648 | "//aos/testing:googletest", |
| 649 | "//aos/testing:test_shm", |
| 650 | "//y2016:constants", |
| 651 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
James Kuszmaul | ea314d9 | 2019-02-18 19:45:06 -0800 | [diff] [blame] | 652 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 653 | ] + cpu_select({ |
| 654 | "amd64": [ |
| 655 | "//third_party/matplotlib-cpp", |
| 656 | ], |
| 657 | "arm": [], |
| 658 | }), |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 659 | ) |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 660 | |
| 661 | cc_library( |
| 662 | name = "improved_down_estimator", |
| 663 | srcs = [ |
| 664 | "improved_down_estimator.cc", |
| 665 | ], |
| 666 | hdrs = [ |
| 667 | "improved_down_estimator.h", |
| 668 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 669 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 670 | deps = [ |
James Kuszmaul | 7f55f07 | 2020-03-01 10:21:26 -0800 | [diff] [blame] | 671 | ":drivetrain_config", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 672 | ":drivetrain_status_fbs", |
Brian Silverman | dac0a4b | 2020-06-23 17:03:09 -0700 | [diff] [blame] | 673 | "//aos/controls:quaternion_utils", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 674 | "//aos/events:event_loop", |
| 675 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 676 | "//frc971/control_loops:runge_kutta", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 677 | "@//aos/time", |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 678 | "@com_github_google_glog//:glog", |
| 679 | "@org_tuxfamily_eigen//:eigen", |
| 680 | ], |
| 681 | ) |
| 682 | |
| 683 | cc_test( |
| 684 | name = "improved_down_estimator_test", |
| 685 | srcs = [ |
| 686 | "improved_down_estimator_test.cc", |
| 687 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 688 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 689 | deps = [ |
James Kuszmaul | 7f55f07 | 2020-03-01 10:21:26 -0800 | [diff] [blame] | 690 | ":drivetrain_test_lib", |
Brian Silverman | dac0a4b | 2020-06-23 17:03:09 -0700 | [diff] [blame] | 691 | "//aos/controls:quaternion_utils", |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 692 | "//aos/testing:googletest", |
| 693 | "//aos/testing:random_seed", |
| 694 | "//frc971/control_loops/drivetrain:improved_down_estimator", |
| 695 | "@org_tuxfamily_eigen//:eigen", |
| 696 | ], |
| 697 | ) |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 698 | |
| 699 | cc_library( |
| 700 | name = "camera", |
| 701 | srcs = ["camera.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 702 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 703 | visibility = ["//visibility:public"], |
| 704 | deps = [ |
| 705 | "//aos/containers:sized_array", |
| 706 | "//frc971/control_loops:pose", |
| 707 | ], |
| 708 | ) |
| 709 | |
| 710 | cc_test( |
| 711 | name = "camera_test", |
| 712 | srcs = ["camera_test.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 713 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 714 | deps = [ |
| 715 | ":camera", |
| 716 | "//aos/testing:googletest", |
| 717 | ], |
| 718 | ) |
James Kuszmaul | c4ae11c | 2020-12-26 16:26:58 -0800 | [diff] [blame^] | 719 | |
| 720 | ts_library( |
| 721 | name = "drivetrain_plotter", |
| 722 | srcs = ["drivetrain_plotter.ts"], |
| 723 | target_compatible_with = ["@platforms//os:linux"], |
| 724 | deps = [ |
| 725 | "//aos/network/www:aos_plotter", |
| 726 | "//aos/network/www:proxy", |
| 727 | "//frc971/wpilib:imu_plot_utils", |
| 728 | ], |
| 729 | ) |