blob: 8266edc7f5e2a46eb05f45607cbf315501937327 [file] [log] [blame]
Ravago Jones486de802021-05-19 20:47:55 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Philipp Schrader87277f42022-01-01 07:45:12 -08002load("@npm//@bazel/typescript:index.bzl", "ts_library")
Ravago Jones486de802021-05-19 20:47:55 -07003
Philipp Schradercc016b32021-12-30 08:59:58 -08004package(default_visibility = ["//visibility:public"])
5
Ravago Jones486de802021-05-19 20:47:55 -07006flatbuffer_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
38flatbuffer_cc_library(
39 name = "superstructure_position_fbs",
40 srcs = [
41 "superstructure_position.fbs",
42 ],
43 gen_reflections = 1,
44 includes = [
45 "//frc971/control_loops:control_loops_fbs_includes",
46 "//frc971/control_loops:profiled_subsystem_fbs_includes",
47 ],
48)
49
50cc_library(
51 name = "superstructure_lib",
52 srcs = [
53 "superstructure.cc",
54 ],
55 hdrs = [
56 "superstructure.h",
57 ],
58 deps = [
59 ":superstructure_goal_fbs",
60 ":superstructure_output_fbs",
61 ":superstructure_position_fbs",
62 ":superstructure_status_fbs",
Ravago Jones486de802021-05-19 20:47:55 -070063 "//aos/events:event_loop",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070064 "//frc971/control_loops:control_loop",
Ravago Jones486de802021-05-19 20:47:55 -070065 "//y2021_bot3:constants",
66 ],
67)
68
69cc_binary(
70 name = "superstructure",
71 srcs = [
72 "superstructure_main.cc",
73 ],
74 deps = [
75 ":superstructure_lib",
76 "//aos:init",
77 "//aos/events:shm_event_loop",
78 ],
79)
Sabina Leaver24f83be2021-09-01 20:40:59 -070080
81cc_test(
82 name = "superstructure_lib_test",
83 srcs = [
84 "superstructure_lib_test.cc",
85 ],
86 data = [
87 "//y2021_bot3:config",
88 ],
89 deps = [
90 ":superstructure_goal_fbs",
91 ":superstructure_lib",
92 ":superstructure_output_fbs",
93 ":superstructure_position_fbs",
94 ":superstructure_status_fbs",
95 "//aos:math",
96 "//aos/events/logging:log_writer",
97 "//aos/testing:googletest",
98 "//aos/time",
99 "//frc971/control_loops:capped_test_plant",
100 "//frc971/control_loops:control_loop_test",
101 "//frc971/control_loops:position_sensor_sim",
102 "//frc971/control_loops:team_number_test_environment",
103 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
104 ],
Sabina Leaver58f04b72021-10-06 20:52:09 -0700105)
106
107ts_library(
108 name = "superstructure_plotter",
109 srcs = ["superstructure_plotter.ts"],
110 target_compatible_with = ["@platforms//os:linux"],
111 deps = [
112 "//aos/network/www:aos_plotter",
113 "//aos/network/www:colors",
114 "//aos/network/www:proxy",
115 ],
Philipp Schrader37fdbb62021-12-18 00:30:37 -0800116)