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