James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 1 | load("//aos/flatbuffers:generate.bzl", "static_flatbuffer") |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 2 | load("//tools/build_rules:js.bzl", "ts_project") |
Austin Schuh | a1d006e | 2022-09-14 21:50:42 -0700 | [diff] [blame] | 3 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 4 | |
| 5 | package(default_visibility = ["//visibility:public"]) |
| 6 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 7 | static_flatbuffer( |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 8 | name = "superstructure_goal_fbs", |
| 9 | srcs = [ |
| 10 | "superstructure_goal.fbs", |
| 11 | ], |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 12 | deps = [ |
| 13 | "//frc971/control_loops:control_loops_fbs", |
| 14 | "//frc971/control_loops:profiled_subsystem_fbs", |
Nathan Leong | dd72800 | 2024-02-03 15:26:53 -0800 | [diff] [blame] | 15 | "//frc971/control_loops/catapult:catapult_goal_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 16 | ], |
| 17 | ) |
| 18 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 19 | static_flatbuffer( |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 20 | name = "superstructure_output_fbs", |
| 21 | srcs = [ |
| 22 | "superstructure_output.fbs", |
| 23 | ], |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 24 | ) |
| 25 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 26 | static_flatbuffer( |
Milind Upadhyay | 482b0ba | 2022-02-26 21:51:59 -0800 | [diff] [blame] | 27 | name = "superstructure_can_position_fbs", |
| 28 | srcs = [ |
| 29 | "superstructure_can_position.fbs", |
| 30 | ], |
Milind Upadhyay | 482b0ba | 2022-02-26 21:51:59 -0800 | [diff] [blame] | 31 | ) |
| 32 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 33 | static_flatbuffer( |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 34 | name = "superstructure_status_fbs", |
| 35 | srcs = [ |
| 36 | "superstructure_status.fbs", |
| 37 | ], |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 38 | deps = [ |
| 39 | "//frc971/control_loops:control_loops_fbs", |
| 40 | "//frc971/control_loops:profiled_subsystem_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 41 | ], |
| 42 | ) |
| 43 | |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 44 | flatbuffer_ts_library( |
| 45 | name = "superstructure_status_ts_fbs", |
| 46 | srcs = [ |
| 47 | "superstructure_status.fbs", |
| 48 | ], |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 49 | deps = [ |
| 50 | "//frc971/control_loops:control_loops_ts_fbs", |
| 51 | "//frc971/control_loops:profiled_subsystem_ts_fbs", |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 52 | ], |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 53 | ) |
| 54 | |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 55 | static_flatbuffer( |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 56 | name = "superstructure_position_fbs", |
| 57 | srcs = [ |
| 58 | "superstructure_position.fbs", |
| 59 | ], |
James Kuszmaul | f01da39 | 2023-12-14 11:22:14 -0800 | [diff] [blame] | 60 | deps = [ |
| 61 | "//frc971/control_loops:control_loops_fbs", |
| 62 | "//frc971/control_loops:profiled_subsystem_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 63 | ], |
| 64 | ) |
| 65 | |
| 66 | cc_library( |
| 67 | name = "superstructure_lib", |
| 68 | srcs = [ |
| 69 | "superstructure.cc", |
| 70 | ], |
| 71 | hdrs = [ |
| 72 | "superstructure.h", |
| 73 | ], |
| 74 | deps = [ |
Milind Upadhyay | 225156b | 2022-02-25 22:42:12 -0800 | [diff] [blame] | 75 | ":collision_avoidance_lib", |
Ravago Jones | 5da0635 | 2022-03-04 20:26:24 -0800 | [diff] [blame] | 76 | ":superstructure_can_position_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 77 | ":superstructure_goal_fbs", |
| 78 | ":superstructure_output_fbs", |
| 79 | ":superstructure_position_fbs", |
| 80 | ":superstructure_status_fbs", |
Ravago Jones | 3283ce0 | 2022-03-09 19:31:29 -0800 | [diff] [blame] | 81 | "//aos:flatbuffer_merge", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 82 | "//aos/events:event_loop", |
| 83 | "//frc971/control_loops:control_loop", |
Nathan Leong | dd72800 | 2024-02-03 15:26:53 -0800 | [diff] [blame] | 84 | "//frc971/control_loops/catapult", |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 85 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
James Kuszmaul | ec635d2 | 2023-08-12 18:39:24 -0700 | [diff] [blame] | 86 | "//frc971/zeroing:pot_and_absolute_encoder", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 87 | "//y2022:constants", |
James Kuszmaul | 84083f4 | 2022-02-27 17:24:38 -0800 | [diff] [blame] | 88 | "//y2022/control_loops/superstructure/turret:aiming", |
Ravago Jones | d51af7a | 2022-03-26 21:44:20 -0700 | [diff] [blame] | 89 | "//y2022/vision:ball_color_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 90 | ], |
| 91 | ) |
| 92 | |
| 93 | cc_binary( |
| 94 | name = "superstructure", |
| 95 | srcs = [ |
| 96 | "superstructure_main.cc", |
| 97 | ], |
| 98 | deps = [ |
| 99 | ":superstructure_lib", |
| 100 | "//aos:init", |
| 101 | "//aos/events:shm_event_loop", |
| 102 | ], |
| 103 | ) |
| 104 | |
| 105 | cc_test( |
| 106 | name = "superstructure_lib_test", |
| 107 | srcs = [ |
| 108 | "superstructure_lib_test.cc", |
| 109 | ], |
| 110 | data = [ |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 111 | "//y2022:aos_config", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 112 | ], |
| 113 | deps = [ |
| 114 | ":superstructure_goal_fbs", |
| 115 | ":superstructure_lib", |
| 116 | ":superstructure_output_fbs", |
| 117 | ":superstructure_position_fbs", |
| 118 | ":superstructure_status_fbs", |
| 119 | "//aos:math", |
| 120 | "//aos/events/logging:log_writer", |
| 121 | "//aos/testing:googletest", |
| 122 | "//aos/time", |
| 123 | "//frc971/control_loops:capped_test_plant", |
| 124 | "//frc971/control_loops:control_loop_test", |
| 125 | "//frc971/control_loops:position_sensor_sim", |
Niko Sohmers | e69ee2d | 2022-09-28 19:52:27 -0700 | [diff] [blame] | 126 | "//frc971/control_loops:subsystem_simulator", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 127 | "//frc971/control_loops:team_number_test_environment", |
| 128 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
| 129 | ], |
| 130 | ) |
| 131 | |
Milind Upadhyay | 9d68b13 | 2022-04-01 10:58:18 -0700 | [diff] [blame] | 132 | cc_binary( |
| 133 | name = "superstructure_replay", |
| 134 | srcs = ["superstructure_replay.cc"], |
| 135 | deps = [ |
| 136 | ":superstructure_lib", |
| 137 | "//aos:configuration", |
| 138 | "//aos:init", |
| 139 | "//aos/events:simulated_event_loop", |
| 140 | "//aos/events/logging:log_reader", |
| 141 | "//aos/network:team_number", |
| 142 | ], |
| 143 | ) |
| 144 | |
Milind Upadhyay | 225156b | 2022-02-25 22:42:12 -0800 | [diff] [blame] | 145 | cc_library( |
| 146 | name = "collision_avoidance_lib", |
| 147 | srcs = ["collision_avoidance.cc"], |
| 148 | hdrs = ["collision_avoidance.h"], |
| 149 | target_compatible_with = ["@platforms//os:linux"], |
| 150 | deps = [ |
| 151 | ":superstructure_goal_fbs", |
| 152 | ":superstructure_status_fbs", |
| 153 | "//frc971/control_loops:control_loops_fbs", |
| 154 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 155 | "@com_github_google_glog//:glog", |
| 156 | "@com_google_absl//absl/functional:bind_front", |
| 157 | ], |
| 158 | ) |
| 159 | |
| 160 | cc_test( |
| 161 | name = "collision_avoidance_test", |
| 162 | srcs = ["collision_avoidance_test.cc"], |
| 163 | target_compatible_with = ["@platforms//os:linux"], |
| 164 | deps = [ |
| 165 | ":collision_avoidance_lib", |
| 166 | ":superstructure_goal_fbs", |
| 167 | ":superstructure_status_fbs", |
| 168 | "//aos:flatbuffers", |
| 169 | "//aos:math", |
| 170 | "//aos/testing:googletest", |
| 171 | ], |
| 172 | ) |
| 173 | |
Henry Speiser | 77747b7 | 2022-03-06 17:18:29 -0800 | [diff] [blame] | 174 | cc_library( |
| 175 | name = "led_indicator_lib", |
| 176 | srcs = ["led_indicator.cc"], |
| 177 | hdrs = ["led_indicator.h"], |
| 178 | data = [ |
| 179 | "@ctre_phoenix_api_cpp_athena//:shared_libraries", |
| 180 | "@ctre_phoenix_cci_athena//:shared_libraries", |
| 181 | ], |
| 182 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 183 | deps = [ |
| 184 | ":superstructure_output_fbs", |
| 185 | ":superstructure_status_fbs", |
| 186 | "//aos/events:event_loop", |
Henry Speiser | 888c196 | 2022-03-16 20:54:56 -0700 | [diff] [blame] | 187 | "//aos/network:message_bridge_client_fbs", |
Henry Speiser | 77747b7 | 2022-03-06 17:18:29 -0800 | [diff] [blame] | 188 | "//aos/network:message_bridge_server_fbs", |
| 189 | "//frc971/control_loops:control_loop", |
| 190 | "//frc971/control_loops:control_loops_fbs", |
| 191 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 192 | "//frc971/control_loops/drivetrain:drivetrain_output_fbs", |
James Kuszmaul | e3df1ed | 2023-02-20 16:21:17 -0800 | [diff] [blame] | 193 | "//frc971/control_loops/drivetrain/localization:localizer_output_fbs", |
Henry Speiser | e562e32 | 2022-04-01 16:09:32 -0700 | [diff] [blame] | 194 | "//frc971/queues:gyro_fbs", |
Henry Speiser | 77747b7 | 2022-03-06 17:18:29 -0800 | [diff] [blame] | 195 | "//third_party:phoenix", |
| 196 | "//third_party:wpilib", |
| 197 | ], |
| 198 | ) |
| 199 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 200 | ts_project( |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 201 | name = "superstructure_plotter", |
| 202 | srcs = ["superstructure_plotter.ts"], |
| 203 | target_compatible_with = ["@platforms//os:linux"], |
| 204 | deps = [ |
| 205 | "//aos/network/www:aos_plotter", |
| 206 | "//aos/network/www:colors", |
| 207 | "//aos/network/www:proxy", |
| 208 | ], |
| 209 | ) |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 210 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 211 | ts_project( |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 212 | name = "catapult_plotter", |
| 213 | srcs = ["catapult_plotter.ts"], |
| 214 | target_compatible_with = ["@platforms//os:linux"], |
| 215 | deps = [ |
| 216 | "//aos/network/www:aos_plotter", |
| 217 | "//aos/network/www:colors", |
| 218 | "//aos/network/www:proxy", |
| 219 | ], |
| 220 | ) |
Milind Upadhyay | eb739bb | 2022-03-02 10:49:21 -0800 | [diff] [blame] | 221 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 222 | ts_project( |
Milind Upadhyay | eb739bb | 2022-03-02 10:49:21 -0800 | [diff] [blame] | 223 | name = "intake_plotter", |
| 224 | srcs = ["intake_plotter.ts"], |
| 225 | target_compatible_with = ["@platforms//os:linux"], |
| 226 | deps = [ |
| 227 | "//aos/network/www:aos_plotter", |
| 228 | "//aos/network/www:colors", |
| 229 | "//aos/network/www:proxy", |
| 230 | ], |
| 231 | ) |
| 232 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 233 | ts_project( |
Milind Upadhyay | eb739bb | 2022-03-02 10:49:21 -0800 | [diff] [blame] | 234 | name = "turret_plotter", |
| 235 | srcs = ["turret_plotter.ts"], |
| 236 | target_compatible_with = ["@platforms//os:linux"], |
| 237 | deps = [ |
| 238 | "//aos/network/www:aos_plotter", |
| 239 | "//aos/network/www:colors", |
| 240 | "//aos/network/www:proxy", |
| 241 | ], |
| 242 | ) |
| 243 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 244 | ts_project( |
Milind Upadhyay | eb739bb | 2022-03-02 10:49:21 -0800 | [diff] [blame] | 245 | name = "climber_plotter", |
| 246 | srcs = ["climber_plotter.ts"], |
| 247 | target_compatible_with = ["@platforms//os:linux"], |
| 248 | deps = [ |
| 249 | "//aos/network/www:aos_plotter", |
| 250 | "//aos/network/www:colors", |
| 251 | "//aos/network/www:proxy", |
| 252 | ], |
| 253 | ) |