blob: 5da5250c0570c357a7c1d66555a5e67e955c68a8 [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 ],
90 deps = [
Maxwell Henderson589cf272023-02-22 15:56:40 -080091 ":end_effector",
Maxwell Hendersonad312342023-01-10 12:07:47 -080092 ":superstructure_goal_fbs",
93 ":superstructure_output_fbs",
94 ":superstructure_position_fbs",
95 ":superstructure_status_fbs",
96 "//aos:flatbuffer_merge",
97 "//aos/events:event_loop",
98 "//frc971/control_loops:control_loop",
99 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
100 "//y2023:constants",
milind-u738832d2023-02-24 19:55:54 -0800101 "//y2023/control_loops/drivetrain:drivetrain_can_position_fbs",
milind-u01bbcf22023-02-20 18:00:28 -0800102 "//y2023/control_loops/superstructure/arm",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800103 ],
104)
105
106cc_binary(
107 name = "superstructure",
108 srcs = [
109 "superstructure_main.cc",
110 ],
111 deps = [
112 ":superstructure_lib",
113 "//aos:init",
114 "//aos/events:shm_event_loop",
115 ],
116)
117
118cc_test(
119 name = "superstructure_lib_test",
120 srcs = [
121 "superstructure_lib_test.cc",
122 ],
123 data = [
124 "//y2023:aos_config",
125 ],
126 deps = [
127 ":superstructure_goal_fbs",
128 ":superstructure_lib",
129 ":superstructure_output_fbs",
130 ":superstructure_position_fbs",
131 ":superstructure_status_fbs",
132 "//aos:math",
133 "//aos/events/logging:log_writer",
134 "//aos/testing:googletest",
135 "//aos/time",
136 "//frc971/control_loops:capped_test_plant",
137 "//frc971/control_loops:control_loop_test",
138 "//frc971/control_loops:position_sensor_sim",
139 "//frc971/control_loops:subsystem_simulator",
140 "//frc971/control_loops:team_number_test_environment",
141 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u18a901d2023-02-17 21:51:55 -0800142 "//y2023/control_loops/superstructure/roll:roll_plants",
Maxwell Hendersonad312342023-01-10 12:07:47 -0800143 ],
144)
145
146cc_binary(
147 name = "superstructure_replay",
148 srcs = ["superstructure_replay.cc"],
149 deps = [
150 ":superstructure_lib",
151 "//aos:configuration",
152 "//aos:init",
153 "//aos/events:simulated_event_loop",
154 "//aos/events/logging:log_reader",
155 "//aos/network:team_number",
156 ],
157)
158
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800159ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800160 name = "superstructure_plotter",
161 srcs = ["superstructure_plotter.ts"],
162 target_compatible_with = ["@platforms//os:linux"],
163 deps = [
164 "//aos/network/www:aos_plotter",
165 "//aos/network/www:colors",
166 "//aos/network/www:proxy",
167 ],
168)