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 | ], |
| 51 | includes = [ |
| 52 | "//frc971/control_loops:control_loops_fbs_includes", |
| 53 | "//frc971/control_loops:profiled_subsystem_fbs_includes", |
| 54 | ], |
| 55 | target_compatible_with = ["@platforms//os:linux"], |
| 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", |
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", |
| 84 | "//aos/events:event_loop", |
| 85 | "//frc971/control_loops:control_loop", |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 86 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 87 | "//y2022:constants", |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 88 | "//y2022/control_loops/superstructure/catapult", |
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", |
| 125 | "//frc971/control_loops:team_number_test_environment", |
| 126 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
| 127 | ], |
| 128 | ) |
| 129 | |
Milind Upadhyay | 225156b | 2022-02-25 22:42:12 -0800 | [diff] [blame] | 130 | cc_library( |
| 131 | name = "collision_avoidance_lib", |
| 132 | srcs = ["collision_avoidance.cc"], |
| 133 | hdrs = ["collision_avoidance.h"], |
| 134 | target_compatible_with = ["@platforms//os:linux"], |
| 135 | deps = [ |
| 136 | ":superstructure_goal_fbs", |
| 137 | ":superstructure_status_fbs", |
| 138 | "//frc971/control_loops:control_loops_fbs", |
| 139 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 140 | "@com_github_google_glog//:glog", |
| 141 | "@com_google_absl//absl/functional:bind_front", |
| 142 | ], |
| 143 | ) |
| 144 | |
| 145 | cc_test( |
| 146 | name = "collision_avoidance_test", |
| 147 | srcs = ["collision_avoidance_test.cc"], |
| 148 | target_compatible_with = ["@platforms//os:linux"], |
| 149 | deps = [ |
| 150 | ":collision_avoidance_lib", |
| 151 | ":superstructure_goal_fbs", |
| 152 | ":superstructure_status_fbs", |
| 153 | "//aos:flatbuffers", |
| 154 | "//aos:math", |
| 155 | "//aos/testing:googletest", |
| 156 | ], |
| 157 | ) |
| 158 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 159 | ts_library( |
| 160 | name = "superstructure_plotter", |
| 161 | srcs = ["superstructure_plotter.ts"], |
| 162 | target_compatible_with = ["@platforms//os:linux"], |
| 163 | deps = [ |
| 164 | "//aos/network/www:aos_plotter", |
| 165 | "//aos/network/www:colors", |
| 166 | "//aos/network/www:proxy", |
| 167 | ], |
| 168 | ) |
Austin Schuh | 76f227c | 2022-02-23 16:34:08 -0800 | [diff] [blame] | 169 | |
| 170 | ts_library( |
| 171 | name = "catapult_plotter", |
| 172 | srcs = ["catapult_plotter.ts"], |
| 173 | target_compatible_with = ["@platforms//os:linux"], |
| 174 | deps = [ |
| 175 | "//aos/network/www:aos_plotter", |
| 176 | "//aos/network/www:colors", |
| 177 | "//aos/network/www:proxy", |
| 178 | ], |
| 179 | ) |
Milind Upadhyay | eb739bb | 2022-03-02 10:49:21 -0800 | [diff] [blame^] | 180 | |
| 181 | ts_library( |
| 182 | name = "intake_plotter", |
| 183 | srcs = ["intake_plotter.ts"], |
| 184 | target_compatible_with = ["@platforms//os:linux"], |
| 185 | deps = [ |
| 186 | "//aos/network/www:aos_plotter", |
| 187 | "//aos/network/www:colors", |
| 188 | "//aos/network/www:proxy", |
| 189 | ], |
| 190 | ) |
| 191 | |
| 192 | ts_library( |
| 193 | name = "turret_plotter", |
| 194 | srcs = ["turret_plotter.ts"], |
| 195 | target_compatible_with = ["@platforms//os:linux"], |
| 196 | deps = [ |
| 197 | "//aos/network/www:aos_plotter", |
| 198 | "//aos/network/www:colors", |
| 199 | "//aos/network/www:proxy", |
| 200 | ], |
| 201 | ) |
| 202 | |
| 203 | ts_library( |
| 204 | name = "climber_plotter", |
| 205 | srcs = ["climber_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 | ) |