blob: 535475d5bc87543025fce8d905f20640bee44ded [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 ],
Diana Vandenberg69899ed2017-01-28 16:57:54 -080014)
Austin Schuh87c10632017-02-05 19:02:17 -080015
Alex Perrycb7da4b2019-08-28 19:35:56 -070016flatbuffer_cc_library(
17 name = "superstructure_position_fbs",
18 srcs = [
19 "superstructure_position.fbs",
20 ],
21 gen_reflections = 1,
22 includes = [
23 "//frc971/control_loops:control_loops_fbs_includes",
24 ],
25)
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 ],
37)
38
39flatbuffer_cc_library(
40 name = "superstructure_output_fbs",
41 srcs = [
42 "superstructure_output.fbs",
43 ],
44 gen_reflections = 1,
45)
46
Austin Schuh87c10632017-02-05 19:02:17 -080047cc_library(
James Kuszmaul97f750d2019-01-20 20:08:03 -080048 name = "superstructure_lib",
49 srcs = [
50 "superstructure.cc",
51 ],
52 hdrs = [
53 "superstructure.h",
54 ],
55 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070056 ":superstructure_goal_fbs",
57 ":superstructure_output_fbs",
58 ":superstructure_position_fbs",
59 ":superstructure_status_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -080060 ":vision_distance_average",
61 "//aos/controls:control_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -070062 "//aos/events:event_loop",
James Kuszmaul97f750d2019-01-20 20:08:03 -080063 "//y2017:constants",
64 "//y2017/control_loops/superstructure/column",
65 "//y2017/control_loops/superstructure/hood",
66 "//y2017/control_loops/superstructure/intake",
67 "//y2017/control_loops/superstructure/shooter",
68 ],
Austin Schuh87c10632017-02-05 19:02:17 -080069)
Adam Snaidercfe13062017-02-05 18:23:09 -080070
71cc_test(
James Kuszmaul97f750d2019-01-20 20:08:03 -080072 name = "superstructure_lib_test",
73 srcs = [
74 "superstructure_lib_test.cc",
75 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -070076 data = ["//y2017:config.json"],
James Kuszmaul97f750d2019-01-20 20:08:03 -080077 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070078 ":superstructure_goal_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -080079 ":superstructure_lib",
Alex Perrycb7da4b2019-08-28 19:35:56 -070080 ":superstructure_output_fbs",
81 ":superstructure_position_fbs",
82 ":superstructure_status_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -080083 "//aos:math",
James Kuszmaul97f750d2019-01-20 20:08:03 -080084 "//aos/controls:control_loop_test",
85 "//aos/testing:googletest",
86 "//aos/time",
87 "//frc971/control_loops:position_sensor_sim",
88 "//frc971/control_loops:team_number_test_environment",
89 "//y2017/control_loops/superstructure/column:column_plants",
90 "//y2017/control_loops/superstructure/hood:hood_plants",
91 "//y2017/control_loops/superstructure/intake:intake_plants",
92 "//y2017/control_loops/superstructure/shooter:shooter_plants",
93 ],
Adam Snaidercfe13062017-02-05 18:23:09 -080094)
Austin Schuh7b9a3ba2017-02-19 23:11:45 -080095
96cc_binary(
James Kuszmaul97f750d2019-01-20 20:08:03 -080097 name = "superstructure",
98 srcs = [
99 "superstructure_main.cc",
100 ],
101 deps = [
102 ":superstructure_lib",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800103 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700104 "//aos/events:shm_event_loop",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800105 ],
Austin Schuh7b9a3ba2017-02-19 23:11:45 -0800106)
Parker Schuhfea48582017-03-11 20:15:32 -0800107
108cc_library(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800109 name = "vision_time_adjuster",
110 srcs = [
111 "vision_time_adjuster.cc",
112 ],
113 hdrs = [
114 "vision_time_adjuster.h",
115 ],
116 deps = [
James Kuszmaul97f750d2019-01-20 20:08:03 -0800117 "//aos/containers:ring_buffer",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700118 "//frc971/control_loops:control_loops_fbs",
119 "//frc971/control_loops:profiled_subsystem_fbs",
120 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800121 "//y2017/control_loops/drivetrain:polydrivetrain_plants",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700122 "//y2017/vision:vision_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800123 ],
Parker Schuhfea48582017-03-11 20:15:32 -0800124)
125
126cc_test(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800127 name = "vision_time_adjuster_test",
128 srcs = [
129 "vision_time_adjuster_test.cc",
130 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700131 data = ["//y2017:config.json"],
James Kuszmaul97f750d2019-01-20 20:08:03 -0800132 deps = [
133 ":vision_time_adjuster",
Austin Schuhb6c5c852019-05-19 20:13:31 -0700134 "//aos/events:simulated_event_loop",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800135 "//aos/testing:googletest",
Austin Schuhb6c5c852019-05-19 20:13:31 -0700136 "//aos/testing:test_logging",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800137 "//aos/time",
138 ],
Parker Schuhfea48582017-03-11 20:15:32 -0800139)
Parker Schuh208a58d2017-04-12 20:51:38 -0700140
141cc_library(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800142 name = "vision_distance_average",
143 hdrs = [
144 "vision_distance_average.h",
145 ],
146 deps = [
147 "//aos/containers:ring_buffer",
148 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700149 "//y2017/vision:vision_fbs",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800150 ],
Parker Schuh208a58d2017-04-12 20:51:38 -0700151)
152
153cc_test(
James Kuszmaul97f750d2019-01-20 20:08:03 -0800154 name = "vision_distance_average_test",
155 srcs = [
156 "vision_distance_average_test.cc",
157 ],
158 deps = [
159 ":vision_distance_average",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700160 "//aos:flatbuffers",
James Kuszmaul97f750d2019-01-20 20:08:03 -0800161 "//aos/testing:googletest",
162 "//aos/time",
163 ],
Parker Schuh208a58d2017-04-12 20:51:38 -0700164)