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