blob: 7cbb2023fb4969d9a297334a53f9020dd9a47fff [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 ],
15)
16
17flatbuffer_cc_library(
18 name = "superstructure_output_fbs",
19 srcs = [
20 "superstructure_output.fbs",
21 ],
22 gen_reflections = 1,
23)
24
25flatbuffer_cc_library(
26 name = "superstructure_status_fbs",
27 srcs = [
28 "superstructure_status.fbs",
29 ],
30 gen_reflections = 1,
31 includes = [
32 "//frc971/control_loops:control_loops_fbs_includes",
33 "//frc971/control_loops:profiled_subsystem_fbs_includes",
34 ],
35)
36
37flatbuffer_cc_library(
38 name = "superstructure_position_fbs",
39 srcs = [
40 "superstructure_position.fbs",
41 ],
42 gen_reflections = 1,
43 includes = [
44 "//frc971/control_loops:control_loops_fbs_includes",
45 "//frc971/control_loops:profiled_subsystem_fbs_includes",
Tyler Chatowe51334a2019-01-20 16:58:16 -080046 ],
47)
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 ],
57 deps = [
Theo Bafrali00e42272019-02-12 01:07:46 -080058 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -070059 ":superstructure_goal_fbs",
60 ":superstructure_output_fbs",
61 ":superstructure_position_fbs",
62 ":superstructure_status_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -080063 ":vacuum",
Tyler Chatowe51334a2019-01-20 16:58:16 -080064 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070065 "//aos/events:event_loop",
66 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080067 "//y2019:constants",
Sabina Davisc6329342019-03-01 20:44:42 -080068 "//y2019:status_light",
Theo Bafrali00e42272019-02-12 01:07:46 -080069 ],
70)
71
72cc_test(
73 name = "superstructure_lib_test",
74 srcs = [
75 "superstructure_lib_test.cc",
76 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070077 data = [
78 "//y2019:config.json",
79 ],
Theo Bafrali00e42272019-02-12 01:07:46 -080080 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070081 ":superstructure_goal_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080082 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070083 ":superstructure_output_fbs",
84 ":superstructure_position_fbs",
85 ":superstructure_status_fbs",
Theo Bafrali00e42272019-02-12 01:07:46 -080086 "//aos:math",
Theo Bafrali00e42272019-02-12 01:07:46 -080087 "//aos/controls:control_loop_test",
88 "//aos/testing:googletest",
89 "//aos/time",
90 "//frc971/control_loops:capped_test_plant",
91 "//frc971/control_loops:position_sensor_sim",
92 "//frc971/control_loops:team_number_test_environment",
Alex Perrycb7da4b2019-08-28 19:35:56 -070093 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -080094 "//y2019:status_light",
Theo Bafrali00e42272019-02-12 01:07:46 -080095 "//y2019/control_loops/superstructure/intake:intake_plants",
Austin Schuh55a13dc2019-01-27 22:39:03 -080096 ],
Tyler Chatowe51334a2019-01-20 16:58:16 -080097)
98
99cc_binary(
100 name = "superstructure",
101 srcs = [
102 "superstructure_main.cc",
103 ],
104 deps = [
105 ":superstructure_lib",
106 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700107 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -0800108 ],
109)
Sabina Davis4b63ae52019-01-27 16:15:25 -0800110
111cc_library(
112 name = "collision_avoidance",
113 srcs = [
114 "collision_avoidance.cc",
115 ],
116 hdrs = [
117 "collision_avoidance.h",
118 ],
119 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700120 ":superstructure_goal_fbs",
121 ":superstructure_status_fbs",
122 "//aos/controls:control_loop",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800123 "//frc971:constants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700124 "//frc971/control_loops:control_loops_fbs",
125 "//frc971/control_loops:profiled_subsystem_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800126 ],
127)
128
Theo Bafrali3274a182019-02-17 20:01:38 -0800129cc_library(
130 name = "vacuum",
131 srcs = [
132 "vacuum.cc",
133 ],
134 hdrs = [
135 "vacuum.h",
136 ],
137 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700138 ":superstructure_goal_fbs",
139 ":superstructure_output_fbs",
Sabina Davisc6329342019-03-01 20:44:42 -0800140 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700141 "//frc971/control_loops:control_loops_fbs",
142 "//frc971/control_loops:profiled_subsystem_fbs",
Theo Bafrali3274a182019-02-17 20:01:38 -0800143 ],
144)
145
Sabina Davis4b63ae52019-01-27 16:15:25 -0800146cc_test(
147 name = "collision_avoidance_tests",
148 srcs = [
149 "collision_avoidance_tests.cc",
150 ],
151 deps = [
152 ":collision_avoidance",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700153 ":superstructure_goal_fbs",
154 ":superstructure_status_fbs",
Sabina Davis4b63ae52019-01-27 16:15:25 -0800155 "//aos:math",
156 "//aos/testing:googletest",
157 ],
158)