blob: d00489af9fd5718cbc8467782f211d817da3a069 [file] [log] [blame]
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08001load("//tools/build_rules:js.bzl", "ts_project")
Maxwell Hendersonad312342023-01-10 12:07:47 -08002load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
3load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Maxwell Hendersonad312342023-01-10 12:07:47 -08004
5package(default_visibility = ["//visibility:public"])
6
7flatbuffer_cc_library(
8 name = "superstructure_goal_fbs",
9 srcs = [
10 "superstructure_goal.fbs",
11 ],
12 gen_reflections = 1,
13 includes = [
14 "//frc971/control_loops:control_loops_fbs_includes",
15 "//frc971/control_loops:profiled_subsystem_fbs_includes",
16 ],
17)
18
19flatbuffer_cc_library(
20 name = "superstructure_output_fbs",
21 srcs = [
22 "superstructure_output.fbs",
23 ],
24 gen_reflections = 1,
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_ts_library(
40 name = "superstructure_status_ts_fbs",
41 srcs = [
42 "superstructure_status.fbs",
43 ],
44 deps = [
45 "//frc971/control_loops:control_loops_ts_fbs",
46 "//frc971/control_loops:profiled_subsystem_ts_fbs",
47 ],
48)
49
50flatbuffer_cc_library(
51 name = "superstructure_position_fbs",
52 srcs = [
53 "superstructure_position.fbs",
54 ],
55 gen_reflections = 1,
56 includes = [
57 "//frc971/control_loops:control_loops_fbs_includes",
58 "//frc971/control_loops:profiled_subsystem_fbs_includes",
59 ],
60)
61
62cc_library(
Maxwell Henderson589cf272023-02-22 15:56:40 -080063 name = "end_effector",
64 srcs = [
65 "end_effector.cc",
66 ],
67 hdrs = [
68 "end_effector.h",
69 ],
70 deps = [
71 ":superstructure_goal_fbs",
72 ":superstructure_position_fbs",
73 ":superstructure_status_fbs",
74 "//aos/events:event_loop",
75 "//aos/time",
76 "//frc971/control_loops:control_loop",
77 "//y2023:constants",
78 ],
79)
80
81cc_library(
Maxwell Hendersonad312342023-01-10 12:07:47 -080082 name = "superstructure_lib",
83 srcs = [
84 "superstructure.cc",
85 ],
86 hdrs = [
87 "superstructure.h",
88 ],
89 deps = [
Maxwell Henderson589cf272023-02-22 15:56:40 -080090 ":end_effector",
Maxwell Hendersonad312342023-01-10 12:07:47 -080091 ":superstructure_goal_fbs",
92 ":superstructure_output_fbs",
93 ":superstructure_position_fbs",
94 ":superstructure_status_fbs",
95 "//aos:flatbuffer_merge",
96 "//aos/events:event_loop",
97 "//frc971/control_loops:control_loop",
98 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
99 "//y2023:constants",
milind-u01bbcf22023-02-20 18:00:28 -0800100 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800101 ],
102)
103
104cc_binary(
105 name = "superstructure",
106 srcs = [
107 "superstructure_main.cc",
108 ],
109 deps = [
110 ":superstructure_lib",
111 "//aos:init",
112 "//aos/events:shm_event_loop",
113 ],
114)
115
116cc_test(
117 name = "superstructure_lib_test",
118 srcs = [
119 "superstructure_lib_test.cc",
120 ],
121 data = [
122 "//y2023:aos_config",
123 ],
124 deps = [
125 ":superstructure_goal_fbs",
126 ":superstructure_lib",
127 ":superstructure_output_fbs",
128 ":superstructure_position_fbs",
129 ":superstructure_status_fbs",
130 "//aos:math",
131 "//aos/events/logging:log_writer",
132 "//aos/testing:googletest",
133 "//aos/time",
134 "//frc971/control_loops:capped_test_plant",
135 "//frc971/control_loops:control_loop_test",
136 "//frc971/control_loops:position_sensor_sim",
137 "//frc971/control_loops:subsystem_simulator",
138 "//frc971/control_loops:team_number_test_environment",
139 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u18a901d2023-02-17 21:51:55 -0800140 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800141 ],
142)
143
144cc_binary(
145 name = "superstructure_replay",
146 srcs = ["superstructure_replay.cc"],
147 deps = [
148 ":superstructure_lib",
149 "//aos:configuration",
150 "//aos:init",
151 "//aos/events:simulated_event_loop",
152 "//aos/events/logging:log_reader",
153 "//aos/network:team_number",
154 ],
155)
156
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800157ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800158 name = "superstructure_plotter",
159 srcs = ["superstructure_plotter.ts"],
160 target_compatible_with = ["@platforms//os:linux"],
161 deps = [
162 "//aos/network/www:aos_plotter",
163 "//aos/network/www:colors",
164 "//aos/network/www:proxy",
165 ],
166)