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