blob: 2700bbce4d0351ae9279dcb7e5fe684ac385a4bb [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,
James Kuszmaul202e4382023-03-05 14:56:55 -080013 deps = [
14 "//frc971/control_loops:control_loops_fbs",
15 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080016 ],
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,
James Kuszmaul202e4382023-03-05 14:56:55 -080033 deps = [
34 "//frc971/control_loops:control_loops_fbs",
35 "//frc971/control_loops:profiled_subsystem_fbs",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080036 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080037 ],
38)
39
40flatbuffer_ts_library(
41 name = "superstructure_status_ts_fbs",
42 srcs = [
43 "superstructure_status.fbs",
44 ],
45 deps = [
46 "//frc971/control_loops:control_loops_ts_fbs",
47 "//frc971/control_loops:profiled_subsystem_ts_fbs",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080048 "//y2023/vision:game_pieces_ts_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080049 ],
50)
51
52flatbuffer_cc_library(
53 name = "superstructure_position_fbs",
54 srcs = [
55 "superstructure_position.fbs",
56 ],
57 gen_reflections = 1,
James Kuszmaul202e4382023-03-05 14:56:55 -080058 deps = [
59 "//frc971/control_loops:control_loops_fbs",
60 "//frc971/control_loops:profiled_subsystem_fbs",
61 "//frc971/vision:calibration_fbs",
62 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -080063 ],
64)
65
66cc_library(
Maxwell Henderson589cf272023-02-22 15:56:40 -080067 name = "end_effector",
68 srcs = [
69 "end_effector.cc",
70 ],
71 hdrs = [
72 "end_effector.h",
73 ],
74 deps = [
75 ":superstructure_goal_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080076 ":superstructure_status_fbs",
77 "//aos/events:event_loop",
78 "//aos/time",
79 "//frc971/control_loops:control_loop",
80 "//y2023:constants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -080081 "//y2023/vision:game_pieces_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080082 ],
83)
84
85cc_library(
Maxwell Hendersonad312342023-01-10 12:07:47 -080086 name = "superstructure_lib",
87 srcs = [
88 "superstructure.cc",
89 ],
90 hdrs = [
91 "superstructure.h",
92 ],
Maxwell Hendersonb392b742023-03-05 07:53:51 -080093 data = [
94 "//y2023/control_loops/superstructure/arm:arm_trajectories_generated.bfbs",
95 ],
Maxwell Hendersonad312342023-01-10 12:07:47 -080096 deps = [
Maxwell Henderson589cf272023-02-22 15:56:40 -080097 ":end_effector",
Maxwell Hendersonad312342023-01-10 12:07:47 -080098 ":superstructure_goal_fbs",
99 ":superstructure_output_fbs",
100 ":superstructure_position_fbs",
101 ":superstructure_status_fbs",
102 "//aos:flatbuffer_merge",
103 "//aos/events:event_loop",
104 "//frc971/control_loops:control_loop",
105 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
106 "//y2023:constants",
milind-u738832d2023-02-24 19:55:54 -0800107 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
milind-u01bbcf22023-02-20 18:00:28 -0800108 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800109 "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800110 ],
111)
112
113cc_binary(
114 name = "superstructure",
115 srcs = [
116 "superstructure_main.cc",
117 ],
118 deps = [
119 ":superstructure_lib",
120 "//aos:init",
121 "//aos/events:shm_event_loop",
122 ],
123)
124
125cc_test(
126 name = "superstructure_lib_test",
127 srcs = [
128 "superstructure_lib_test.cc",
129 ],
130 data = [
131 "//y2023:aos_config",
132 ],
133 deps = [
134 ":superstructure_goal_fbs",
135 ":superstructure_lib",
136 ":superstructure_output_fbs",
137 ":superstructure_position_fbs",
138 ":superstructure_status_fbs",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800139 "//aos:json_to_flatbuffer",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800140 "//aos:math",
141 "//aos/events/logging:log_writer",
142 "//aos/testing:googletest",
143 "//aos/time",
144 "//frc971/control_loops:capped_test_plant",
145 "//frc971/control_loops:control_loop_test",
146 "//frc971/control_loops:position_sensor_sim",
147 "//frc971/control_loops:subsystem_simulator",
148 "//frc971/control_loops:team_number_test_environment",
149 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u18a901d2023-02-17 21:51:55 -0800150 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonbf1bcec2023-03-05 18:00:20 -0800151 "//y2023/vision:game_pieces_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800152 ],
153)
154
155cc_binary(
156 name = "superstructure_replay",
157 srcs = ["superstructure_replay.cc"],
158 deps = [
159 ":superstructure_lib",
160 "//aos:configuration",
161 "//aos:init",
162 "//aos/events:simulated_event_loop",
163 "//aos/events/logging:log_reader",
164 "//aos/network:team_number",
165 ],
166)
167
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800168ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800169 name = "superstructure_plotter",
170 srcs = ["superstructure_plotter.ts"],
171 target_compatible_with = ["@platforms//os:linux"],
172 deps = [
173 "//aos/network/www:aos_plotter",
174 "//aos/network/www:colors",
175 "//aos/network/www:proxy",
176 ],
177)