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