blob: 97ea2f912b738f0e071ae6887b783f30bd7a279b [file] [log] [blame]
Ariv Diggi0af59c02023-10-07 13:15:39 -07001load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Austin Schuh8f99c822024-05-05 22:43:40 -07002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Ariv Diggi0af59c02023-10-07 13:15:39 -07003
4package(default_visibility = ["//visibility:public"])
5
James Kuszmaulf01da392023-12-14 11:22:14 -08006static_flatbuffer(
Ariv Diggi0af59c02023-10-07 13:15:39 -07007 name = "superstructure_goal_fbs",
8 srcs = [
9 "superstructure_goal.fbs",
10 ],
Ariv Diggi0af59c02023-10-07 13:15:39 -070011 deps = [
12 "//frc971/control_loops:control_loops_fbs",
13 "//frc971/control_loops:profiled_subsystem_fbs",
14 ],
15)
16
James Kuszmaulf01da392023-12-14 11:22:14 -080017static_flatbuffer(
Ariv Diggi0af59c02023-10-07 13:15:39 -070018 name = "superstructure_output_fbs",
19 srcs = [
20 "superstructure_output.fbs",
21 ],
Ariv Diggi0af59c02023-10-07 13:15:39 -070022)
23
James Kuszmaulf01da392023-12-14 11:22:14 -080024static_flatbuffer(
Ariv Diggi0af59c02023-10-07 13:15:39 -070025 name = "superstructure_status_fbs",
26 srcs = [
27 "superstructure_status.fbs",
28 ],
Ariv Diggi0af59c02023-10-07 13:15:39 -070029 deps = [
30 "//frc971/control_loops:control_loops_fbs",
31 "//frc971/control_loops:profiled_subsystem_fbs",
32 ],
33)
34
35flatbuffer_ts_library(
36 name = "superstructure_status_ts_fbs",
37 srcs = [
38 "superstructure_status.fbs",
39 ],
40 deps = [
41 "//frc971/control_loops:control_loops_ts_fbs",
42 "//frc971/control_loops:profiled_subsystem_ts_fbs",
43 ],
44)
45
James Kuszmaulf01da392023-12-14 11:22:14 -080046static_flatbuffer(
Ariv Diggi0af59c02023-10-07 13:15:39 -070047 name = "superstructure_position_fbs",
48 srcs = [
49 "superstructure_position.fbs",
50 ],
Ariv Diggi0af59c02023-10-07 13:15:39 -070051 deps = [
52 "//frc971:can_configuration_fbs",
Maxwell Henderson10ed5c32024-01-09 12:40:54 -080053 "//frc971/control_loops:can_talonfx_fbs",
Ariv Diggi0af59c02023-10-07 13:15:39 -070054 "//frc971/control_loops:control_loops_fbs",
55 "//frc971/control_loops:profiled_subsystem_fbs",
56 ],
57)
58
59cc_library(
60 name = "superstructure_lib",
61 srcs = [
62 "superstructure.cc",
63 ],
64 hdrs = [
65 "superstructure.h",
66 ],
67 data = [
68 ],
69 deps = [
Ariv Diggi0af59c02023-10-07 13:15:39 -070070 ":superstructure_goal_fbs",
71 ":superstructure_output_fbs",
72 ":superstructure_position_fbs",
73 ":superstructure_status_fbs",
74 "//aos:flatbuffer_merge",
75 "//aos/events:event_loop",
76 "//frc971/constants:constants_sender_lib",
77 "//frc971/control_loops:control_loop",
78 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
79 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
80 "//frc971/shooter_interpolation:interpolation",
81 "//y2023_bot3:constants",
82 "//y2023_bot3/constants:constants_fbs",
83 "//y2023_bot3/constants:simulated_constants_sender",
84 ],
85)
86
87cc_binary(
88 name = "superstructure",
89 srcs = [
90 "superstructure_main.cc",
91 ],
92 deps = [
93 ":superstructure_lib",
94 "//aos:init",
95 "//aos/events:shm_event_loop",
96 ],
97)
98
99cc_test(
100 name = "superstructure_lib_test",
101 srcs = [
102 "superstructure_lib_test.cc",
103 ],
104 data = [
105 "//y2023_bot3:aos_config",
106 ],
107 deps = [
108 ":superstructure_goal_fbs",
109 ":superstructure_lib",
110 ":superstructure_output_fbs",
111 ":superstructure_position_fbs",
112 ":superstructure_status_fbs",
113 "//aos:json_to_flatbuffer",
114 "//aos:math",
115 "//aos/events/logging:log_writer",
116 "//aos/testing:googletest",
117 "//aos/time",
118 "//frc971/control_loops:capped_test_plant",
119 "//frc971/control_loops:control_loop_test",
120 "//frc971/control_loops:position_sensor_sim",
121 "//frc971/control_loops:subsystem_simulator",
122 "//frc971/control_loops:team_number_test_environment",
123 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
124 ],
125)
126
127cc_library(
128 name = "led_indicator_lib",
129 srcs = ["led_indicator.cc"],
130 hdrs = ["led_indicator.h"],
131 data = [
132 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
133 "@ctre_phoenix_cci_athena//:shared_libraries",
134 ],
135 target_compatible_with = ["//tools/platforms/hardware:roborio"],
136 deps = [
137 ":superstructure_goal_fbs",
138 ":superstructure_output_fbs",
139 ":superstructure_position_fbs",
140 ":superstructure_status_fbs",
141 "//aos/events:event_loop",
142 "//aos/network:message_bridge_client_fbs",
143 "//aos/network:message_bridge_server_fbs",
144 "//frc971/control_loops:control_loop",
145 "//frc971/control_loops:control_loops_fbs",
146 "//frc971/control_loops:profiled_subsystem_fbs",
147 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
148 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
149 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
150 "//frc971/queues:gyro_fbs",
151 "//third_party:phoenix",
152 "//third_party:wpilib",
153 ],
154)
155
156cc_binary(
157 name = "superstructure_replay",
158 srcs = ["superstructure_replay.cc"],
159 deps = [
160 ":superstructure_lib",
161 "//aos:configuration",
162 "//aos:init",
163 "//aos/events:simulated_event_loop",
164 "//aos/events/logging:log_reader",
165 "//aos/network:team_number",
166 ],
167)