blob: 29e04feb71bd2298627337296c1f75c02c05ee0b [file] [log] [blame]
Tyler Chatowe51334a2019-01-20 16:58:16 -08001package(default_visibility = ["//visibility:public"])
2
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Tyler Chatowe51334a2019-01-20 16:58:16 -08004
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",
James Kuszmaul61750662021-06-21 21:32:33 -070069 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070070 "//aos/events:event_loop",
71 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080072 "//y2019:constants",
Austin Schuhed5b26d2019-12-05 20:51:59 -080073 "//y2019:status_light_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080074 ],
75)
76
77cc_test(
78 name = "superstructure_lib_test",
79 srcs = [
80 "superstructure_lib_test.cc",
81 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070082 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -070083 "//y2019:config",
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080085 target_compatible_with = ["@platforms//os:linux"],
Theo Bafrali00e42272019-02-12 01:07:46 -080086 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070087 ":superstructure_goal_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080088 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070089 ":superstructure_output_fbs",
90 ":superstructure_position_fbs",
91 ":superstructure_status_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080092 "//aos:math",
James Kuszmaul61750662021-06-21 21:32:33 -070093 "//frc971/control_loops:control_loop_test",
Theo Bafrali00e42272019-02-12 01:07:46 -080094 "//aos/testing:googletest",
95 "//aos/time",
96 "//frc971/control_loops:capped_test_plant",
97 "//frc971/control_loops:position_sensor_sim",
98 "//frc971/control_loops:team_number_test_environment",
Alex Perrycb7da4b2019-08-28 19:35:56 -070099 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Austin Schuhed5b26d2019-12-05 20:51:59 -0800100 "//y2019:status_light_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -0800101 "//y2019/control_loops/superstructure/intake:intake_plants",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800102 ],
Tyler Chatowe51334a2019-01-20 16:58:16 -0800103)
104
105cc_binary(
106 name = "superstructure",
107 srcs = [
108 "superstructure_main.cc",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowe51334a2019-01-20 16:58:16 -0800111 deps = [
112 ":superstructure_lib",
113 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800115 ],
116)
Sabina Davis4b63ae52019-01-27 16:15:25 -0800117
118cc_library(
119 name = "collision_avoidance",
120 srcs = [
121 "collision_avoidance.cc",
122 ],
123 hdrs = [
124 "collision_avoidance.h",
125 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800126 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis4b63ae52019-01-27 16:15:25 -0800127 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700128 ":superstructure_goal_fbs",
129 ":superstructure_status_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -0700130 "//frc971/control_loops:control_loop",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800131 "//frc971:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700132 "//frc971/control_loops:control_loops_fbs",
133 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800134 ],
135)
136
Theo Bafrali3274a182019-02-17 20:01:38 -0800137cc_library(
138 name = "vacuum",
139 srcs = [
140 "vacuum.cc",
141 ],
142 hdrs = [
143 "vacuum.h",
144 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800145 target_compatible_with = ["@platforms//os:linux"],
Theo Bafrali3274a182019-02-17 20:01:38 -0800146 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700147 ":superstructure_goal_fbs",
148 ":superstructure_output_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -0700149 "//frc971/control_loops:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700150 "//frc971/control_loops:control_loops_fbs",
151 "//frc971/control_loops:profiled_subsystem_fbs",
Theo Bafrali3274a182019-02-17 20:01:38 -0800152 ],
153)
154
Sabina Davis4b63ae52019-01-27 16:15:25 -0800155cc_test(
156 name = "collision_avoidance_tests",
157 srcs = [
158 "collision_avoidance_tests.cc",
159 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800160 target_compatible_with = ["@platforms//os:linux"],
Sabina Davis4b63ae52019-01-27 16:15:25 -0800161 deps = [
162 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700163 ":superstructure_goal_fbs",
164 ":superstructure_status_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800165 "//aos:math",
166 "//aos/testing:googletest",
167 ],
168)