blob: 91fca1d8e2a1abb319f037bab95ce0b58a082ba4 [file] [log] [blame]
Austin Schuh8f99c822024-05-05 22:43:40 -07001load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
James Kuszmaulf01da392023-12-14 11:22:14 -08002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08003load("//tools/build_rules:js.bzl", "ts_project")
Maxwell Hendersonad312342023-01-10 12:07:47 -08004
5package(default_visibility = ["//visibility:public"])
6
James Kuszmaulf01da392023-12-14 11:22:14 -08007static_flatbuffer(
Maxwell Hendersonad312342023-01-10 12:07:47 -08008 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
James Kuszmaul202e4382023-03-05 14:56:55 -080012 deps = [
13 "//frc971/control_loops:control_loops_fbs",
14 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080015 ],
16)
17
James Kuszmaulf01da392023-12-14 11:22:14 -080018static_flatbuffer(
Maxwell Hendersonad312342023-01-10 12:07:47 -080019 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
Maxwell Hendersonad312342023-01-10 12:07:47 -080023)
24
James Kuszmaulf01da392023-12-14 11:22:14 -080025static_flatbuffer(
Maxwell Hendersonad312342023-01-10 12:07:47 -080026 name = "superstructure_status_fbs",
27 srcs = [
28 "superstructure_status.fbs",
29 ],
James Kuszmaul202e4382023-03-05 14:56:55 -080030 deps = [
31 "//frc971/control_loops:control_loops_fbs",
32 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080033 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080034 ],
35)
36
37flatbuffer_ts_library(
38 name = "superstructure_status_ts_fbs",
39 srcs = [
40 "superstructure_status.fbs",
41 ],
42 deps = [
43 "//frc971/control_loops:control_loops_ts_fbs",
44 "//frc971/control_loops:profiled_subsystem_ts_fbs",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080045 "//y2023/vision:game_pieces_ts_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080046 ],
47)
48
James Kuszmaulf01da392023-12-14 11:22:14 -080049static_flatbuffer(
Maxwell Hendersonad312342023-01-10 12:07:47 -080050 name = "superstructure_position_fbs",
51 srcs = [
52 "superstructure_position.fbs",
53 ],
James Kuszmaul202e4382023-03-05 14:56:55 -080054 deps = [
55 "//frc971/control_loops:control_loops_fbs",
56 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersoncef6f042023-05-26 14:38:09 -070057 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
James Kuszmaul202e4382023-03-05 14:56:55 -080058 "//frc971/vision:calibration_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080059 ],
60)
61
62cc_library(
Maxwell Henderson589cf272023-02-22 15:56:40 -080063 name = "end_effector",
64 srcs = [
65 "end_effector.cc",
66 ],
67 hdrs = [
68 "end_effector.h",
69 ],
70 deps = [
71 ":superstructure_goal_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080072 ":superstructure_status_fbs",
73 "//aos/events:event_loop",
74 "//aos/time",
75 "//frc971/control_loops:control_loop",
76 "//y2023:constants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080077 "//y2023/vision:game_pieces_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080078 ],
79)
80
81cc_library(
Maxwell Hendersonad312342023-01-10 12:07:47 -080082 name = "superstructure_lib",
83 srcs = [
84 "superstructure.cc",
85 ],
86 hdrs = [
87 "superstructure.h",
88 ],
Maxwell Hendersonb392b742023-03-05 07:53:51 -080089 data = [
90 "//y2023/control_loops/superstructure/arm:arm_trajectories_generated.bfbs",
91 ],
Maxwell Hendersonad312342023-01-10 12:07:47 -080092 deps = [
Maxwell Henderson589cf272023-02-22 15:56:40 -080093 ":end_effector",
Maxwell Hendersonad312342023-01-10 12:07:47 -080094 ":superstructure_goal_fbs",
95 ":superstructure_output_fbs",
96 ":superstructure_position_fbs",
97 ":superstructure_status_fbs",
98 "//aos:flatbuffer_merge",
99 "//aos/events:event_loop",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800100 "//frc971/constants:constants_sender_lib",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800101 "//frc971/control_loops:control_loop",
Maxwell Hendersoncef6f042023-05-26 14:38:09 -0700102 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800103 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800104 "//frc971/shooter_interpolation:interpolation",
James Kuszmaulec635d22023-08-12 18:39:24 -0700105 "//frc971/zeroing:absolute_encoder",
106 "//frc971/zeroing:pot_and_absolute_encoder",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800107 "//y2023:constants",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800108 "//y2023/constants:constants_fbs",
109 "//y2023/constants:simulated_constants_sender",
milind-u01bbcf22023-02-20 18:00:28 -0800110 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800111 "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800112 ],
113)
114
115cc_binary(
116 name = "superstructure",
117 srcs = [
118 "superstructure_main.cc",
119 ],
120 deps = [
121 ":superstructure_lib",
122 "//aos:init",
123 "//aos/events:shm_event_loop",
124 ],
125)
126
127cc_test(
128 name = "superstructure_lib_test",
129 srcs = [
130 "superstructure_lib_test.cc",
131 ],
132 data = [
133 "//y2023:aos_config",
134 ],
135 deps = [
136 ":superstructure_goal_fbs",
137 ":superstructure_lib",
138 ":superstructure_output_fbs",
139 ":superstructure_position_fbs",
140 ":superstructure_status_fbs",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800141 "//aos:json_to_flatbuffer",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800142 "//aos:math",
143 "//aos/events/logging:log_writer",
144 "//aos/testing:googletest",
145 "//aos/time",
146 "//frc971/control_loops:capped_test_plant",
147 "//frc971/control_loops:control_loop_test",
148 "//frc971/control_loops:position_sensor_sim",
149 "//frc971/control_loops:subsystem_simulator",
150 "//frc971/control_loops:team_number_test_environment",
151 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u18a901d2023-02-17 21:51:55 -0800152 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -0800153 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800154 ],
155)
156
Maxwell Henderson76391142023-03-11 12:04:45 -0800157cc_library(
158 name = "led_indicator_lib",
159 srcs = ["led_indicator.cc"],
160 hdrs = ["led_indicator.h"],
161 data = [
162 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
163 "@ctre_phoenix_cci_athena//:shared_libraries",
164 ],
165 target_compatible_with = ["//tools/platforms/hardware:roborio"],
166 deps = [
Austin Schuhe2663ee2023-03-25 20:02:06 -0700167 ":superstructure_goal_fbs",
Maxwell Henderson76391142023-03-11 12:04:45 -0800168 ":superstructure_output_fbs",
169 ":superstructure_position_fbs",
170 ":superstructure_status_fbs",
171 "//aos/events:event_loop",
172 "//aos/network:message_bridge_client_fbs",
173 "//aos/network:message_bridge_server_fbs",
174 "//frc971/control_loops:control_loop",
175 "//frc971/control_loops:control_loops_fbs",
176 "//frc971/control_loops:profiled_subsystem_fbs",
177 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
178 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
179 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
180 "//frc971/queues:gyro_fbs",
181 "//third_party:phoenix",
182 "//third_party:wpilib",
183 "//y2023/vision:game_pieces_fbs",
184 ],
185)
186
Maxwell Hendersonad312342023-01-10 12:07:47 -0800187cc_binary(
188 name = "superstructure_replay",
189 srcs = ["superstructure_replay.cc"],
190 deps = [
191 ":superstructure_lib",
192 "//aos:configuration",
193 "//aos:init",
194 "//aos/events:simulated_event_loop",
195 "//aos/events/logging:log_reader",
196 "//aos/network:team_number",
197 ],
198)
199
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800200ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800201 name = "superstructure_plotter",
202 srcs = ["superstructure_plotter.ts"],
203 target_compatible_with = ["@platforms//os:linux"],
204 deps = [
205 "//aos/network/www:aos_plotter",
206 "//aos/network/www:colors",
207 "//aos/network/www:proxy",
208 ],
209)