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