blob: cd3f7c3538a40724e72f6eda59dc1299340dcc49 [file] [log] [blame]
Austin Schuh76f227c2022-02-23 16:34:08 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library")
milind-u086d7262022-01-19 20:44:18 -08002load("@npm//@bazel/typescript:index.bzl", "ts_library")
3
4package(default_visibility = ["//visibility:public"])
5
6flatbuffer_cc_library(
7 name = "superstructure_goal_fbs",
8 srcs = [
9 "superstructure_goal.fbs",
10 ],
11 gen_reflections = 1,
12 includes = [
13 "//frc971/control_loops:control_loops_fbs_includes",
14 "//frc971/control_loops:profiled_subsystem_fbs_includes",
15 ],
16)
17
18flatbuffer_cc_library(
19 name = "superstructure_output_fbs",
20 srcs = [
21 "superstructure_output.fbs",
22 ],
23 gen_reflections = 1,
24)
25
26flatbuffer_cc_library(
Milind Upadhyay482b0ba2022-02-26 21:51:59 -080027 name = "superstructure_can_position_fbs",
28 srcs = [
29 "superstructure_can_position.fbs",
30 ],
31 gen_reflections = 1,
32)
33
34flatbuffer_cc_library(
milind-u086d7262022-01-19 20:44:18 -080035 name = "superstructure_status_fbs",
36 srcs = [
37 "superstructure_status.fbs",
38 ],
39 gen_reflections = 1,
40 includes = [
41 "//frc971/control_loops:control_loops_fbs_includes",
42 "//frc971/control_loops:profiled_subsystem_fbs_includes",
43 ],
44)
45
Austin Schuh76f227c2022-02-23 16:34:08 -080046flatbuffer_ts_library(
47 name = "superstructure_status_ts_fbs",
48 srcs = [
49 "superstructure_status.fbs",
50 ],
51 includes = [
52 "//frc971/control_loops:control_loops_fbs_includes",
53 "//frc971/control_loops:profiled_subsystem_fbs_includes",
54 ],
55 target_compatible_with = ["@platforms//os:linux"],
56)
57
milind-u086d7262022-01-19 20:44:18 -080058flatbuffer_cc_library(
59 name = "superstructure_position_fbs",
60 srcs = [
61 "superstructure_position.fbs",
62 ],
63 gen_reflections = 1,
64 includes = [
65 "//frc971/control_loops:control_loops_fbs_includes",
66 "//frc971/control_loops:profiled_subsystem_fbs_includes",
67 ],
68)
69
70cc_library(
71 name = "superstructure_lib",
72 srcs = [
73 "superstructure.cc",
74 ],
75 hdrs = [
76 "superstructure.h",
77 ],
78 deps = [
79 ":superstructure_goal_fbs",
80 ":superstructure_output_fbs",
81 ":superstructure_position_fbs",
82 ":superstructure_status_fbs",
83 "//aos/events:event_loop",
84 "//frc971/control_loops:control_loop",
Henry Speiser55aa3ba2022-02-21 23:21:12 -080085 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u086d7262022-01-19 20:44:18 -080086 "//y2022:constants",
Austin Schuh39f26f62022-02-24 21:34:46 -080087 "//y2022/control_loops/superstructure/catapult",
milind-u086d7262022-01-19 20:44:18 -080088 ],
89)
90
91cc_binary(
92 name = "superstructure",
93 srcs = [
94 "superstructure_main.cc",
95 ],
96 deps = [
97 ":superstructure_lib",
98 "//aos:init",
99 "//aos/events:shm_event_loop",
100 ],
101)
102
103cc_test(
104 name = "superstructure_lib_test",
105 srcs = [
106 "superstructure_lib_test.cc",
107 ],
108 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800109 "//y2022:aos_config",
milind-u086d7262022-01-19 20:44:18 -0800110 ],
111 deps = [
112 ":superstructure_goal_fbs",
113 ":superstructure_lib",
114 ":superstructure_output_fbs",
115 ":superstructure_position_fbs",
116 ":superstructure_status_fbs",
117 "//aos:math",
118 "//aos/events/logging:log_writer",
119 "//aos/testing:googletest",
120 "//aos/time",
121 "//frc971/control_loops:capped_test_plant",
122 "//frc971/control_loops:control_loop_test",
123 "//frc971/control_loops:position_sensor_sim",
124 "//frc971/control_loops:team_number_test_environment",
125 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
126 ],
127)
128
129ts_library(
130 name = "superstructure_plotter",
131 srcs = ["superstructure_plotter.ts"],
132 target_compatible_with = ["@platforms//os:linux"],
133 deps = [
134 "//aos/network/www:aos_plotter",
135 "//aos/network/www:colors",
136 "//aos/network/www:proxy",
137 ],
138)
Austin Schuh76f227c2022-02-23 16:34:08 -0800139
140ts_library(
141 name = "catapult_plotter",
142 srcs = ["catapult_plotter.ts"],
143 target_compatible_with = ["@platforms//os:linux"],
144 deps = [
145 "//aos/network/www:aos_plotter",
146 "//aos/network/www:colors",
147 "//aos/network/www:proxy",
148 ],
149)