blob: 3d35dae8f6b37379bbe04b402845783a1c34a158 [file] [log] [blame]
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08001load("//tools/build_rules:js.bzl", "ts_project")
Maxwell Hendersonad312342023-01-10 12:07:47 -08002load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
3load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Maxwell Hendersonad312342023-01-10 12:07:47 -08004
5package(default_visibility = ["//visibility:public"])
6
7flatbuffer_cc_library(
8 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
12 gen_reflections = 1,
James Kuszmaul202e4382023-03-05 14:56:55 -080013 deps = [
14 "//frc971/control_loops:control_loops_fbs",
15 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080016 ],
17)
18
19flatbuffer_cc_library(
20 name = "superstructure_output_fbs",
21 srcs = [
22 "superstructure_output.fbs",
23 ],
24 gen_reflections = 1,
25)
26
27flatbuffer_cc_library(
28 name = "superstructure_status_fbs",
29 srcs = [
30 "superstructure_status.fbs",
31 ],
32 gen_reflections = 1,
James Kuszmaul202e4382023-03-05 14:56:55 -080033 deps = [
34 "//frc971/control_loops:control_loops_fbs",
35 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080036 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080037 ],
38)
39
40flatbuffer_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 Hendersonbf1bcec2023-03-05 18:00:20 -080048 "//y2023/vision:game_pieces_ts_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080049 ],
50)
51
52flatbuffer_cc_library(
53 name = "superstructure_position_fbs",
54 srcs = [
55 "superstructure_position.fbs",
56 ],
57 gen_reflections = 1,
James Kuszmaul202e4382023-03-05 14:56:55 -080058 deps = [
59 "//frc971/control_loops:control_loops_fbs",
60 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersoncef6f042023-05-26 14:38:09 -070061 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
James Kuszmaul202e4382023-03-05 14:56:55 -080062 "//frc971/vision:calibration_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080063 ],
64)
65
66cc_library(
Maxwell Henderson589cf272023-02-22 15:56:40 -080067 name = "end_effector",
68 srcs = [
69 "end_effector.cc",
70 ],
71 hdrs = [
72 "end_effector.h",
73 ],
74 deps = [
75 ":superstructure_goal_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080076 ":superstructure_status_fbs",
77 "//aos/events:event_loop",
78 "//aos/time",
79 "//frc971/control_loops:control_loop",
80 "//y2023:constants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080081 "//y2023/vision:game_pieces_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080082 ],
83)
84
85cc_library(
Maxwell Hendersonad312342023-01-10 12:07:47 -080086 name = "superstructure_lib",
87 srcs = [
88 "superstructure.cc",
89 ],
90 hdrs = [
91 "superstructure.h",
92 ],
Maxwell Hendersonb392b742023-03-05 07:53:51 -080093 data = [
94 "//y2023/control_loops/superstructure/arm:arm_trajectories_generated.bfbs",
95 ],
Maxwell Hendersonad312342023-01-10 12:07:47 -080096 deps = [
Maxwell Henderson589cf272023-02-22 15:56:40 -080097 ":end_effector",
Maxwell Hendersonad312342023-01-10 12:07:47 -080098 ":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 Kuszmaulcf451fb2023-03-10 20:42:36 -0800104 "//frc971/constants:constants_sender_lib",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800105 "//frc971/control_loops:control_loop",
Maxwell Hendersoncef6f042023-05-26 14:38:09 -0700106 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800107 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800108 "//frc971/shooter_interpolation:interpolation",
James Kuszmaulec635d22023-08-12 18:39:24 -0700109 "//frc971/zeroing:absolute_encoder",
110 "//frc971/zeroing:pot_and_absolute_encoder",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800111 "//y2023:constants",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800112 "//y2023/constants:constants_fbs",
113 "//y2023/constants:simulated_constants_sender",
milind-u01bbcf22023-02-20 18:00:28 -0800114 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800115 "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800116 ],
117)
118
119cc_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
131cc_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 Hendersonb392b742023-03-05 07:53:51 -0800145 "//aos:json_to_flatbuffer",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800146 "//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-u18a901d2023-02-17 21:51:55 -0800156 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -0800157 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800158 ],
159)
160
Maxwell Henderson76391142023-03-11 12:04:45 -0800161cc_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 Schuhe2663ee2023-03-25 20:02:06 -0700171 ":superstructure_goal_fbs",
Maxwell Henderson76391142023-03-11 12:04:45 -0800172 ":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 Hendersonad312342023-01-10 12:07:47 -0800191cc_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 Schrader3de4dfc2023-02-15 20:18:25 -0800204ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800205 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)