blob: a3f74f9010d72456fcfe24b9da28d05794020829 [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Henry Speiser354d2782022-07-22 13:56:48 -07003
4package(default_visibility = ["//visibility:public"])
5
James Kuszmaulf01da392023-12-14 11:22:14 -08006static_flatbuffer(
Henry Speiser354d2782022-07-22 13:56:48 -07007 name = "superstructure_goal_fbs",
8 srcs = [
9 "superstructure_goal.fbs",
10 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080011 deps = [
12 "//frc971/control_loops:control_loops_fbs",
13 "//frc971/control_loops:profiled_subsystem_fbs",
Henry Speiser354d2782022-07-22 13:56:48 -070014 ],
15)
16
James Kuszmaulf01da392023-12-14 11:22:14 -080017static_flatbuffer(
Henry Speiser354d2782022-07-22 13:56:48 -070018 name = "superstructure_output_fbs",
19 srcs = [
20 "superstructure_output.fbs",
21 ],
Henry Speiser354d2782022-07-22 13:56:48 -070022)
23
James Kuszmaulf01da392023-12-14 11:22:14 -080024static_flatbuffer(
Henry Speiser354d2782022-07-22 13:56:48 -070025 name = "superstructure_status_fbs",
26 srcs = [
27 "superstructure_status.fbs",
28 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080029 deps = [
30 "//frc971/control_loops:control_loops_fbs",
31 "//frc971/control_loops:profiled_subsystem_fbs",
Henry Speiser354d2782022-07-22 13:56:48 -070032 ],
33)
34
35flatbuffer_ts_library(
36 name = "superstructure_status_ts_fbs",
37 srcs = [
38 "superstructure_status.fbs",
39 ],
40 deps = [
41 "//frc971/control_loops:control_loops_ts_fbs",
42 "//frc971/control_loops:profiled_subsystem_ts_fbs",
43 ],
44)
45
James Kuszmaulf01da392023-12-14 11:22:14 -080046static_flatbuffer(
Henry Speiser354d2782022-07-22 13:56:48 -070047 name = "superstructure_position_fbs",
48 srcs = [
49 "superstructure_position.fbs",
50 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080051 deps = [
52 "//frc971/control_loops:control_loops_fbs",
53 "//frc971/control_loops:profiled_subsystem_fbs",
Henry Speiser354d2782022-07-22 13:56:48 -070054 ],
55)
56
57cc_library(
58 name = "superstructure_lib",
59 srcs = [
60 "superstructure.cc",
61 ],
62 hdrs = [
63 "superstructure.h",
64 ],
65 deps = [
66 ":superstructure_goal_fbs",
67 ":superstructure_output_fbs",
68 ":superstructure_position_fbs",
69 ":superstructure_status_fbs",
70 "//aos:flatbuffer_merge",
71 "//aos/events:event_loop",
72 "//frc971/control_loops:control_loop",
73 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
James Kuszmaulec635d22023-08-12 18:39:24 -070074 "//frc971/zeroing:pot_and_absolute_encoder",
Henry Speiser354d2782022-07-22 13:56:48 -070075 "//y2022_bot3:constants",
76 ],
77)
78
79cc_binary(
80 name = "superstructure",
81 srcs = [
82 "superstructure_main.cc",
83 ],
84 deps = [
85 ":superstructure_lib",
86 "//aos:init",
87 "//aos/events:shm_event_loop",
88 ],
89)
90
91cc_test(
92 name = "superstructure_lib_test",
93 srcs = [
94 "superstructure_lib_test.cc",
95 ],
96 data = [
97 "//y2022_bot3:aos_config",
98 ],
99 deps = [
100 ":superstructure_goal_fbs",
101 ":superstructure_lib",
102 ":superstructure_output_fbs",
103 ":superstructure_position_fbs",
104 ":superstructure_status_fbs",
105 "//aos:math",
106 "//aos/events/logging:log_writer",
107 "//aos/testing:googletest",
108 "//aos/time",
109 "//frc971/control_loops:capped_test_plant",
110 "//frc971/control_loops:control_loop_test",
111 "//frc971/control_loops:position_sensor_sim",
Niko Sohmerse69ee2d2022-09-28 19:52:27 -0700112 "//frc971/control_loops:subsystem_simulator",
Henry Speiser354d2782022-07-22 13:56:48 -0700113 "//frc971/control_loops:team_number_test_environment",
114 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
115 ],
116)
117
118cc_binary(
119 name = "superstructure_replay",
120 srcs = ["superstructure_replay.cc"],
121 deps = [
122 ":superstructure_lib",
123 "//aos:configuration",
124 "//aos:init",
125 "//aos/events:simulated_event_loop",
126 "//aos/events/logging:log_reader",
127 "//aos/network:team_number",
128 ],
129)