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