blob: ccfb0ee6048217e5b55a8dedf60afa9549409c7f [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",
65 "//y2022: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)
80
81cc_test(
82 name = "superstructure_lib_test",
83 srcs = [
84 "superstructure_lib_test.cc",
85 ],
86 data = [
87 "//y2022: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 ],
105)
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 ],
116)