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", |
| 61 | "//frc971/vision:calibration_fbs", |
| 62 | "//y2023/control_loops/drivetrain:drivetrain_can_position_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", |
| 104 | "//frc971/control_loops:control_loop", |
| 105 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
| 106 | "//y2023:constants", |
milind-u | 738832d | 2023-02-24 19:55:54 -0800 | [diff] [blame] | 107 | "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs", |
milind-u | 01bbcf2 | 2023-02-20 18:00:28 -0800 | [diff] [blame] | 108 | "//y2023/control_loops/superstructure/arm", |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 109 | "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 110 | ], |
| 111 | ) |
| 112 | |
| 113 | cc_binary( |
| 114 | name = "superstructure", |
| 115 | srcs = [ |
| 116 | "superstructure_main.cc", |
| 117 | ], |
| 118 | deps = [ |
| 119 | ":superstructure_lib", |
| 120 | "//aos:init", |
| 121 | "//aos/events:shm_event_loop", |
| 122 | ], |
| 123 | ) |
| 124 | |
| 125 | cc_test( |
| 126 | name = "superstructure_lib_test", |
| 127 | srcs = [ |
| 128 | "superstructure_lib_test.cc", |
| 129 | ], |
| 130 | data = [ |
| 131 | "//y2023:aos_config", |
| 132 | ], |
| 133 | deps = [ |
| 134 | ":superstructure_goal_fbs", |
| 135 | ":superstructure_lib", |
| 136 | ":superstructure_output_fbs", |
| 137 | ":superstructure_position_fbs", |
| 138 | ":superstructure_status_fbs", |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 139 | "//aos:json_to_flatbuffer", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 140 | "//aos:math", |
| 141 | "//aos/events/logging:log_writer", |
| 142 | "//aos/testing:googletest", |
| 143 | "//aos/time", |
| 144 | "//frc971/control_loops:capped_test_plant", |
| 145 | "//frc971/control_loops:control_loop_test", |
| 146 | "//frc971/control_loops:position_sensor_sim", |
| 147 | "//frc971/control_loops:subsystem_simulator", |
| 148 | "//frc971/control_loops:team_number_test_environment", |
| 149 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
milind-u | 18a901d | 2023-02-17 21:51:55 -0800 | [diff] [blame] | 150 | "//y2023/control_loops/superstructure/roll:roll_plants", |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 151 | "//y2023/vision:game_pieces_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 152 | ], |
| 153 | ) |
| 154 | |
| 155 | cc_binary( |
| 156 | name = "superstructure_replay", |
| 157 | srcs = ["superstructure_replay.cc"], |
| 158 | deps = [ |
| 159 | ":superstructure_lib", |
| 160 | "//aos:configuration", |
| 161 | "//aos:init", |
| 162 | "//aos/events:simulated_event_loop", |
| 163 | "//aos/events/logging:log_reader", |
| 164 | "//aos/network:team_number", |
| 165 | ], |
| 166 | ) |
| 167 | |
Philipp Schrader | 3de4dfc | 2023-02-15 20:18:25 -0800 | [diff] [blame] | 168 | ts_project( |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 169 | name = "superstructure_plotter", |
| 170 | srcs = ["superstructure_plotter.ts"], |
| 171 | target_compatible_with = ["@platforms//os:linux"], |
| 172 | deps = [ |
| 173 | "//aos/network/www:aos_plotter", |
| 174 | "//aos/network/www:colors", |
| 175 | "//aos/network/www:proxy", |
| 176 | ], |
| 177 | ) |