blob: 644b53bd873250b31c8a72e99e71b6177d63ce4d [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",
79 ],
80)
81
82cc_binary(
83 name = "superstructure",
84 srcs = [
85 "superstructure_main.cc",
86 ],
87 deps = [
88 ":superstructure_lib",
89 "//aos:init",
90 "//aos/events:shm_event_loop",
91 ],
92)
93
94cc_test(
95 name = "superstructure_lib_test",
96 srcs = [
97 "superstructure_lib_test.cc",
98 ],
99 data = [
100 "//y2022:config",
101 ],
102 deps = [
103 ":superstructure_goal_fbs",
104 ":superstructure_lib",
105 ":superstructure_output_fbs",
106 ":superstructure_position_fbs",
107 ":superstructure_status_fbs",
108 "//aos:math",
109 "//aos/events/logging:log_writer",
110 "//aos/testing:googletest",
111 "//aos/time",
112 "//frc971/control_loops:capped_test_plant",
113 "//frc971/control_loops:control_loop_test",
114 "//frc971/control_loops:position_sensor_sim",
115 "//frc971/control_loops:team_number_test_environment",
116 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
117 ],
118)
119
120ts_library(
121 name = "superstructure_plotter",
122 srcs = ["superstructure_plotter.ts"],
123 target_compatible_with = ["@platforms//os:linux"],
124 deps = [
125 "//aos/network/www:aos_plotter",
126 "//aos/network/www:colors",
127 "//aos/network/www:proxy",
128 ],
129)
Austin Schuh76f227c2022-02-23 16:34:08 -0800130
131ts_library(
132 name = "catapult_plotter",
133 srcs = ["catapult_plotter.ts"],
134 target_compatible_with = ["@platforms//os:linux"],
135 deps = [
136 "//aos/network/www:aos_plotter",
137 "//aos/network/www:colors",
138 "//aos/network/www:proxy",
139 ],
140)