blob: e6a3082e30fc7b6249a67cc204c303738e340bbf [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",
57 "//frc971/control_loops:control_loops_fbs",
58 "//frc971/control_loops:profiled_subsystem_fbs",
59 ],
60)
61
62cc_library(
63 name = "superstructure_lib",
64 srcs = [
65 "superstructure.cc",
66 ],
67 hdrs = [
68 "superstructure.h",
69 ],
70 data = [
71 ],
72 deps = [
73 ":superstructure_goal_fbs",
74 ":superstructure_output_fbs",
75 ":superstructure_position_fbs",
76 ":superstructure_status_fbs",
77 "//aos:flatbuffer_merge",
78 "//aos/events:event_loop",
79 "//frc971/constants:constants_sender_lib",
80 "//frc971/control_loops:control_loop",
81 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
82 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
83 "//frc971/shooter_interpolation:interpolation",
84 "//y2023_bot3:constants",
85 "//y2023_bot3/constants:constants_fbs",
86 "//y2023_bot3/constants:simulated_constants_sender",
87 ],
88)
89
90cc_binary(
91 name = "superstructure",
92 srcs = [
93 "superstructure_main.cc",
94 ],
95 deps = [
96 ":superstructure_lib",
97 "//aos:init",
98 "//aos/events:shm_event_loop",
99 ],
100)
101
102cc_test(
103 name = "superstructure_lib_test",
104 srcs = [
105 "superstructure_lib_test.cc",
106 ],
107 data = [
108 "//y2023_bot3:aos_config",
109 ],
110 deps = [
111 ":superstructure_goal_fbs",
112 ":superstructure_lib",
113 ":superstructure_output_fbs",
114 ":superstructure_position_fbs",
115 ":superstructure_status_fbs",
116 "//aos:json_to_flatbuffer",
117 "//aos:math",
118 "//aos/events/logging:log_writer",
119 "//aos/testing:googletest",
120 "//aos/time",
121 "//frc971/control_loops:capped_test_plant",
122 "//frc971/control_loops:control_loop_test",
123 "//frc971/control_loops:position_sensor_sim",
124 "//frc971/control_loops:subsystem_simulator",
125 "//frc971/control_loops:team_number_test_environment",
126 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
127 ],
128)
129
130cc_library(
131 name = "led_indicator_lib",
132 srcs = ["led_indicator.cc"],
133 hdrs = ["led_indicator.h"],
134 data = [
135 "@ctre_phoenix_api_cpp_athena//:shared_libraries",
136 "@ctre_phoenix_cci_athena//:shared_libraries",
137 ],
138 target_compatible_with = ["//tools/platforms/hardware:roborio"],
139 deps = [
140 ":superstructure_goal_fbs",
141 ":superstructure_output_fbs",
142 ":superstructure_position_fbs",
143 ":superstructure_status_fbs",
144 "//aos/events:event_loop",
145 "//aos/network:message_bridge_client_fbs",
146 "//aos/network:message_bridge_server_fbs",
147 "//frc971/control_loops:control_loop",
148 "//frc971/control_loops:control_loops_fbs",
149 "//frc971/control_loops:profiled_subsystem_fbs",
150 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
151 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
152 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
153 "//frc971/queues:gyro_fbs",
154 "//third_party:phoenix",
155 "//third_party:wpilib",
156 ],
157)
158
159cc_binary(
160 name = "superstructure_replay",
161 srcs = ["superstructure_replay.cc"],
162 deps = [
163 ":superstructure_lib",
164 "//aos:configuration",
165 "//aos:init",
166 "//aos/events:simulated_event_loop",
167 "//aos/events/logging:log_reader",
168 "//aos/network:team_number",
169 ],
170)