blob: afca18b1adc13071fca41541249e0c21b3fd1e9c [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",
61 "//frc971/vision:calibration_fbs",
62 "//y2023/control_loops/drivetrain:drivetrain_can_position_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",
106 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800107 "//frc971/shooter_interpolation:interpolation",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800108 "//y2023:constants",
James Kuszmaulcf451fb2023-03-10 20:42:36 -0800109 "//y2023/constants:constants_fbs",
110 "//y2023/constants:simulated_constants_sender",
milind-u738832d2023-02-24 19:55:54 -0800111 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
milind-u01bbcf22023-02-20 18:00:28 -0800112 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800113 "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800114 ],
115)
116
117cc_binary(
118 name = "superstructure",
119 srcs = [
120 "superstructure_main.cc",
121 ],
122 deps = [
123 ":superstructure_lib",
124 "//aos:init",
125 "//aos/events:shm_event_loop",
126 ],
127)
128
129cc_test(
130 name = "superstructure_lib_test",
131 srcs = [
132 "superstructure_lib_test.cc",
133 ],
134 data = [
135 "//y2023:aos_config",
136 ],
137 deps = [
138 ":superstructure_goal_fbs",
139 ":superstructure_lib",
140 ":superstructure_output_fbs",
141 ":superstructure_position_fbs",
142 ":superstructure_status_fbs",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800143 "//aos:json_to_flatbuffer",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800144 "//aos:math",
145 "//aos/events/logging:log_writer",
146 "//aos/testing:googletest",
147 "//aos/time",
148 "//frc971/control_loops:capped_test_plant",
149 "//frc971/control_loops:control_loop_test",
150 "//frc971/control_loops:position_sensor_sim",
151 "//frc971/control_loops:subsystem_simulator",
152 "//frc971/control_loops:team_number_test_environment",
153 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u18a901d2023-02-17 21:51:55 -0800154 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -0800155 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800156 ],
157)
158
Maxwell Henderson76391142023-03-11 12:04:45 -0800159cc_library(
160 name = "led_indicator_lib",
161 srcs = ["led_indicator.cc"],
162 hdrs = ["led_indicator.h"],
163 data = [
164 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
165 "@ctre_phoenix_cci_athena//:shared_libraries",
166 ],
167 target_compatible_with = ["//tools/platforms/hardware:roborio"],
168 deps = [
Austin Schuhe2663ee2023-03-25 20:02:06 -0700169 ":superstructure_goal_fbs",
Maxwell Henderson76391142023-03-11 12:04:45 -0800170 ":superstructure_output_fbs",
171 ":superstructure_position_fbs",
172 ":superstructure_status_fbs",
173 "//aos/events:event_loop",
174 "//aos/network:message_bridge_client_fbs",
175 "//aos/network:message_bridge_server_fbs",
176 "//frc971/control_loops:control_loop",
177 "//frc971/control_loops:control_loops_fbs",
178 "//frc971/control_loops:profiled_subsystem_fbs",
179 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
180 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
181 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
182 "//frc971/queues:gyro_fbs",
183 "//third_party:phoenix",
184 "//third_party:wpilib",
185 "//y2023/vision:game_pieces_fbs",
186 ],
187)
188
Maxwell Hendersonad312342023-01-10 12:07:47 -0800189cc_binary(
190 name = "superstructure_replay",
191 srcs = ["superstructure_replay.cc"],
192 deps = [
193 ":superstructure_lib",
194 "//aos:configuration",
195 "//aos:init",
196 "//aos/events:simulated_event_loop",
197 "//aos/events/logging:log_reader",
198 "//aos/network:team_number",
199 ],
200)
201
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800202ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800203 name = "superstructure_plotter",
204 srcs = ["superstructure_plotter.ts"],
205 target_compatible_with = ["@platforms//os:linux"],
206 deps = [
207 "//aos/network/www:aos_plotter",
208 "//aos/network/www:colors",
209 "//aos/network/www:proxy",
210 ],
211)