blob: 631a21d46d53a02534ab2891cb172696d545cef4 [file] [log] [blame]
Stephan Massaltd021f972020-01-05 20:41:23 -08001package(default_visibility = ["//visibility:public"])
2
3load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
4
5flatbuffer_cc_library(
6 name = "superstructure_goal_fbs",
7 srcs = [
8 "superstructure_goal.fbs",
9 ],
10 gen_reflections = 1,
11 includes = [
12 "//frc971/control_loops:control_loops_fbs_includes",
13 "//frc971/control_loops:profiled_subsystem_fbs_includes",
14 ],
15)
16
17flatbuffer_cc_library(
18 name = "superstructure_output_fbs",
19 srcs = [
20 "superstructure_output.fbs",
21 ],
22 gen_reflections = 1,
23)
24
25flatbuffer_cc_library(
26 name = "superstructure_status_fbs",
27 srcs = [
28 "superstructure_status.fbs",
29 ],
30 gen_reflections = 1,
31 includes = [
32 "//frc971/control_loops:control_loops_fbs_includes",
33 "//frc971/control_loops:profiled_subsystem_fbs_includes",
34 ],
35)
36
37flatbuffer_cc_library(
38 name = "superstructure_position_fbs",
39 srcs = [
40 "superstructure_position.fbs",
41 ],
42 gen_reflections = 1,
43 includes = [
44 "//frc971/control_loops:control_loops_fbs_includes",
45 "//frc971/control_loops:profiled_subsystem_fbs_includes",
46 ],
47)
48
49cc_library(
50 name = "superstructure_lib",
51 srcs = [
52 "superstructure.cc",
53 ],
54 hdrs = [
55 "superstructure.h",
56 ],
57 deps = [
John Park0a245a02020-02-02 14:10:15 -080058 ":climber",
Stephan Massaltd021f972020-01-05 20:41:23 -080059 ":superstructure_goal_fbs",
60 ":superstructure_output_fbs",
61 ":superstructure_position_fbs",
62 ":superstructure_status_fbs",
63 "//aos/controls:control_loop",
64 "//aos/events:event_loop",
65 "//y2020: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 Davis7704a652020-02-01 11:42:14 -080080
81cc_test(
82 name = "superstructure_lib_test",
83 srcs = [
84 "superstructure_lib_test.cc",
85 ],
86 data = [
87 "//y2020:config.json",
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/controls:control_loop_test",
Austin Schuh3290c632020-02-20 20:07:33 -080097 "//aos/events/logging:logger",
Sabina Davis7704a652020-02-01 11:42:14 -080098 "//aos/testing:googletest",
99 "//aos/time",
100 "//frc971/control_loops:capped_test_plant",
101 "//frc971/control_loops:position_sensor_sim",
102 "//frc971/control_loops:team_number_test_environment",
103 "//frc971/control_loops/drivetrain:drivetrain_status_fbs",
104 "//y2020/control_loops/superstructure/hood:hood_plants",
Sabina Davis0f2d38c2020-02-08 17:01:21 -0800105 "//y2020/control_loops/superstructure/intake:intake_plants",
Sabina Davis7704a652020-02-01 11:42:14 -0800106 ],
107)
John Park0a245a02020-02-02 14:10:15 -0800108
109cc_library(
110 name = "climber",
111 srcs = [
112 "climber.cc",
113 ],
114 hdrs = [
115 "climber.h",
116 ],
117 deps = [
118 ":superstructure_goal_fbs",
119 ":superstructure_output_fbs",
120 "//aos/controls:control_loop",
121 "//frc971/control_loops:control_loops_fbs",
122 "//frc971/control_loops:profiled_subsystem_fbs",
123 ],
124)