Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 1 | load("//tools/build_rules:js.bzl", "ts_project") |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [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") |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -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, |
James Kuszmaul | 202e438 | 2023-03-05 14:56:55 -0800 | [diff] [blame] | 13 | deps = [ |
| 14 | "//frc971/control_loops:control_loops_fbs", |
| 15 | "//frc971/control_loops:profiled_subsystem_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 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( |
| 28 | name = "superstructure_status_fbs", |
| 29 | srcs = [ |
| 30 | "superstructure_status.fbs", |
| 31 | ], |
| 32 | gen_reflections = 1, |
James Kuszmaul | 202e438 | 2023-03-05 14:56:55 -0800 | [diff] [blame] | 33 | deps = [ |
| 34 | "//frc971/control_loops:control_loops_fbs", |
| 35 | "//frc971/control_loops:profiled_subsystem_fbs", |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 36 | "//y2023/vision:game_pieces_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 37 | ], |
| 38 | ) |
| 39 | |
| 40 | flatbuffer_ts_library( |
| 41 | name = "superstructure_status_ts_fbs", |
| 42 | srcs = [ |
| 43 | "superstructure_status.fbs", |
| 44 | ], |
| 45 | deps = [ |
| 46 | "//frc971/control_loops:control_loops_ts_fbs", |
| 47 | "//frc971/control_loops:profiled_subsystem_ts_fbs", |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 48 | "//y2023/vision:game_pieces_ts_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 49 | ], |
| 50 | ) |
| 51 | |
| 52 | flatbuffer_cc_library( |
| 53 | name = "superstructure_position_fbs", |
| 54 | srcs = [ |
| 55 | "superstructure_position.fbs", |
| 56 | ], |
| 57 | gen_reflections = 1, |
James Kuszmaul | 202e438 | 2023-03-05 14:56:55 -0800 | [diff] [blame] | 58 | deps = [ |
| 59 | "//frc971/control_loops:control_loops_fbs", |
| 60 | "//frc971/control_loops:profiled_subsystem_fbs", |
Maxwell Henderson | cef6f04 | 2023-05-26 14:38:09 -0700 | [diff] [blame] | 61 | "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs", |
James Kuszmaul | 202e438 | 2023-03-05 14:56:55 -0800 | [diff] [blame] | 62 | "//frc971/vision:calibration_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 63 | ], |
| 64 | ) |
| 65 | |
| 66 | cc_library( |
Maxwell Henderson | 589cf27 | 2023-02-22 15:56:40 -0800 | [diff] [blame] | 67 | name = "end_effector", |
| 68 | srcs = [ |
| 69 | "end_effector.cc", |
| 70 | ], |
| 71 | hdrs = [ |
| 72 | "end_effector.h", |
| 73 | ], |
| 74 | deps = [ |
| 75 | ":superstructure_goal_fbs", |
Maxwell Henderson | 589cf27 | 2023-02-22 15:56:40 -0800 | [diff] [blame] | 76 | ":superstructure_status_fbs", |
| 77 | "//aos/events:event_loop", |
| 78 | "//aos/time", |
| 79 | "//frc971/control_loops:control_loop", |
| 80 | "//y2023:constants", |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 81 | "//y2023/vision:game_pieces_fbs", |
Maxwell Henderson | 589cf27 | 2023-02-22 15:56:40 -0800 | [diff] [blame] | 82 | ], |
| 83 | ) |
| 84 | |
| 85 | cc_library( |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 86 | name = "superstructure_lib", |
| 87 | srcs = [ |
| 88 | "superstructure.cc", |
| 89 | ], |
| 90 | hdrs = [ |
| 91 | "superstructure.h", |
| 92 | ], |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 93 | data = [ |
| 94 | "//y2023/control_loops/superstructure/arm:arm_trajectories_generated.bfbs", |
| 95 | ], |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 96 | deps = [ |
Maxwell Henderson | 589cf27 | 2023-02-22 15:56:40 -0800 | [diff] [blame] | 97 | ":end_effector", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 98 | ":superstructure_goal_fbs", |
| 99 | ":superstructure_output_fbs", |
| 100 | ":superstructure_position_fbs", |
| 101 | ":superstructure_status_fbs", |
| 102 | "//aos:flatbuffer_merge", |
| 103 | "//aos/events:event_loop", |
James Kuszmaul | cf451fb | 2023-03-10 20:42:36 -0800 | [diff] [blame] | 104 | "//frc971/constants:constants_sender_lib", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 105 | "//frc971/control_loops:control_loop", |
Maxwell Henderson | cef6f04 | 2023-05-26 14:38:09 -0700 | [diff] [blame] | 106 | "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 107 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
James Kuszmaul | cf451fb | 2023-03-10 20:42:36 -0800 | [diff] [blame] | 108 | "//frc971/shooter_interpolation:interpolation", |
James Kuszmaul | ec635d2 | 2023-08-12 18:39:24 -0700 | [diff] [blame^] | 109 | "//frc971/zeroing:absolute_encoder", |
| 110 | "//frc971/zeroing:pot_and_absolute_encoder", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 111 | "//y2023:constants", |
James Kuszmaul | cf451fb | 2023-03-10 20:42:36 -0800 | [diff] [blame] | 112 | "//y2023/constants:constants_fbs", |
| 113 | "//y2023/constants:simulated_constants_sender", |
milind-u | 01bbcf2 | 2023-02-20 18:00:28 -0800 | [diff] [blame] | 114 | "//y2023/control_loops/superstructure/arm", |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 115 | "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 116 | ], |
| 117 | ) |
| 118 | |
| 119 | cc_binary( |
| 120 | name = "superstructure", |
| 121 | srcs = [ |
| 122 | "superstructure_main.cc", |
| 123 | ], |
| 124 | deps = [ |
| 125 | ":superstructure_lib", |
| 126 | "//aos:init", |
| 127 | "//aos/events:shm_event_loop", |
| 128 | ], |
| 129 | ) |
| 130 | |
| 131 | cc_test( |
| 132 | name = "superstructure_lib_test", |
| 133 | srcs = [ |
| 134 | "superstructure_lib_test.cc", |
| 135 | ], |
| 136 | data = [ |
| 137 | "//y2023:aos_config", |
| 138 | ], |
| 139 | deps = [ |
| 140 | ":superstructure_goal_fbs", |
| 141 | ":superstructure_lib", |
| 142 | ":superstructure_output_fbs", |
| 143 | ":superstructure_position_fbs", |
| 144 | ":superstructure_status_fbs", |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 145 | "//aos:json_to_flatbuffer", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 146 | "//aos:math", |
| 147 | "//aos/events/logging:log_writer", |
| 148 | "//aos/testing:googletest", |
| 149 | "//aos/time", |
| 150 | "//frc971/control_loops:capped_test_plant", |
| 151 | "//frc971/control_loops:control_loop_test", |
| 152 | "//frc971/control_loops:position_sensor_sim", |
| 153 | "//frc971/control_loops:subsystem_simulator", |
| 154 | "//frc971/control_loops:team_number_test_environment", |
| 155 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 156 | "//y2023/control_loops/superstructure/roll:roll_plants", |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 157 | "//y2023/vision:game_pieces_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 158 | ], |
| 159 | ) |
| 160 | |
Maxwell Henderson | 7639114 | 2023-03-11 12:04:45 -0800 | [diff] [blame] | 161 | cc_library( |
| 162 | name = "led_indicator_lib", |
| 163 | srcs = ["led_indicator.cc"], |
| 164 | hdrs = ["led_indicator.h"], |
| 165 | data = [ |
| 166 | "@ctre_phoenix_api_cpp_athena//:shared_libraries", |
| 167 | "@ctre_phoenix_cci_athena//:shared_libraries", |
| 168 | ], |
| 169 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 170 | deps = [ |
Austin Schuh | e2663ee | 2023-03-25 20:02:06 -0700 | [diff] [blame] | 171 | ":superstructure_goal_fbs", |
Maxwell Henderson | 7639114 | 2023-03-11 12:04:45 -0800 | [diff] [blame] | 172 | ":superstructure_output_fbs", |
| 173 | ":superstructure_position_fbs", |
| 174 | ":superstructure_status_fbs", |
| 175 | "//aos/events:event_loop", |
| 176 | "//aos/network:message_bridge_client_fbs", |
| 177 | "//aos/network:message_bridge_server_fbs", |
| 178 | "//frc971/control_loops:control_loop", |
| 179 | "//frc971/control_loops:control_loops_fbs", |
| 180 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 181 | "//frc971/control_loops/drivetrain:drivetrain_output_fbs", |
| 182 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
| 183 | "//frc971/control_loops/drivetrain/localization:localizer_output_fbs", |
| 184 | "//frc971/queues:gyro_fbs", |
| 185 | "//third_party:phoenix", |
| 186 | "//third_party:wpilib", |
| 187 | "//y2023/vision:game_pieces_fbs", |
| 188 | ], |
| 189 | ) |
| 190 | |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 191 | cc_binary( |
| 192 | name = "superstructure_replay", |
| 193 | srcs = ["superstructure_replay.cc"], |
| 194 | deps = [ |
| 195 | ":superstructure_lib", |
| 196 | "//aos:configuration", |
| 197 | "//aos:init", |
| 198 | "//aos/events:simulated_event_loop", |
| 199 | "//aos/events/logging:log_reader", |
| 200 | "//aos/network:team_number", |
| 201 | ], |
| 202 | ) |
| 203 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 204 | ts_project( |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 205 | name = "superstructure_plotter", |
| 206 | srcs = ["superstructure_plotter.ts"], |
| 207 | target_compatible_with = ["@platforms//os:linux"], |
| 208 | deps = [ |
| 209 | "//aos/network/www:aos_plotter", |
| 210 | "//aos/network/www:colors", |
| 211 | "//aos/network/www:proxy", |
| 212 | ], |
| 213 | ) |