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", |
Austin Schuh | 95771d9 | 2021-01-23 14:42:25 -0800 | [diff] [blame] | 288 | ":drivetrain_states", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 289 | ":drivetrain_status_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 290 | ":gear", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 291 | ":localizer", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 292 | "//aos:math", |
| 293 | "//aos/controls:control_loop", |
| 294 | "//aos/controls:polytope", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 295 | "//aos/robot_state:robot_state_fbs", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 296 | "//aos/util:log_interval", |
| 297 | "//aos/util:trapezoid_profile", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 298 | "//frc971:shifter_hall_effect", |
| 299 | "//frc971/control_loops:coerce_goal", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 300 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 301 | "//frc971/control_loops:state_feedback_loop", |
| 302 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 303 | ) |
| 304 | |
| 305 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 306 | name = "polydrivetrain", |
| 307 | srcs = [ |
| 308 | "polydrivetrain.cc", |
| 309 | ], |
| 310 | hdrs = [ |
| 311 | "polydrivetrain.h", |
| 312 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 313 | copts = select({ |
| 314 | "@platforms//os:none": ["-Wno-type-limits"], |
| 315 | "//conditions:default": [], |
| 316 | }), |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 317 | deps = [ |
| 318 | ":drivetrain_config", |
Austin Schuh | 95771d9 | 2021-01-23 14:42:25 -0800 | [diff] [blame] | 319 | ":drivetrain_states", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 320 | ":gear", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 321 | "//aos:math", |
| 322 | "//aos/controls:polytope", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 323 | "//frc971/control_loops:coerce_goal", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 324 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 325 | "//frc971/control_loops:state_feedback_loop", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 326 | ] + select({ |
| 327 | "@platforms//os:linux": [ |
| 328 | ":drivetrain_goal_fbs", |
| 329 | ":drivetrain_output_fbs", |
| 330 | ":drivetrain_position_fbs", |
| 331 | ":drivetrain_status_fbs", |
| 332 | "//aos/robot_state:robot_state_fbs", |
| 333 | "//aos/util:log_interval", |
| 334 | ], |
| 335 | "@platforms//os:none": [ |
| 336 | ":drivetrain_goal_float_fbs", |
| 337 | ":drivetrain_output_float_fbs", |
| 338 | ":drivetrain_position_float_fbs", |
| 339 | ":drivetrain_status_float_fbs", |
| 340 | ], |
| 341 | }), |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 342 | ) |
| 343 | |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 344 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 345 | name = "genrule_down_estimator", |
| 346 | outs = [ |
| 347 | "down_estimator.h", |
| 348 | "down_estimator.cc", |
| 349 | ], |
| 350 | cmd = "$(location //frc971/control_loops/python:down_estimator) $(OUTS)", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 351 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 352 | tools = [ |
| 353 | "//frc971/control_loops/python:down_estimator", |
| 354 | ], |
| 355 | visibility = ["//visibility:private"], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 356 | ) |
| 357 | |
| 358 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 359 | name = "down_estimator", |
| 360 | srcs = [ |
| 361 | "down_estimator.cc", |
| 362 | ], |
| 363 | hdrs = [ |
| 364 | "down_estimator.h", |
| 365 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 366 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 367 | deps = [ |
| 368 | "//frc971/control_loops:state_feedback_loop", |
| 369 | ], |
Austin Schuh | 05c5a61 | 2016-04-02 15:10:25 -0700 | [diff] [blame] | 370 | ) |
| 371 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 372 | cc_library( |
Austin Schuh | 95771d9 | 2021-01-23 14:42:25 -0800 | [diff] [blame] | 373 | name = "drivetrain_states", |
| 374 | hdrs = ["drivetrain_states.h"], |
| 375 | ) |
| 376 | |
| 377 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 378 | name = "drivetrain_lib", |
| 379 | srcs = [ |
| 380 | "drivetrain.cc", |
| 381 | ], |
| 382 | hdrs = [ |
| 383 | "drivetrain.h", |
| 384 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 385 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 386 | deps = [ |
| 387 | ":down_estimator", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 388 | ":drivetrain_goal_fbs", |
| 389 | ":drivetrain_output_fbs", |
| 390 | ":drivetrain_position_fbs", |
Austin Schuh | 95771d9 | 2021-01-23 14:42:25 -0800 | [diff] [blame] | 391 | ":drivetrain_states", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 392 | ":drivetrain_status_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 393 | ":gear", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 394 | ":improved_down_estimator", |
James Kuszmaul | e39cbcf | 2019-02-27 20:48:34 -0800 | [diff] [blame] | 395 | ":line_follow_drivetrain", |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 396 | ":localizer", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 397 | ":localizer_fbs", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 398 | ":polydrivetrain", |
Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame] | 399 | ":splinedrivetrain", |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 400 | ":ssdrivetrain", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 401 | "//aos/controls:control_loop", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 402 | "//aos/util:log_interval", |
Austin Schuh | 3a37846 | 2019-01-04 21:48:04 -0800 | [diff] [blame] | 403 | "//frc971/control_loops:runge_kutta", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 404 | "//frc971/queues:gyro_fbs", |
Austin Schuh | ac17fba | 2020-03-28 15:55:33 -0700 | [diff] [blame] | 405 | "//frc971/wpilib:imu_batch_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 406 | "//frc971/wpilib:imu_fbs", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 407 | "//frc971/zeroing:imu_zeroer", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 408 | ], |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 409 | ) |
| 410 | |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 411 | cc_library( |
| 412 | name = "drivetrain_test_lib", |
| 413 | testonly = True, |
| 414 | srcs = ["drivetrain_test_lib.cc"], |
| 415 | hdrs = ["drivetrain_test_lib.h"], |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 416 | defines = |
| 417 | cpu_select({ |
| 418 | "amd64": [ |
| 419 | "SUPPORT_PLOT=1", |
| 420 | ], |
| 421 | "arm": [], |
| 422 | }), |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 423 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 424 | deps = [ |
| 425 | ":drivetrain_config", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 426 | ":drivetrain_goal_fbs", |
| 427 | ":drivetrain_output_fbs", |
| 428 | ":drivetrain_position_fbs", |
| 429 | ":drivetrain_status_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 430 | ":trajectory", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 431 | "//aos/events:event_loop", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 432 | "//aos/testing:googletest", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 433 | "//frc971/control_loops:control_loops_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 434 | "//frc971/control_loops:state_feedback_loop", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 435 | "//frc971/queues:gyro_fbs", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 436 | "//frc971/wpilib:imu_fbs", |
Austin Schuh | ac17fba | 2020-03-28 15:55:33 -0700 | [diff] [blame] | 437 | "//frc971/wpilib:imu_batch_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 438 | "//y2016:constants", |
| 439 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
James Kuszmaul | 74d8f97 | 2020-02-11 17:13:17 -0800 | [diff] [blame] | 440 | ] + cpu_select({ |
| 441 | "amd64": [ |
| 442 | "//third_party/matplotlib-cpp", |
| 443 | ], |
| 444 | "arm": [], |
| 445 | }), |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 446 | ) |
| 447 | |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 448 | cc_test( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 449 | name = "drivetrain_lib_test", |
| 450 | srcs = [ |
| 451 | "drivetrain_lib_test.cc", |
| 452 | ], |
Austin Schuh | 14d7d3d | 2020-09-10 18:14:36 -0700 | [diff] [blame] | 453 | data = [":simulation_config"], |
Alex Perry | 04300d6 | 2019-02-17 14:37:04 -0800 | [diff] [blame] | 454 | defines = |
| 455 | cpu_select({ |
| 456 | "amd64": [ |
| 457 | "SUPPORT_PLOT=1", |
| 458 | ], |
| 459 | "arm": [], |
| 460 | }), |
| 461 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 462 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 463 | deps = [ |
| 464 | ":drivetrain_config", |
| 465 | ":drivetrain_lib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 466 | ":localizer_fbs", |
| 467 | ":drivetrain_goal_fbs", |
| 468 | ":drivetrain_status_fbs", |
| 469 | ":drivetrain_position_fbs", |
| 470 | ":drivetrain_output_fbs", |
James Kuszmaul | 109ed8d | 2019-02-17 21:41:04 -0800 | [diff] [blame] | 471 | ":drivetrain_test_lib", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 472 | "//aos/controls:control_loop_test", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 473 | "//aos/events/logging:log_writer", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 474 | "//aos/testing:googletest", |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 475 | "//frc971/queues:gyro_fbs", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 476 | "//frc971/wpilib:imu_fbs", |
Alex Perry | 04300d6 | 2019-02-17 14:37:04 -0800 | [diff] [blame] | 477 | ] + cpu_select({ |
| 478 | "amd64": [ |
| 479 | "//third_party/matplotlib-cpp", |
| 480 | ], |
| 481 | "arm": [], |
| 482 | }), |
Comran Morshed | 5323ecb | 2015-12-26 20:50:55 +0000 | [diff] [blame] | 483 | ) |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 484 | |
| 485 | genrule( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 486 | name = "genrule_haptic_wheel", |
| 487 | outs = [ |
| 488 | "haptic_wheel.h", |
| 489 | "haptic_wheel.cc", |
| 490 | "integral_haptic_wheel.h", |
| 491 | "integral_haptic_wheel.cc", |
| 492 | "haptic_trigger.h", |
| 493 | "haptic_trigger.cc", |
| 494 | "integral_haptic_trigger.h", |
| 495 | "integral_haptic_trigger.cc", |
| 496 | ], |
| 497 | cmd = "$(location //frc971/control_loops/python:haptic_wheel) $(OUTS)", |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 498 | tools = [ |
| 499 | "//frc971/control_loops/python:haptic_wheel", |
| 500 | ], |
| 501 | visibility = ["//visibility:private"], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 502 | ) |
| 503 | |
| 504 | cc_library( |
Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 505 | name = "haptic_wheel", |
| 506 | srcs = [ |
| 507 | "haptic_trigger.cc", |
| 508 | "haptic_wheel.cc", |
| 509 | "integral_haptic_trigger.cc", |
| 510 | "integral_haptic_wheel.cc", |
| 511 | ], |
| 512 | hdrs = [ |
| 513 | "haptic_trigger.h", |
| 514 | "haptic_wheel.h", |
| 515 | "integral_haptic_trigger.h", |
| 516 | "integral_haptic_wheel.h", |
| 517 | ], |
| 518 | deps = [ |
| 519 | "//frc971/control_loops:state_feedback_loop", |
| 520 | ], |
Brian Silverman | 6260c09 | 2018-01-14 15:21:36 -0800 | [diff] [blame] | 521 | ) |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 522 | |
| 523 | cc_library( |
| 524 | name = "spline", |
| 525 | srcs = ["spline.cc"], |
| 526 | hdrs = ["spline.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 527 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 528 | deps = [ |
Austin Schuh | f49b4e3 | 2019-01-13 17:26:58 -0800 | [diff] [blame] | 529 | "//frc971/control_loops:binomial", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 530 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 531 | ], |
| 532 | ) |
| 533 | |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 534 | cc_binary( |
| 535 | name = "spline.so", |
| 536 | srcs = ["libspline.cc"], |
James Kuszmaul | 2ed7b3c | 2019-02-09 18:26:19 -0800 | [diff] [blame] | 537 | linkshared = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 538 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 539 | deps = [ |
| 540 | ":distance_spline", |
| 541 | ":spline", |
Alex Perry | 0603b54 | 2019-01-25 20:29:51 -0800 | [diff] [blame] | 542 | ":trajectory", |
| 543 | "//aos/logging:implementations", |
| 544 | "//aos/network:team_number", |
James Kuszmaul | 8aa37cb | 2020-03-01 10:27:58 -0800 | [diff] [blame] | 545 | "//y2020/control_loops/drivetrain:drivetrain_base", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 546 | "@org_tuxfamily_eigen//:eigen", |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 547 | ], |
Alex Perry | a60da44 | 2019-01-21 19:00:27 -0500 | [diff] [blame] | 548 | ) |
| 549 | |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 550 | cc_test( |
| 551 | name = "spline_test", |
| 552 | srcs = [ |
| 553 | "spline_test.cc", |
| 554 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 555 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | c2b0877 | 2018-12-19 18:05:06 +1100 | [diff] [blame] | 556 | deps = [ |
| 557 | ":spline", |
| 558 | "//aos/testing:googletest", |
| 559 | "//third_party/matplotlib-cpp", |
| 560 | "@com_github_gflags_gflags//:gflags", |
| 561 | ], |
| 562 | ) |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 563 | |
| 564 | cc_library( |
| 565 | name = "distance_spline", |
| 566 | srcs = ["distance_spline.cc"], |
| 567 | hdrs = ["distance_spline.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 568 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 569 | deps = [ |
| 570 | ":spline", |
Austin Schuh | a6e7b21 | 2019-01-20 13:53:01 -0800 | [diff] [blame] | 571 | "//aos/logging", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 572 | "//frc971/control_loops:fixed_quadrature", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 573 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 574 | ], |
| 575 | ) |
| 576 | |
| 577 | cc_test( |
| 578 | name = "distance_spline_test", |
| 579 | srcs = [ |
| 580 | "distance_spline_test.cc", |
| 581 | ], |
Austin Schuh | 9b0b643 | 2019-01-13 21:15:17 -0800 | [diff] [blame] | 582 | defines = |
| 583 | cpu_select({ |
| 584 | "amd64": [ |
| 585 | "SUPPORT_PLOT=1", |
| 586 | ], |
| 587 | "arm": [], |
| 588 | }), |
| 589 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 590 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 591 | deps = [ |
| 592 | ":distance_spline", |
| 593 | "//aos/testing:googletest", |
Austin Schuh | a6e7b21 | 2019-01-20 13:53:01 -0800 | [diff] [blame] | 594 | "//aos/testing:test_shm", |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 595 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | 9b0b643 | 2019-01-13 21:15:17 -0800 | [diff] [blame] | 596 | ] + cpu_select({ |
| 597 | "amd64": [ |
| 598 | "//third_party/matplotlib-cpp", |
| 599 | ], |
| 600 | "arm": [], |
| 601 | }), |
Austin Schuh | 941b46d | 2018-12-19 18:06:05 +1100 | [diff] [blame] | 602 | ) |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 603 | |
| 604 | cc_library( |
| 605 | name = "trajectory", |
| 606 | srcs = ["trajectory.cc"], |
| 607 | hdrs = ["trajectory.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 608 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 609 | deps = [ |
| 610 | ":distance_spline", |
| 611 | ":drivetrain_config", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 612 | "//frc971/control_loops:c2d", |
| 613 | "//frc971/control_loops:dlqr", |
| 614 | "//frc971/control_loops:hybrid_state_feedback_loop", |
| 615 | "//frc971/control_loops:runge_kutta", |
| 616 | "//frc971/control_loops:state_feedback_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 617 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 618 | ], |
| 619 | ) |
| 620 | |
| 621 | cc_binary( |
| 622 | name = "trajectory_plot", |
| 623 | srcs = [ |
| 624 | "trajectory_plot.cc", |
| 625 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 626 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 627 | deps = [ |
| 628 | ":distance_spline", |
| 629 | ":trajectory", |
| 630 | "//aos/logging:implementations", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 631 | "//aos/network:team_number", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 632 | "//third_party/matplotlib-cpp", |
Austin Schuh | 1104318 | 2019-03-23 22:29:12 -0700 | [diff] [blame] | 633 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 634 | "@com_github_gflags_gflags//:gflags", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 635 | "@org_tuxfamily_eigen//:eigen", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 636 | ], |
| 637 | ) |
| 638 | |
| 639 | cc_test( |
| 640 | name = "trajectory_test", |
| 641 | srcs = [ |
| 642 | "trajectory_test.cc", |
| 643 | ], |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 644 | defines = |
| 645 | cpu_select({ |
| 646 | "amd64": [ |
| 647 | "SUPPORT_PLOT=1", |
| 648 | ], |
| 649 | "arm": [], |
| 650 | }), |
| 651 | linkstatic = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 652 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 653 | deps = [ |
| 654 | ":trajectory", |
James Kuszmaul | ea314d9 | 2019-02-18 19:45:06 -0800 | [diff] [blame] | 655 | ":drivetrain_test_lib", |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 656 | "//aos/testing:googletest", |
| 657 | "//aos/testing:test_shm", |
| 658 | "//y2016:constants", |
| 659 | "//y2016/control_loops/drivetrain:polydrivetrain_plants", |
James Kuszmaul | ea314d9 | 2019-02-18 19:45:06 -0800 | [diff] [blame] | 660 | "//y2019/control_loops/drivetrain:drivetrain_base", |
Austin Schuh | 719a33e | 2019-01-07 15:13:34 -0800 | [diff] [blame] | 661 | ] + cpu_select({ |
| 662 | "amd64": [ |
| 663 | "//third_party/matplotlib-cpp", |
| 664 | ], |
| 665 | "arm": [], |
| 666 | }), |
Austin Schuh | ec7f06d | 2019-01-04 07:47:15 +1100 | [diff] [blame] | 667 | ) |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 668 | |
| 669 | cc_library( |
| 670 | name = "improved_down_estimator", |
| 671 | srcs = [ |
| 672 | "improved_down_estimator.cc", |
| 673 | ], |
| 674 | hdrs = [ |
| 675 | "improved_down_estimator.h", |
| 676 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 677 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 678 | deps = [ |
James Kuszmaul | 7f55f07 | 2020-03-01 10:21:26 -0800 | [diff] [blame] | 679 | ":drivetrain_config", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 680 | ":drivetrain_status_fbs", |
Brian Silverman | dac0a4b | 2020-06-23 17:03:09 -0700 | [diff] [blame] | 681 | "//aos/controls:quaternion_utils", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 682 | "//aos/events:event_loop", |
| 683 | "//frc971/control_loops:control_loops_fbs", |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 684 | "//frc971/control_loops:runge_kutta", |
James Kuszmaul | 3e1bb27 | 2020-01-17 18:38:19 -0800 | [diff] [blame] | 685 | "@//aos/time", |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 686 | "@com_github_google_glog//:glog", |
| 687 | "@org_tuxfamily_eigen//:eigen", |
| 688 | ], |
| 689 | ) |
| 690 | |
| 691 | cc_test( |
| 692 | name = "improved_down_estimator_test", |
| 693 | srcs = [ |
| 694 | "improved_down_estimator_test.cc", |
| 695 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 696 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 697 | deps = [ |
James Kuszmaul | 7f55f07 | 2020-03-01 10:21:26 -0800 | [diff] [blame] | 698 | ":drivetrain_test_lib", |
Brian Silverman | dac0a4b | 2020-06-23 17:03:09 -0700 | [diff] [blame] | 699 | "//aos/controls:quaternion_utils", |
Austin Schuh | ca08081 | 2017-05-10 19:31:55 -0700 | [diff] [blame] | 700 | "//aos/testing:googletest", |
| 701 | "//aos/testing:random_seed", |
| 702 | "//frc971/control_loops/drivetrain:improved_down_estimator", |
| 703 | "@org_tuxfamily_eigen//:eigen", |
| 704 | ], |
| 705 | ) |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 706 | |
| 707 | cc_library( |
| 708 | name = "camera", |
| 709 | srcs = ["camera.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 710 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 711 | visibility = ["//visibility:public"], |
| 712 | deps = [ |
| 713 | "//aos/containers:sized_array", |
| 714 | "//frc971/control_loops:pose", |
| 715 | ], |
| 716 | ) |
| 717 | |
| 718 | cc_test( |
| 719 | name = "camera_test", |
| 720 | srcs = ["camera_test.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 721 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | f4ede20 | 2020-02-14 08:47:40 -0800 | [diff] [blame] | 722 | deps = [ |
| 723 | ":camera", |
| 724 | "//aos/testing:googletest", |
| 725 | ], |
| 726 | ) |
James Kuszmaul | c4ae11c | 2020-12-26 16:26:58 -0800 | [diff] [blame] | 727 | |
| 728 | ts_library( |
| 729 | name = "drivetrain_plotter", |
| 730 | srcs = ["drivetrain_plotter.ts"], |
| 731 | target_compatible_with = ["@platforms//os:linux"], |
| 732 | deps = [ |
| 733 | "//aos/network/www:aos_plotter", |
James Kuszmaul | 933a974 | 2021-03-07 19:59:06 -0800 | [diff] [blame^] | 734 | "//aos/network/www:colors", |
James Kuszmaul | c4ae11c | 2020-12-26 16:26:58 -0800 | [diff] [blame] | 735 | "//aos/network/www:proxy", |
| 736 | "//frc971/wpilib:imu_plot_utils", |
| 737 | ], |
| 738 | ) |
milind upadhyay | 9bd381d | 2021-01-23 13:44:13 -0800 | [diff] [blame] | 739 | |
| 740 | ts_library( |
| 741 | name = "robot_state_plotter", |
| 742 | srcs = ["robot_state_plotter.ts"], |
| 743 | target_compatible_with = ["@platforms//os:linux"], |
| 744 | deps = [ |
| 745 | "//aos/network/www:aos_plotter", |
James Kuszmaul | 933a974 | 2021-03-07 19:59:06 -0800 | [diff] [blame^] | 746 | "//aos/network/www:colors", |
milind upadhyay | 9bd381d | 2021-01-23 13:44:13 -0800 | [diff] [blame] | 747 | "//aos/network/www:proxy", |
| 748 | ], |
| 749 | ) |