blob: e6f14aad266d75315ad248c31d1bc4766da10e89 [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",
milind-u738832d2023-02-24 19:55:54 -080059 "//frc971/vision:calibration_fbs_includes",
60 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs_includes",
Maxwell Hendersonad312342023-01-10 12:07:47 -080061 ],
62)
63
64cc_library(
Maxwell Henderson589cf272023-02-22 15:56:40 -080065 name = "end_effector",
66 srcs = [
67 "end_effector.cc",
68 ],
69 hdrs = [
70 "end_effector.h",
71 ],
72 deps = [
73 ":superstructure_goal_fbs",
Maxwell Henderson589cf272023-02-22 15:56:40 -080074 ":superstructure_status_fbs",
75 "//aos/events:event_loop",
76 "//aos/time",
77 "//frc971/control_loops:control_loop",
78 "//y2023:constants",
79 ],
80)
81
82cc_library(
Maxwell Hendersonad312342023-01-10 12:07:47 -080083 name = "superstructure_lib",
84 srcs = [
85 "superstructure.cc",
86 ],
87 hdrs = [
88 "superstructure.h",
89 ],
Maxwell Hendersonb392b742023-03-05 07:53:51 -080090 data = [
91 "//y2023/control_loops/superstructure/arm:arm_trajectories_generated.bfbs",
92 ],
Maxwell Hendersonad312342023-01-10 12:07:47 -080093 deps = [
Maxwell Henderson589cf272023-02-22 15:56:40 -080094 ":end_effector",
Maxwell Hendersonad312342023-01-10 12:07:47 -080095 ":superstructure_goal_fbs",
96 ":superstructure_output_fbs",
97 ":superstructure_position_fbs",
98 ":superstructure_status_fbs",
99 "//aos:flatbuffer_merge",
100 "//aos/events:event_loop",
101 "//frc971/control_loops:control_loop",
102 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
103 "//y2023:constants",
milind-u738832d2023-02-24 19:55:54 -0800104 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
milind-u01bbcf22023-02-20 18:00:28 -0800105 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800106 "//y2023/control_loops/superstructure/arm:arm_trajectories_fbs",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800107 ],
108)
109
110cc_binary(
111 name = "superstructure",
112 srcs = [
113 "superstructure_main.cc",
114 ],
115 deps = [
116 ":superstructure_lib",
117 "//aos:init",
118 "//aos/events:shm_event_loop",
119 ],
120)
121
122cc_test(
123 name = "superstructure_lib_test",
124 srcs = [
125 "superstructure_lib_test.cc",
126 ],
127 data = [
128 "//y2023:aos_config",
129 ],
130 deps = [
131 ":superstructure_goal_fbs",
132 ":superstructure_lib",
133 ":superstructure_output_fbs",
134 ":superstructure_position_fbs",
135 ":superstructure_status_fbs",
Maxwell Hendersonb392b742023-03-05 07:53:51 -0800136 "//aos:json_to_flatbuffer",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800137 "//aos:math",
138 "//aos/events/logging:log_writer",
139 "//aos/testing:googletest",
140 "//aos/time",
141 "//frc971/control_loops:capped_test_plant",
142 "//frc971/control_loops:control_loop_test",
143 "//frc971/control_loops:position_sensor_sim",
144 "//frc971/control_loops:subsystem_simulator",
145 "//frc971/control_loops:team_number_test_environment",
146 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u18a901d2023-02-17 21:51:55 -0800147 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800148 ],
149)
150
151cc_binary(
152 name = "superstructure_replay",
153 srcs = ["superstructure_replay.cc"],
154 deps = [
155 ":superstructure_lib",
156 "//aos:configuration",
157 "//aos:init",
158 "//aos/events:simulated_event_loop",
159 "//aos/events/logging:log_reader",
160 "//aos/network:team_number",
161 ],
162)
163
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800164ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800165 name = "superstructure_plotter",
166 srcs = ["superstructure_plotter.ts"],
167 target_compatible_with = ["@platforms//os:linux"],
168 deps = [
169 "//aos/network/www:aos_plotter",
170 "//aos/network/www:colors",
171 "//aos/network/www:proxy",
172 ],
173)