blob: 0330182dde254092e1012f3461bbf14291ef54d8 [file] [log] [blame]
Ariv Diggi0af59c02023-10-07 13:15:39 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
3
4package(default_visibility = ["//visibility:public"])
5
6flatbuffer_cc_library(
7 name = "superstructure_goal_fbs",
8 srcs = [
9 "superstructure_goal.fbs",
10 ],
11 gen_reflections = 1,
12 deps = [
13 "//frc971/control_loops:control_loops_fbs",
14 "//frc971/control_loops:profiled_subsystem_fbs",
15 ],
16)
17
18flatbuffer_cc_library(
19 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
23 gen_reflections = 1,
24)
25
26flatbuffer_cc_library(
27 name = "superstructure_status_fbs",
28 srcs = [
29 "superstructure_status.fbs",
30 ],
31 gen_reflections = 1,
32 deps = [
33 "//frc971/control_loops:control_loops_fbs",
34 "//frc971/control_loops:profiled_subsystem_fbs",
35 ],
36)
37
38flatbuffer_ts_library(
39 name = "superstructure_status_ts_fbs",
40 srcs = [
41 "superstructure_status.fbs",
42 ],
43 deps = [
44 "//frc971/control_loops:control_loops_ts_fbs",
45 "//frc971/control_loops:profiled_subsystem_ts_fbs",
46 ],
47)
48
49flatbuffer_cc_library(
50 name = "superstructure_position_fbs",
51 srcs = [
52 "superstructure_position.fbs",
53 ],
54 gen_reflections = 1,
55 deps = [
56 "//frc971:can_configuration_fbs",
Ariv Diggic892e922023-10-21 15:52:06 -070057 "//frc971/control_loops:can_falcon_fbs",
Ariv Diggi0af59c02023-10-07 13:15:39 -070058 "//frc971/control_loops:control_loops_fbs",
59 "//frc971/control_loops:profiled_subsystem_fbs",
60 ],
61)
62
63cc_library(
Ariv Diggic892e922023-10-21 15:52:06 -070064 name = "end_effector",
65 srcs = [
66 "end_effector.cc",
67 ],
68 hdrs = [
69 "end_effector.h",
70 ],
71 deps = [
72 ":superstructure_goal_fbs",
73 ":superstructure_status_fbs",
74 "//aos/events:event_loop",
75 "//aos/time",
76 "//frc971/control_loops:control_loop",
77 "//y2023_bot3:constants",
78 ],
79)
80
81cc_library(
Ariv Diggi0af59c02023-10-07 13:15:39 -070082 name = "superstructure_lib",
83 srcs = [
84 "superstructure.cc",
85 ],
86 hdrs = [
87 "superstructure.h",
88 ],
89 data = [
90 ],
91 deps = [
Ariv Diggic892e922023-10-21 15:52:06 -070092 ":end_effector",
Ariv Diggi0af59c02023-10-07 13:15:39 -070093 ":superstructure_goal_fbs",
94 ":superstructure_output_fbs",
95 ":superstructure_position_fbs",
96 ":superstructure_status_fbs",
97 "//aos:flatbuffer_merge",
98 "//aos/events:event_loop",
99 "//frc971/constants:constants_sender_lib",
100 "//frc971/control_loops:control_loop",
101 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
102 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
103 "//frc971/shooter_interpolation:interpolation",
104 "//y2023_bot3:constants",
105 "//y2023_bot3/constants:constants_fbs",
106 "//y2023_bot3/constants:simulated_constants_sender",
107 ],
108)
109
110cc_binary(
111 name = "superstructure",
112 srcs = [
113 "superstructure_main.cc",
114 ],
115 deps = [
116 ":superstructure_lib",
117 "//aos:init",
118 "//aos/events:shm_event_loop",
119 ],
120)
121
122cc_test(
123 name = "superstructure_lib_test",
124 srcs = [
125 "superstructure_lib_test.cc",
126 ],
127 data = [
128 "//y2023_bot3:aos_config",
129 ],
130 deps = [
131 ":superstructure_goal_fbs",
132 ":superstructure_lib",
133 ":superstructure_output_fbs",
134 ":superstructure_position_fbs",
135 ":superstructure_status_fbs",
136 "//aos:json_to_flatbuffer",
137 "//aos:math",
138 "//aos/events/logging:log_writer",
139 "//aos/testing:googletest",
140 "//aos/time",
141 "//frc971/control_loops:capped_test_plant",
142 "//frc971/control_loops:control_loop_test",
143 "//frc971/control_loops:position_sensor_sim",
144 "//frc971/control_loops:subsystem_simulator",
145 "//frc971/control_loops:team_number_test_environment",
146 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
147 ],
148)
149
150cc_library(
151 name = "led_indicator_lib",
152 srcs = ["led_indicator.cc"],
153 hdrs = ["led_indicator.h"],
154 data = [
155 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
156 "@ctre_phoenix_cci_athena//:shared_libraries",
157 ],
158 target_compatible_with = ["//tools/platforms/hardware:roborio"],
159 deps = [
160 ":superstructure_goal_fbs",
161 ":superstructure_output_fbs",
162 ":superstructure_position_fbs",
163 ":superstructure_status_fbs",
164 "//aos/events:event_loop",
165 "//aos/network:message_bridge_client_fbs",
166 "//aos/network:message_bridge_server_fbs",
167 "//frc971/control_loops:control_loop",
168 "//frc971/control_loops:control_loops_fbs",
169 "//frc971/control_loops:profiled_subsystem_fbs",
170 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
171 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
172 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
173 "//frc971/queues:gyro_fbs",
174 "//third_party:phoenix",
175 "//third_party:wpilib",
176 ],
177)
178
179cc_binary(
180 name = "superstructure_replay",
181 srcs = ["superstructure_replay.cc"],
182 deps = [
183 ":superstructure_lib",
184 "//aos:configuration",
185 "//aos:init",
186 "//aos/events:simulated_event_loop",
187 "//aos/events/logging:log_reader",
188 "//aos/network:team_number",
189 ],
190)