blob: 606c6df593bfd2bd9351ce58819fb610d938fbc3 [file] [log] [blame]
James Kuszmaulf01da392023-12-14 11:22:14 -08001load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Philipp Schrader3de4dfc2023-02-15 20:18:25 -08002load("//tools/build_rules:js.bzl", "ts_project")
Ravago Jones486de802021-05-19 20:47:55 -07003
Philipp Schradercc016b32021-12-30 08:59:58 -08004package(default_visibility = ["//visibility:public"])
5
James Kuszmaulf01da392023-12-14 11:22:14 -08006static_flatbuffer(
Ravago Jones486de802021-05-19 20:47:55 -07007 name = "superstructure_goal_fbs",
8 srcs = [
9 "superstructure_goal.fbs",
10 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080011 deps = [
12 "//frc971/control_loops:control_loops_fbs",
13 "//frc971/control_loops:profiled_subsystem_fbs",
Ravago Jones486de802021-05-19 20:47:55 -070014 ],
15)
16
James Kuszmaulf01da392023-12-14 11:22:14 -080017static_flatbuffer(
Ravago Jones486de802021-05-19 20:47:55 -070018 name = "superstructure_output_fbs",
19 srcs = [
20 "superstructure_output.fbs",
21 ],
Ravago Jones486de802021-05-19 20:47:55 -070022)
23
James Kuszmaulf01da392023-12-14 11:22:14 -080024static_flatbuffer(
Ravago Jones486de802021-05-19 20:47:55 -070025 name = "superstructure_status_fbs",
26 srcs = [
27 "superstructure_status.fbs",
28 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080029 deps = [
30 "//frc971/control_loops:control_loops_fbs",
31 "//frc971/control_loops:profiled_subsystem_fbs",
Ravago Jones486de802021-05-19 20:47:55 -070032 ],
33)
34
James Kuszmaulf01da392023-12-14 11:22:14 -080035static_flatbuffer(
Ravago Jones486de802021-05-19 20:47:55 -070036 name = "superstructure_position_fbs",
37 srcs = [
38 "superstructure_position.fbs",
39 ],
James Kuszmaulf01da392023-12-14 11:22:14 -080040 deps = [
41 "//frc971/control_loops:control_loops_fbs",
42 "//frc971/control_loops:profiled_subsystem_fbs",
Ravago Jones486de802021-05-19 20:47:55 -070043 ],
44)
45
46cc_library(
47 name = "superstructure_lib",
48 srcs = [
49 "superstructure.cc",
50 ],
51 hdrs = [
52 "superstructure.h",
53 ],
54 deps = [
55 ":superstructure_goal_fbs",
56 ":superstructure_output_fbs",
57 ":superstructure_position_fbs",
58 ":superstructure_status_fbs",
Ravago Jones486de802021-05-19 20:47:55 -070059 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070060 "//frc971/control_loops:control_loop",
Ravago Jones486de802021-05-19 20:47:55 -070061 "//y2021_bot3:constants",
62 ],
63)
64
65cc_binary(
66 name = "superstructure",
67 srcs = [
68 "superstructure_main.cc",
69 ],
70 deps = [
71 ":superstructure_lib",
72 "//aos:init",
73 "//aos/events:shm_event_loop",
74 ],
75)
Sabina Leaver24f83be2021-09-01 20:40:59 -070076
77cc_test(
78 name = "superstructure_lib_test",
79 srcs = [
80 "superstructure_lib_test.cc",
81 ],
82 data = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -080083 "//y2021_bot3:aos_config",
Sabina Leaver24f83be2021-09-01 20:40:59 -070084 ],
85 deps = [
86 ":superstructure_goal_fbs",
87 ":superstructure_lib",
88 ":superstructure_output_fbs",
89 ":superstructure_position_fbs",
90 ":superstructure_status_fbs",
91 "//aos:math",
92 "//aos/events/logging:log_writer",
93 "//aos/testing:googletest",
94 "//aos/time",
95 "//frc971/control_loops:capped_test_plant",
96 "//frc971/control_loops:control_loop_test",
97 "//frc971/control_loops:position_sensor_sim",
98 "//frc971/control_loops:team_number_test_environment",
99 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
100 ],
Sabina Leaver58f04b72021-10-06 20:52:09 -0700101)
102
Philipp Schrader3de4dfc2023-02-15 20:18:25 -0800103ts_project(
Sabina Leaver58f04b72021-10-06 20:52:09 -0700104 name = "superstructure_plotter",
105 srcs = ["superstructure_plotter.ts"],
106 target_compatible_with = ["@platforms//os:linux"],
107 deps = [
108 "//aos/network/www:aos_plotter",
109 "//aos/network/www:colors",
110 "//aos/network/www:proxy",
111 ],
Philipp Schrader37fdbb62021-12-18 00:30:37 -0800112)