blob: f08bb80dad452260fee50dab6141e535292fab01 [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(
27 name = "superstructure_status_fbs",
28 srcs = [
29 "superstructure_status.fbs",
30 ],
31 gen_reflections = 1,
32 includes = [
33 "//frc971/control_loops:control_loops_fbs_includes",
34 "//frc971/control_loops:profiled_subsystem_fbs_includes",
35 ],
36)
37
Austin Schuh76f227c2022-02-23 16:34:08 -080038flatbuffer_ts_library(
39 name = "superstructure_status_ts_fbs",
40 srcs = [
41 "superstructure_status.fbs",
42 ],
43 includes = [
44 "//frc971/control_loops:control_loops_fbs_includes",
45 "//frc971/control_loops:profiled_subsystem_fbs_includes",
46 ],
47 target_compatible_with = ["@platforms//os:linux"],
48)
49
milind-u086d7262022-01-19 20:44:18 -080050flatbuffer_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 ":superstructure_goal_fbs",
72 ":superstructure_output_fbs",
73 ":superstructure_position_fbs",
74 ":superstructure_status_fbs",
75 "//aos/events:event_loop",
76 "//frc971/control_loops:control_loop",
Henry Speiser55aa3ba2022-02-21 23:21:12 -080077 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u086d7262022-01-19 20:44:18 -080078 "//y2022:constants",
Austin Schuh39f26f62022-02-24 21:34:46 -080079 "//y2022/control_loops/superstructure/catapult",
milind-u086d7262022-01-19 20:44:18 -080080 ],
81)
82
83cc_binary(
84 name = "superstructure",
85 srcs = [
86 "superstructure_main.cc",
87 ],
88 deps = [
89 ":superstructure_lib",
90 "//aos:init",
91 "//aos/events:shm_event_loop",
92 ],
93)
94
95cc_test(
96 name = "superstructure_lib_test",
97 srcs = [
98 "superstructure_lib_test.cc",
99 ],
100 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800101 "//y2022:aos_config",
milind-u086d7262022-01-19 20:44:18 -0800102 ],
103 deps = [
104 ":superstructure_goal_fbs",
105 ":superstructure_lib",
106 ":superstructure_output_fbs",
107 ":superstructure_position_fbs",
108 ":superstructure_status_fbs",
109 "//aos:math",
110 "//aos/events/logging:log_writer",
111 "//aos/testing:googletest",
112 "//aos/time",
113 "//frc971/control_loops:capped_test_plant",
114 "//frc971/control_loops:control_loop_test",
115 "//frc971/control_loops:position_sensor_sim",
116 "//frc971/control_loops:team_number_test_environment",
117 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
118 ],
119)
120
121ts_library(
122 name = "superstructure_plotter",
123 srcs = ["superstructure_plotter.ts"],
124 target_compatible_with = ["@platforms//os:linux"],
125 deps = [
126 "//aos/network/www:aos_plotter",
127 "//aos/network/www:colors",
128 "//aos/network/www:proxy",
129 ],
130)
Austin Schuh76f227c2022-02-23 16:34:08 -0800131
132ts_library(
133 name = "catapult_plotter",
134 srcs = ["catapult_plotter.ts"],
135 target_compatible_with = ["@platforms//os:linux"],
136 deps = [
137 "//aos/network/www:aos_plotter",
138 "//aos/network/www:colors",
139 "//aos/network/www:proxy",
140 ],
141)