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