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