blob: 9bae7c7e0af74f51636be53342544a8f6c549c77 [file] [log] [blame]
milind-u086d7262022-01-19 20:44:18 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2load("@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
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",
63 "//aos/events:event_loop",
64 "//frc971/control_loops:control_loop",
Henry Speiser55aa3ba2022-02-21 23:21:12 -080065 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
milind-u086d7262022-01-19 20:44:18 -080066 "//y2022:constants",
67 ],
68)
69
70cc_binary(
71 name = "superstructure",
72 srcs = [
73 "superstructure_main.cc",
74 ],
75 deps = [
76 ":superstructure_lib",
77 "//aos:init",
78 "//aos/events:shm_event_loop",
79 ],
80)
81
82cc_test(
83 name = "superstructure_lib_test",
84 srcs = [
85 "superstructure_lib_test.cc",
86 ],
87 data = [
88 "//y2022:config",
89 ],
90 deps = [
91 ":superstructure_goal_fbs",
92 ":superstructure_lib",
93 ":superstructure_output_fbs",
94 ":superstructure_position_fbs",
95 ":superstructure_status_fbs",
96 "//aos:math",
97 "//aos/events/logging:log_writer",
98 "//aos/testing:googletest",
99 "//aos/time",
100 "//frc971/control_loops:capped_test_plant",
101 "//frc971/control_loops:control_loop_test",
102 "//frc971/control_loops:position_sensor_sim",
103 "//frc971/control_loops:team_number_test_environment",
104 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
105 ],
106)
107
108ts_library(
109 name = "superstructure_plotter",
110 srcs = ["superstructure_plotter.ts"],
111 target_compatible_with = ["@platforms//os:linux"],
112 deps = [
113 "//aos/network/www:aos_plotter",
114 "//aos/network/www:colors",
115 "//aos/network/www:proxy",
116 ],
117)