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