blob: 9336cb7bb8978ff7d05b568183c950605863739b [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Tyler Chatowe51334a2019-01-20 16:58:16 -08002
Philipp Schradercc016b32021-12-30 08:59:58 -08003package(default_visibility = ["//visibility:public"])
4
James Kuszmaulf01da392023-12-14 11:22:14 -08005static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -07006 name = "superstructure_goal_fbs",
Tyler Chatowe51334a2019-01-20 16:58:16 -08007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "superstructure_goal.fbs",
Tyler Chatowe51334a2019-01-20 16:58:16 -08009 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080010 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080011 deps = [
12 "//frc971/control_loops:control_loops_fbs",
13 "//frc971/control_loops:profiled_subsystem_fbs",
14 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070015)
16
James Kuszmaulf01da392023-12-14 11:22:14 -080017static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070018 name = "superstructure_output_fbs",
19 srcs = [
20 "superstructure_output.fbs",
21 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080022 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070023)
24
James Kuszmaulf01da392023-12-14 11:22:14 -080025static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070026 name = "superstructure_status_fbs",
27 srcs = [
28 "superstructure_status.fbs",
29 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080030 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080031 deps = [
32 "//frc971/control_loops:control_loops_fbs",
33 "//frc971/control_loops:profiled_subsystem_fbs",
34 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070035)
36
James Kuszmaulf01da392023-12-14 11:22:14 -080037static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -070038 name = "superstructure_position_fbs",
39 srcs = [
40 "superstructure_position.fbs",
41 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080042 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulf01da392023-12-14 11:22:14 -080043 deps = [
44 "//frc971/control_loops:control_loops_fbs",
45 "//frc971/control_loops:profiled_subsystem_fbs",
46 ],
Tyler Chatowe51334a2019-01-20 16:58:16 -080047)
48
49cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080050 name = "superstructure_lib",
Tyler Chatowe51334a2019-01-20 16:58:16 -080051 srcs = [
52 "superstructure.cc",
53 ],
54 hdrs = [
55 "superstructure.h",
56 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080057 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowe51334a2019-01-20 16:58:16 -080058 deps = [
Theo Bafrali00e42272019-02-12 01:07:46 -080059 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -070060 ":superstructure_goal_fbs",
61 ":superstructure_output_fbs",
62 ":superstructure_position_fbs",
63 ":superstructure_status_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -080064 ":vacuum",
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070066 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070067 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulec635d22023-08-12 18:39:24 -070068 "//frc971/zeroing:absolute_encoder",
69 "//frc971/zeroing:pot_and_absolute_encoder",
Theo Bafrali00e42272019-02-12 01:07:46 -080070 "//y2019:constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080071 "//y2019:status_light_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080072 ],
73)
74
75cc_test(
76 name = "superstructure_lib_test",
77 srcs = [
78 "superstructure_lib_test.cc",
79 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070080 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -080081 "//y2019:aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080083 target_compatible_with = ["@platforms//os:linux"],
Theo Bafrali00e42272019-02-12 01:07:46 -080084 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070085 ":superstructure_goal_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080086 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070087 ":superstructure_output_fbs",
88 ":superstructure_position_fbs",
89 ":superstructure_status_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080090 "//aos:math",
Theo Bafrali00e42272019-02-12 01:07:46 -080091 "//aos/testing:googletest",
92 "//aos/time",
93 "//frc971/control_loops:capped_test_plant",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070094 "//frc971/control_loops:control_loop_test",
Theo Bafrali00e42272019-02-12 01:07:46 -080095 "//frc971/control_loops:position_sensor_sim",
96 "//frc971/control_loops:team_number_test_environment",
Alex Perrycb7da4b2019-08-28 19:35:56 -070097 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -080098 "//y2019:status_light_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080099 "//y2019/control_loops/superstructure/intake:intake_plants",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800100 ],
Tyler Chatowe51334a2019-01-20 16:58:16 -0800101)
102
103cc_binary(
104 name = "superstructure",
105 srcs = [
106 "superstructure_main.cc",
107 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800108 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowe51334a2019-01-20 16:58:16 -0800109 deps = [
110 ":superstructure_lib",
111 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700112 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800113 ],
114)
Sabina Davis4b63ae52019-01-27 16:15:25 -0800115
116cc_library(
117 name = "collision_avoidance",
118 srcs = [
119 "collision_avoidance.cc",
120 ],
121 hdrs = [
122 "collision_avoidance.h",
123 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800124 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis4b63ae52019-01-27 16:15:25 -0800125 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700126 ":superstructure_goal_fbs",
127 ":superstructure_status_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800128 "//frc971:constants",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700129 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700130 "//frc971/control_loops:control_loops_fbs",
131 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800132 ],
133)
134
Theo Bafrali3274a182019-02-17 20:01:38 -0800135cc_library(
136 name = "vacuum",
137 srcs = [
138 "vacuum.cc",
139 ],
140 hdrs = [
141 "vacuum.h",
142 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800143 target_compatible_with = ["@platforms//os:linux"],
Theo Bafrali3274a182019-02-17 20:01:38 -0800144 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700145 ":superstructure_goal_fbs",
146 ":superstructure_output_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -0700147 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700148 "//frc971/control_loops:control_loops_fbs",
149 "//frc971/control_loops:profiled_subsystem_fbs",
Theo Bafrali3274a182019-02-17 20:01:38 -0800150 ],
151)
152
Sabina Davis4b63ae52019-01-27 16:15:25 -0800153cc_test(
154 name = "collision_avoidance_tests",
155 srcs = [
156 "collision_avoidance_tests.cc",
157 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis4b63ae52019-01-27 16:15:25 -0800159 deps = [
160 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700161 ":superstructure_goal_fbs",
162 ":superstructure_status_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800163 "//aos:math",
164 "//aos/testing:googletest",
165 ],
166)