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