blob: f97c6f0f26a0da7e2d11ad58dc5f9dab2e0b36eb [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Tyler Chatowe51334a2019-01-20 16:58:16 -08002
Philipp Schradercc016b32021-12-30 08:59:58 -08003package(default_visibility = ["//visibility:public"])
4
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 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 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 gen_reflections = 1,
11 includes = [
12 "//frc971/control_loops:control_loops_fbs_includes",
13 "//frc971/control_loops:profiled_subsystem_fbs_includes",
14 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080015 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070016)
17
18flatbuffer_cc_library(
19 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
23 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080024 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070025)
26
27flatbuffer_cc_library(
28 name = "superstructure_status_fbs",
29 srcs = [
30 "superstructure_status.fbs",
31 ],
32 gen_reflections = 1,
33 includes = [
34 "//frc971/control_loops:control_loops_fbs_includes",
35 "//frc971/control_loops:profiled_subsystem_fbs_includes",
36 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080037 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070038)
39
40flatbuffer_cc_library(
41 name = "superstructure_position_fbs",
42 srcs = [
43 "superstructure_position.fbs",
44 ],
45 gen_reflections = 1,
46 includes = [
47 "//frc971/control_loops:control_loops_fbs_includes",
48 "//frc971/control_loops:profiled_subsystem_fbs_includes",
Tyler Chatowe51334a2019-01-20 16:58:16 -080049 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080050 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowe51334a2019-01-20 16:58:16 -080051)
52
53cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080054 name = "superstructure_lib",
Tyler Chatowe51334a2019-01-20 16:58:16 -080055 srcs = [
56 "superstructure.cc",
57 ],
58 hdrs = [
59 "superstructure.h",
60 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080061 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowe51334a2019-01-20 16:58:16 -080062 deps = [
Theo Bafrali00e42272019-02-12 01:07:46 -080063 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -070064 ":superstructure_goal_fbs",
65 ":superstructure_output_fbs",
66 ":superstructure_position_fbs",
67 ":superstructure_status_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -080068 ":vacuum",
Alex Perrycb7da4b2019-08-28 19:35:56 -070069 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070070 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070071 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulec635d22023-08-12 18:39:24 -070072 "//frc971/zeroing:absolute_encoder",
73 "//frc971/zeroing:pot_and_absolute_encoder",
Theo Bafrali00e42272019-02-12 01:07:46 -080074 "//y2019:constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080075 "//y2019:status_light_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080076 ],
77)
78
79cc_test(
80 name = "superstructure_lib_test",
81 srcs = [
82 "superstructure_lib_test.cc",
83 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -080085 "//y2019:aos_config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080087 target_compatible_with = ["@platforms//os:linux"],
Theo Bafrali00e42272019-02-12 01:07:46 -080088 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 ":superstructure_goal_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080090 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070091 ":superstructure_output_fbs",
92 ":superstructure_position_fbs",
93 ":superstructure_status_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080094 "//aos:math",
Theo Bafrali00e42272019-02-12 01:07:46 -080095 "//aos/testing:googletest",
96 "//aos/time",
97 "//frc971/control_loops:capped_test_plant",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070098 "//frc971/control_loops:control_loop_test",
Theo Bafrali00e42272019-02-12 01:07:46 -080099 "//frc971/control_loops:position_sensor_sim",
100 "//frc971/control_loops:team_number_test_environment",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800102 "//y2019:status_light_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -0800103 "//y2019/control_loops/superstructure/intake:intake_plants",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800104 ],
Tyler Chatowe51334a2019-01-20 16:58:16 -0800105)
106
107cc_binary(
108 name = "superstructure",
109 srcs = [
110 "superstructure_main.cc",
111 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800112 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowe51334a2019-01-20 16:58:16 -0800113 deps = [
114 ":superstructure_lib",
115 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700116 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800117 ],
118)
Sabina Davis4b63ae52019-01-27 16:15:25 -0800119
120cc_library(
121 name = "collision_avoidance",
122 srcs = [
123 "collision_avoidance.cc",
124 ],
125 hdrs = [
126 "collision_avoidance.h",
127 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800128 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis4b63ae52019-01-27 16:15:25 -0800129 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700130 ":superstructure_goal_fbs",
131 ":superstructure_status_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800132 "//frc971:constants",
Austin Schuh0a3c9d42021-07-15 22:36:24 -0700133 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700134 "//frc971/control_loops:control_loops_fbs",
135 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800136 ],
137)
138
Theo Bafrali3274a182019-02-17 20:01:38 -0800139cc_library(
140 name = "vacuum",
141 srcs = [
142 "vacuum.cc",
143 ],
144 hdrs = [
145 "vacuum.h",
146 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800147 target_compatible_with = ["@platforms//os:linux"],
Theo Bafrali3274a182019-02-17 20:01:38 -0800148 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700149 ":superstructure_goal_fbs",
150 ":superstructure_output_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -0700151 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700152 "//frc971/control_loops:control_loops_fbs",
153 "//frc971/control_loops:profiled_subsystem_fbs",
Theo Bafrali3274a182019-02-17 20:01:38 -0800154 ],
155)
156
Sabina Davis4b63ae52019-01-27 16:15:25 -0800157cc_test(
158 name = "collision_avoidance_tests",
159 srcs = [
160 "collision_avoidance_tests.cc",
161 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800162 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis4b63ae52019-01-27 16:15:25 -0800163 deps = [
164 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700165 ":superstructure_goal_fbs",
166 ":superstructure_status_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800167 "//aos:math",
168 "//aos/testing:googletest",
169 ],
170)