blob: 996d28bf9f8d1e683785bf5326b5e08a7dce443e [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001load("//tools/build_rules:js.bzl", "ts_project")
2load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
3load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
4
5package(default_visibility = ["//visibility:public"])
6
7static_flatbuffer(
8 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
12 deps = [
13 "//frc971/control_loops:control_loops_fbs",
14 "//frc971/control_loops:profiled_subsystem_fbs",
15 ],
16)
17
18static_flatbuffer(
19 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
23)
24
25static_flatbuffer(
26 name = "superstructure_status_fbs",
27 srcs = [
28 "superstructure_status.fbs",
29 ],
30 deps = [
31 "//frc971/control_loops:control_loops_fbs",
32 "//frc971/control_loops:profiled_subsystem_fbs",
33 ],
34)
35
36flatbuffer_ts_library(
37 name = "superstructure_status_ts_fbs",
38 srcs = [
39 "superstructure_status.fbs",
40 ],
41 deps = [
42 "//frc971/control_loops:control_loops_ts_fbs",
43 "//frc971/control_loops:profiled_subsystem_ts_fbs",
44 ],
45)
46
47static_flatbuffer(
48 name = "superstructure_position_fbs",
49 srcs = [
50 "superstructure_position.fbs",
51 ],
52 deps = [
53 "//frc971/control_loops:control_loops_fbs",
54 "//frc971/control_loops:profiled_subsystem_fbs",
55 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
56 ],
57)
58
59cc_library(
60 name = "superstructure_lib",
61 srcs = [
62 "superstructure.cc",
63 ],
64 hdrs = [
65 "superstructure.h",
66 ],
67 data = [
68 ],
69 deps = [
70 ":superstructure_goal_fbs",
71 ":superstructure_output_fbs",
72 ":superstructure_position_fbs",
73 ":superstructure_status_fbs",
74 "//aos:flatbuffer_merge",
75 "//aos/events:event_loop",
76 "//frc971/constants:constants_sender_lib",
77 "//frc971/control_loops:control_loop",
78 "//frc971/control_loops/drivetrain:drivetrain_can_position_fbs",
79 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
80 "//frc971/shooter_interpolation:interpolation",
81 "//frc971/zeroing:absolute_encoder",
82 "//frc971/zeroing:pot_and_absolute_encoder",
83 "//y2024:constants",
84 "//y2024/constants:constants_fbs",
85 "//y2024/constants:simulated_constants_sender",
86 ],
87)
88
89cc_binary(
90 name = "superstructure",
91 srcs = [
92 "superstructure_main.cc",
93 ],
94 deps = [
95 ":superstructure_lib",
96 "//aos:init",
97 "//aos/events:shm_event_loop",
98 ],
99)
100
101cc_test(
102 name = "superstructure_lib_test",
103 srcs = [
104 "superstructure_lib_test.cc",
105 ],
106 data = [
107 "//y2024:aos_config",
108 ],
109 deps = [
110 ":superstructure_goal_fbs",
111 ":superstructure_lib",
112 ":superstructure_output_fbs",
113 ":superstructure_position_fbs",
114 ":superstructure_status_fbs",
115 "//aos:json_to_flatbuffer",
116 "//aos:math",
117 "//aos/events/logging:log_writer",
118 "//aos/testing:googletest",
119 "//aos/time",
120 "//frc971/control_loops:capped_test_plant",
121 "//frc971/control_loops:control_loop_test",
122 "//frc971/control_loops:position_sensor_sim",
123 "//frc971/control_loops:subsystem_simulator",
124 "//frc971/control_loops:team_number_test_environment",
125 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
126 ],
127)
128
129cc_binary(
130 name = "superstructure_replay",
131 srcs = ["superstructure_replay.cc"],
132 deps = [
133 ":superstructure_lib",
134 "//aos:configuration",
135 "//aos:init",
136 "//aos/events:simulated_event_loop",
137 "//aos/events/logging:log_reader",
138 "//aos/network:team_number",
139 ],
140)
141
142ts_project(
143 name = "superstructure_plotter",
144 srcs = ["superstructure_plotter.ts"],
145 target_compatible_with = ["@platforms//os:linux"],
146 deps = [
147 "//aos/network/www:aos_plotter",
148 "//aos/network/www:colors",
149 "//aos/network/www:proxy",
150 ],
151)