blob: 89fff7a7faae23eb6a0f422dd8a076231e93f463 [file] [log] [blame]
James Kuszmaul97f750d2019-01-20 20:08:03 -08001package(default_visibility = ["//visibility:public"])
Diana Vandenberg69899ed2017-01-28 16:57:54 -08002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Diana Vandenberg69899ed2017-01-28 16:57:54 -08004
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 name = "superstructure_goal_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -08007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "superstructure_goal.fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -08009 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070010 gen_reflections = 1,
11 includes = [
12 "//frc971/control_loops:control_loops_fbs_includes",
James Kuszmaul97f750d2019-01-20 20:08:03 -080013 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080014 target_compatible_with = ["@platforms//os:linux"],
Diana Vandenberg69899ed2017-01-28 16:57:54 -080015)
Austin Schuh87c10632017-02-05 19:02:17 -080016
Alex Perrycb7da4b2019-08-28 19:35:56 -070017flatbuffer_cc_library(
18 name = "superstructure_position_fbs",
19 srcs = [
20 "superstructure_position.fbs",
21 ],
22 gen_reflections = 1,
23 includes = [
24 "//frc971/control_loops:control_loops_fbs_includes",
25 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080026 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070027)
28
29flatbuffer_cc_library(
30 name = "superstructure_status_fbs",
31 srcs = [
32 "superstructure_status.fbs",
33 ],
34 gen_reflections = 1,
35 includes = [
36 "//frc971/control_loops:control_loops_fbs_includes",
37 "//frc971/control_loops:profiled_subsystem_fbs_includes",
38 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080039 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070040)
41
42flatbuffer_cc_library(
43 name = "superstructure_output_fbs",
44 srcs = [
45 "superstructure_output.fbs",
46 ],
47 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080048 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -070049)
50
Austin Schuh87c10632017-02-05 19:02:17 -080051cc_library(
James Kuszmaul97f750d2019-01-20 20:08:03 -080052 name = "superstructure_lib",
53 srcs = [
54 "superstructure.cc",
55 ],
56 hdrs = [
57 "superstructure.h",
58 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080059 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -080060 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070061 ":superstructure_goal_fbs",
62 ":superstructure_output_fbs",
63 ":superstructure_position_fbs",
64 ":superstructure_status_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -080065 ":vision_distance_average",
Alex Perrycb7da4b2019-08-28 19:35:56 -070066 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070067 "//frc971/control_loops:control_loop",
James Kuszmaul97f750d2019-01-20 20:08:03 -080068 "//y2017:constants",
69 "//y2017/control_loops/superstructure/column",
70 "//y2017/control_loops/superstructure/hood",
71 "//y2017/control_loops/superstructure/intake",
72 "//y2017/control_loops/superstructure/shooter",
73 ],
Austin Schuh87c10632017-02-05 19:02:17 -080074)
Adam Snaidercfe13062017-02-05 18:23:09 -080075
76cc_test(
James Kuszmaul97f750d2019-01-20 20:08:03 -080077 name = "superstructure_lib_test",
78 srcs = [
79 "superstructure_lib_test.cc",
80 ],
Austin Schuh14d7d3d2020-09-10 18:14:36 -070081 data = ["//y2017:config"],
Philipp Schraderdada1072020-11-24 11:34:46 -080082 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -080083 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070084 ":superstructure_goal_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -080085 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070086 ":superstructure_output_fbs",
87 ":superstructure_position_fbs",
88 ":superstructure_status_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -080089 "//aos:math",
James Kuszmaul97f750d2019-01-20 20:08:03 -080090 "//aos/testing:googletest",
91 "//aos/time",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070092 "//frc971/control_loops:control_loop_test",
James Kuszmaul97f750d2019-01-20 20:08:03 -080093 "//frc971/control_loops:position_sensor_sim",
94 "//frc971/control_loops:team_number_test_environment",
95 "//y2017/control_loops/superstructure/column:column_plants",
96 "//y2017/control_loops/superstructure/hood:hood_plants",
97 "//y2017/control_loops/superstructure/intake:intake_plants",
98 "//y2017/control_loops/superstructure/shooter:shooter_plants",
99 ],
Adam Snaidercfe13062017-02-05 18:23:09 -0800100)
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800101
102cc_binary(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800103 name = "superstructure",
104 srcs = [
105 "superstructure_main.cc",
106 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800107 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -0800108 deps = [
109 ":superstructure_lib",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800110 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700111 "//aos/events:shm_event_loop",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800112 ],
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800113)
Parker Schuhfea48582017-03-11 20:15:32 -0800114
115cc_library(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800116 name = "vision_time_adjuster",
117 srcs = [
118 "vision_time_adjuster.cc",
119 ],
120 hdrs = [
121 "vision_time_adjuster.h",
122 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800123 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -0800124 deps = [
James Kuszmaul97f750d2019-01-20 20:08:03 -0800125 "//aos/containers:ring_buffer",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700126 "//frc971/control_loops:control_loops_fbs",
127 "//frc971/control_loops:profiled_subsystem_fbs",
128 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800129 "//y2017/control_loops/drivetrain:polydrivetrain_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700130 "//y2017/vision:vision_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800131 ],
Parker Schuhfea48582017-03-11 20:15:32 -0800132)
133
134cc_test(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800135 name = "vision_time_adjuster_test",
136 srcs = [
137 "vision_time_adjuster_test.cc",
138 ],
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700139 data = ["//y2017:config"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800140 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -0800141 deps = [
142 ":vision_time_adjuster",
Austin Schuhb6c5c852019-05-19 20:13:31 -0700143 "//aos/events:simulated_event_loop",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800144 "//aos/testing:googletest",
Austin Schuhb6c5c852019-05-19 20:13:31 -0700145 "//aos/testing:test_logging",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800146 "//aos/time",
147 ],
Parker Schuhfea48582017-03-11 20:15:32 -0800148)
Parker Schuh208a58d2017-04-12 20:51:38 -0700149
150cc_library(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800151 name = "vision_distance_average",
152 hdrs = [
153 "vision_distance_average.h",
154 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800155 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -0800156 deps = [
157 "//aos/containers:ring_buffer",
158 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700159 "//y2017/vision:vision_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800160 ],
Parker Schuh208a58d2017-04-12 20:51:38 -0700161)
162
163cc_test(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800164 name = "vision_distance_average_test",
165 srcs = [
166 "vision_distance_average_test.cc",
167 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800168 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul97f750d2019-01-20 20:08:03 -0800169 deps = [
170 ":vision_distance_average",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700171 "//aos:flatbuffers",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800172 "//aos/testing:googletest",
173 "//aos/time",
174 ],
Parker Schuh208a58d2017-04-12 20:51:38 -0700175)