blob: 718a575992ebf6c0f6df439e81d621e11818d7a6 [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(
63 name = "superstructure_lib",
64 srcs = [
65 "superstructure.cc",
66 ],
67 hdrs = [
68 "superstructure.h",
69 ],
70 deps = [
71 # ":collision_avoidance_lib",
72 ":superstructure_goal_fbs",
73 ":superstructure_output_fbs",
74 ":superstructure_position_fbs",
75 ":superstructure_status_fbs",
76 "//aos:flatbuffer_merge",
77 "//aos/events:event_loop",
78 "//frc971/control_loops:control_loop",
79 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
80 "//y2023:constants",
81 ],
82)
83
84cc_binary(
85 name = "superstructure",
86 srcs = [
87 "superstructure_main.cc",
88 ],
89 deps = [
90 ":superstructure_lib",
91 "//aos:init",
92 "//aos/events:shm_event_loop",
93 ],
94)
95
96cc_test(
97 name = "superstructure_lib_test",
98 srcs = [
99 "superstructure_lib_test.cc",
100 ],
101 data = [
102 "//y2023:aos_config",
103 ],
104 deps = [
105 ":superstructure_goal_fbs",
106 ":superstructure_lib",
107 ":superstructure_output_fbs",
108 ":superstructure_position_fbs",
109 ":superstructure_status_fbs",
110 "//aos:math",
111 "//aos/events/logging:log_writer",
112 "//aos/testing:googletest",
113 "//aos/time",
114 "//frc971/control_loops:capped_test_plant",
115 "//frc971/control_loops:control_loop_test",
116 "//frc971/control_loops:position_sensor_sim",
117 "//frc971/control_loops:subsystem_simulator",
118 "//frc971/control_loops:team_number_test_environment",
119 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
120 ],
121)
122
123cc_binary(
124 name = "superstructure_replay",
125 srcs = ["superstructure_replay.cc"],
126 deps = [
127 ":superstructure_lib",
128 "//aos:configuration",
129 "//aos:init",
130 "//aos/events:simulated_event_loop",
131 "//aos/events/logging:log_reader",
132 "//aos/network:team_number",
133 ],
134)
135
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800136ts_project(
Maxwell Hendersonad312342023-01-10 12:07:47 -0800137 name = "superstructure_plotter",
138 srcs = ["superstructure_plotter.ts"],
139 target_compatible_with = ["@platforms//os:linux"],
140 deps = [
141 "//aos/network/www:aos_plotter",
142 "//aos/network/www:colors",
143 "//aos/network/www:proxy",
144 ],
145)