James (Peilun) Li | a70e575 | 2024-09-18 20:43:00 -0700 | [diff] [blame^] | 1 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
| 2 | load("//aos/flatbuffers:generate.bzl", "static_flatbuffer") |
| 3 | load("//tools/build_rules:js.bzl", "ts_project") |
| 4 | |
| 5 | package(default_visibility = ["//visibility:public"]) |
| 6 | |
| 7 | static_flatbuffer( |
| 8 | name = "superstructure_goal_fbs", |
| 9 | srcs = [ |
| 10 | "superstructure_goal.fbs", |
| 11 | ], |
| 12 | deps = [ |
| 13 | "//frc971/control_loops:control_loops_fbs", |
| 14 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 15 | ], |
| 16 | ) |
| 17 | |
| 18 | static_flatbuffer( |
| 19 | name = "superstructure_output_fbs", |
| 20 | srcs = [ |
| 21 | "superstructure_output.fbs", |
| 22 | ], |
| 23 | ) |
| 24 | |
| 25 | static_flatbuffer( |
| 26 | name = "superstructure_status_fbs", |
| 27 | srcs = [ |
| 28 | "superstructure_status.fbs", |
| 29 | ], |
| 30 | deps = [ |
| 31 | "//frc971/control_loops:control_loops_fbs", |
| 32 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 33 | ], |
| 34 | ) |
| 35 | |
| 36 | flatbuffer_ts_library( |
| 37 | name = "superstructure_status_ts_fbs", |
| 38 | srcs = [ |
| 39 | "superstructure_status.fbs", |
| 40 | ], |
| 41 | deps = [ |
| 42 | "//frc971/control_loops:control_loops_ts_fbs", |
| 43 | "//frc971/control_loops:profiled_subsystem_ts_fbs", |
| 44 | ], |
| 45 | ) |
| 46 | |
| 47 | static_flatbuffer( |
| 48 | name = "superstructure_position_fbs", |
| 49 | srcs = [ |
| 50 | "superstructure_position.fbs", |
| 51 | ], |
| 52 | deps = [ |
| 53 | "//frc971/control_loops:control_loops_fbs", |
| 54 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 55 | ], |
| 56 | ) |
| 57 | |
| 58 | flatbuffer_ts_library( |
| 59 | name = "superstructure_position_ts_fbs", |
| 60 | srcs = [ |
| 61 | "superstructure_position.fbs", |
| 62 | ], |
| 63 | deps = [ |
| 64 | "//frc971/control_loops:control_loops_ts_fbs", |
| 65 | "//frc971/control_loops:profiled_subsystem_ts_fbs", |
| 66 | ], |
| 67 | ) |
| 68 | |
| 69 | static_flatbuffer( |
| 70 | name = "superstructure_can_position_fbs", |
| 71 | srcs = ["superstructure_can_position.fbs"], |
| 72 | deps = ["//frc971/control_loops:can_talonfx_fbs"], |
| 73 | ) |
| 74 | |
| 75 | flatbuffer_ts_library( |
| 76 | name = "superstructure_can_position_ts_fbs", |
| 77 | srcs = ["superstructure_can_position.fbs"], |
| 78 | target_compatible_with = ["@platforms//os:linux"], |
| 79 | deps = ["//frc971/control_loops:can_talonfx_ts_fbs"], |
| 80 | ) |
| 81 | |
| 82 | cc_library( |
| 83 | name = "superstructure_lib", |
| 84 | srcs = [ |
| 85 | "superstructure.cc", |
| 86 | ], |
| 87 | hdrs = [ |
| 88 | "superstructure.h", |
| 89 | ], |
| 90 | data = [], |
| 91 | deps = [ |
| 92 | ":superstructure_goal_fbs", |
| 93 | ":superstructure_output_fbs", |
| 94 | ":superstructure_position_fbs", |
| 95 | ":superstructure_status_fbs", |
| 96 | "//aos:flatbuffer_merge", |
| 97 | "//aos/events:event_loop", |
| 98 | "//frc971/constants:constants_sender_lib", |
| 99 | "//frc971/control_loops:control_loop", |
| 100 | "//frc971/zeroing:absolute_encoder", |
| 101 | "//frc971/zeroing:pot_and_absolute_encoder", |
| 102 | "//y2024_bot3:constants", |
| 103 | "//y2024_bot3/constants:constants_fbs", |
| 104 | "//y2024_bot3/constants:simulated_constants_sender", |
| 105 | ], |
| 106 | ) |
| 107 | |
| 108 | cc_binary( |
| 109 | name = "superstructure", |
| 110 | srcs = [ |
| 111 | "superstructure_main.cc", |
| 112 | ], |
| 113 | deps = [ |
| 114 | ":superstructure_lib", |
| 115 | "//aos:init", |
| 116 | "//aos/events:shm_event_loop", |
| 117 | ], |
| 118 | ) |
| 119 | |
| 120 | cc_test( |
| 121 | name = "superstructure_lib_test", |
| 122 | srcs = [ |
| 123 | "superstructure_lib_test.cc", |
| 124 | ], |
| 125 | data = [ |
| 126 | "//y2024_bot3:aos_config", |
| 127 | ], |
| 128 | deps = [ |
| 129 | ":superstructure_can_position_fbs", |
| 130 | ":superstructure_goal_fbs", |
| 131 | ":superstructure_lib", |
| 132 | ":superstructure_output_fbs", |
| 133 | ":superstructure_position_fbs", |
| 134 | ":superstructure_status_fbs", |
| 135 | "//aos:json_to_flatbuffer", |
| 136 | "//aos:math", |
| 137 | "//aos/events/logging:log_writer", |
| 138 | "//aos/testing:googletest", |
| 139 | "//aos/time", |
| 140 | "//frc971/control_loops:capped_test_plant", |
| 141 | "//frc971/control_loops:control_loop_test", |
| 142 | "//frc971/control_loops:position_sensor_sim", |
| 143 | "//frc971/control_loops:subsystem_simulator", |
| 144 | "//frc971/control_loops:team_number_test_environment", |
| 145 | ], |
| 146 | ) |
| 147 | |
| 148 | cc_binary( |
| 149 | name = "superstructure_replay", |
| 150 | srcs = ["superstructure_replay.cc"], |
| 151 | deps = [ |
| 152 | ":superstructure_lib", |
| 153 | "//aos:configuration", |
| 154 | "//aos:init", |
| 155 | "//aos/events:simulated_event_loop", |
| 156 | "//aos/events/logging:log_reader", |
| 157 | "//aos/network:team_number", |
| 158 | ], |
| 159 | ) |
| 160 | |
| 161 | ts_project( |
| 162 | name = "superstructure_plotter", |
| 163 | srcs = ["superstructure_plotter.ts"], |
| 164 | target_compatible_with = ["@platforms//os:linux"], |
| 165 | deps = [ |
| 166 | "//aos/network/www:aos_plotter", |
| 167 | "//aos/network/www:colors", |
| 168 | "//aos/network/www:proxy", |
| 169 | ], |
| 170 | ) |