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